From 2b819b8f8c1eacced3bc40bc98c33410df27f92c Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 26 Mar 2023 18:42:40 -0400 Subject: [PATCH] spelling: resource Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- src/Model/GServer.php | 2 +- src/Model/Photo.php | 6 +++--- src/Module/Api/Mastodon/Statuses.php | 3 +-- src/Module/Api/Twitter/Statuses/Update.php | 7 +++---- src/Protocol/ActivityPub/Receiver.php | 2 +- src/Util/FileSystem.php | 2 +- tests/datasets/config/transformer/resource.node.config.php | 7 +++++++ .../datasets/config/transformer/ressource.node.config.php | 7 ------- 8 files changed, 17 insertions(+), 19 deletions(-) create mode 100644 tests/datasets/config/transformer/resource.node.config.php delete mode 100644 tests/datasets/config/transformer/ressource.node.config.php diff --git a/src/Model/GServer.php b/src/Model/GServer.php index b034ded75..11d3227e8 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -675,7 +675,7 @@ class GServer } // All following checks are done for systems that always have got a "host-meta" endpoint. - // With this check we don't have to waste time and ressources for dead systems. + // With this check we don't have to waste time and resources for dead systems. // Also this hopefully prevents us from receiving abuse messages. if (($serverdata['network'] == Protocol::PHANTOM) || in_array($serverdata['detection-method'], self::DETECT_UNSPECIFIC)) { $validHostMeta = self::validHostMeta($url); diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 2d80df15b..29ae473ab 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -881,14 +881,14 @@ class Photo * Then set the permissions to public. */ - self::setPermissionForRessource($image_rid, $uid, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); + self::setPermissionForResource($image_rid, $uid, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny); } return true; } /** - * Add permissions to photo ressource + * Add permissions to photo resource * @todo mix with previous photo permissions * * @param string $image_rid @@ -899,7 +899,7 @@ class Photo * @param string $str_group_deny * @return void */ - public static function setPermissionForRessource(string $image_rid, int $uid, string $str_contact_allow, string $str_group_allow, string $str_contact_deny, string $str_group_deny) + public static function setPermissionForResource(string $image_rid, int $uid, string $str_contact_allow, string $str_group_allow, string $str_contact_deny, string $str_group_deny) { $fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow, 'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny, diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 185756cdf..f8f46a895 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -391,9 +391,8 @@ class Statuses extends BaseApi continue; } - Photo::setPermissionForRessource($media[0]['resource-id'], $item['uid'], $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']); + Photo::setPermissionForResource($media[0]['resource-id'], $item['uid'], $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']); - $ressources[] = $media[0]['resource-id']; $phototypes = Images::supportedTypes(); $ext = $phototypes[$media[0]['type']]; diff --git a/src/Module/Api/Twitter/Statuses/Update.php b/src/Module/Api/Twitter/Statuses/Update.php index 702cc169e..df51ff8a8 100644 --- a/src/Module/Api/Twitter/Statuses/Update.php +++ b/src/Module/Api/Twitter/Statuses/Update.php @@ -153,11 +153,10 @@ class Update extends BaseApi continue; } - Photo::setPermissionForRessource($media[0]['resource-id'], $uid, $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']); + Photo::setPermissionForResource($media[0]['resource-id'], $uid, $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']); - $ressources[] = $media[0]['resource-id']; - $phototypes = Images::supportedTypes(); - $ext = $phototypes[$media[0]['type']]; + $phototypes = Images::supportedTypes(); + $ext = $phototypes[$media[0]['type']]; $attachment = [ 'type' => Post\Media::IMAGE, diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 26d5d0d1c..468af6c72 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -1370,7 +1370,7 @@ class Receiver } /** - * Fetches the object data from external ressources if needed + * Fetches the object data from external resources if needed * * @param string $object_id Object ID of the provided object * @param array $object The provided object array diff --git a/src/Util/FileSystem.php b/src/Util/FileSystem.php index e86d6b595..a21e7fb60 100644 --- a/src/Util/FileSystem.php +++ b/src/Util/FileSystem.php @@ -73,7 +73,7 @@ class FileSystem * * @param string $url The file/url * - * @return resource the open stream rssource + * @return resource the open stream resource * * @throws \UnexpectedValueException */ diff --git a/tests/datasets/config/transformer/resource.node.config.php b/tests/datasets/config/transformer/resource.node.config.php new file mode 100644 index 000000000..f7f0f6b1a --- /dev/null +++ b/tests/datasets/config/transformer/resource.node.config.php @@ -0,0 +1,7 @@ + [ + 'resources_not_allowed' => new \GuzzleHttp\Psr7\AppendStream(), + ], +]; diff --git a/tests/datasets/config/transformer/ressource.node.config.php b/tests/datasets/config/transformer/ressource.node.config.php deleted file mode 100644 index b83a139e3..000000000 --- a/tests/datasets/config/transformer/ressource.node.config.php +++ /dev/null @@ -1,7 +0,0 @@ - [ - 'ressources_not_allowed' => new \GuzzleHttp\Psr7\AppendStream(), - ], -];