From 0de8e4db080b5739d77d6394eb5c2904e5d1b66f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 Jan 2020 20:01:32 -0500 Subject: [PATCH] Move Mastodon API entities to src/Object --- src/{Api => }/BaseEntity.php | 2 +- src/Factory/Mastodon/Account.php | 4 ++-- src/Factory/Mastodon/FollowRequest.php | 4 ++-- src/Factory/Mastodon/Relationship.php | 2 +- src/Module/Api/Mastodon/FollowRequests.php | 4 ++-- src/Module/Api/Mastodon/Instance.php | 2 +- src/{Api/Entity => Object/Api}/Mastodon/Account.php | 4 ++-- src/{Api/Entity => Object/Api}/Mastodon/Emoji.php | 8 ++++---- src/{Api/Entity => Object/Api}/Mastodon/Field.php | 4 ++-- src/{Api/Entity => Object/Api}/Mastodon/FollowRequest.php | 3 +-- src/{Api/Entity => Object/Api}/Mastodon/Instance.php | 4 ++-- src/{Api/Entity => Object/Api}/Mastodon/Relationship.php | 4 ++-- src/{Api/Entity => Object/Api}/Mastodon/Stats.php | 4 ++-- 13 files changed, 24 insertions(+), 25 deletions(-) rename src/{Api => }/BaseEntity.php (95%) rename src/{Api/Entity => Object/Api}/Mastodon/Account.php (98%) rename src/{Api/Entity => Object/Api}/Mastodon/Emoji.php (68%) rename src/{Api/Entity => Object/Api}/Mastodon/Field.php (78%) rename src/{Api/Entity => Object/Api}/Mastodon/FollowRequest.php (93%) rename src/{Api/Entity => Object/Api}/Mastodon/Instance.php (97%) rename src/{Api/Entity => Object/Api}/Mastodon/Relationship.php (95%) rename src/{Api/Entity => Object/Api}/Mastodon/Stats.php (93%) diff --git a/src/Api/BaseEntity.php b/src/BaseEntity.php similarity index 95% rename from src/Api/BaseEntity.php rename to src/BaseEntity.php index 4bc15943df..9f0cb31f8e 100644 --- a/src/Api/BaseEntity.php +++ b/src/BaseEntity.php @@ -1,6 +1,6 @@ baseUrl, $publicContact, $apcontact, $userContact); + return new \Friendica\Object\Api\Mastodon\Account($this->baseUrl, $publicContact, $apcontact, $userContact); } } diff --git a/src/Factory/Mastodon/FollowRequest.php b/src/Factory/Mastodon/FollowRequest.php index bbaa3135c9..3aabe413d6 100644 --- a/src/Factory/Mastodon/FollowRequest.php +++ b/src/Factory/Mastodon/FollowRequest.php @@ -24,7 +24,7 @@ class FollowRequest extends BaseFactory /** * @param Introduction $introduction - * @return \Friendica\Api\Entity\Mastodon\FollowRequest + * @return \Friendica\Object\Api\Mastodon\FollowRequest * @throws HTTPException\InternalServerErrorException * @throws \ImagickException */ @@ -42,6 +42,6 @@ class FollowRequest extends BaseFactory $apcontact = APContact::getByURL($publicContact['url'], false); - return new \Friendica\Api\Entity\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $publicContact, $apcontact, $userContact); + return new \Friendica\Object\Api\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $publicContact, $apcontact, $userContact); } } diff --git a/src/Factory/Mastodon/Relationship.php b/src/Factory/Mastodon/Relationship.php index 25c9d4c8ce..7a8b216d4e 100644 --- a/src/Factory/Mastodon/Relationship.php +++ b/src/Factory/Mastodon/Relationship.php @@ -2,7 +2,7 @@ namespace Friendica\Factory\Mastodon; -use Friendica\Api\Entity\Mastodon\Relationship as RelationshipEntity; +use Friendica\Object\Api\Mastodon\Relationship as RelationshipEntity; use Friendica\BaseFactory; use Friendica\Model\Contact; diff --git a/src/Module/Api/Mastodon/FollowRequests.php b/src/Module/Api/Mastodon/FollowRequests.php index fc384f7979..79fe487834 100644 --- a/src/Module/Api/Mastodon/FollowRequests.php +++ b/src/Module/Api/Mastodon/FollowRequests.php @@ -2,8 +2,8 @@ namespace Friendica\Module\Api\Mastodon; -use Friendica\Api\Entity\Mastodon; -use Friendica\Api\Entity\Mastodon\Relationship; +use Friendica\Object\Api\Mastodon; +use Friendica\Object\Api\Mastodon\Relationship; use Friendica\Core\System; use Friendica\DI; use Friendica\Model\Contact; diff --git a/src/Module/Api/Mastodon/Instance.php b/src/Module/Api/Mastodon/Instance.php index cc7639f460..c3d1b93ac0 100644 --- a/src/Module/Api/Mastodon/Instance.php +++ b/src/Module/Api/Mastodon/Instance.php @@ -2,7 +2,7 @@ namespace Friendica\Module\Api\Mastodon; -use Friendica\Api\Entity\Mastodon\Instance as InstanceEntity; +use Friendica\Object\Api\Mastodon\Instance as InstanceEntity; use Friendica\Core\System; use Friendica\Module\Base\Api; diff --git a/src/Api/Entity/Mastodon/Account.php b/src/Object/Api/Mastodon/Account.php similarity index 98% rename from src/Api/Entity/Mastodon/Account.php rename to src/Object/Api/Mastodon/Account.php index 8123cf595c..38eefee3df 100644 --- a/src/Api/Entity/Mastodon/Account.php +++ b/src/Object/Api/Mastodon/Account.php @@ -1,9 +1,9 @@