diff --git a/composer.lock b/composer.lock index 58e56fbb..379b97db 100644 --- a/composer.lock +++ b/composer.lock @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/daita/my-small-php-tools.git", - "reference": "fc822e4c08072844ad9d58846d407e83a62b3d38" + "reference": "ba839f3253672defc4bbb181493c78e2c96e272a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/daita/my-small-php-tools/zipball/fc822e4c08072844ad9d58846d407e83a62b3d38", - "reference": "fc822e4c08072844ad9d58846d407e83a62b3d38", + "url": "https://api.github.com/repos/daita/my-small-php-tools/zipball/ba839f3253672defc4bbb181493c78e2c96e272a", + "reference": "ba839f3253672defc4bbb181493c78e2c96e272a", "shasum": "" }, "require": { @@ -40,7 +40,7 @@ } ], "description": "My small PHP Tools", - "time": "2018-11-20T22:42:57+00:00" + "time": "2018-11-27T14:31:43+00:00" } ], "packages-dev": [], diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index 1217d523..cf30f8c9 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -87,7 +87,7 @@ class LocalController extends Controller { /** - * NavigationController constructor. + * LocalController constructor. * * @param IRequest $request * @param string $userId diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php index 0ea904bc..6cc36c17 100644 --- a/lib/Model/ActivityPub/ACore.php +++ b/lib/Model/ActivityPub/ACore.php @@ -36,7 +36,7 @@ use JsonSerializable; use OCA\Social\Exceptions\ActivityCantBeVerifiedException; use OCA\Social\Exceptions\UrlCloudException; use OCA\Social\Model\InstancePath; -use OCA\Social\Service\ICoreService; +use OCA\Social\Service\ActivityPub\ICoreService; abstract class ACore implements JsonSerializable { diff --git a/lib/Service/ActivityPub/DeleteService.php b/lib/Service/ActivityPub/DeleteService.php index 1d38ef33..7f7044dd 100644 --- a/lib/Service/ActivityPub/DeleteService.php +++ b/lib/Service/ActivityPub/DeleteService.php @@ -38,7 +38,6 @@ use OCA\Social\Exceptions\UnknownItemException; use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\Activity\Delete; use OCA\Social\Service\ActivityService; -use OCA\Social\Service\ICoreService; use OCA\Social\Service\MiscService; diff --git a/lib/Service/ActivityPub/FollowService.php b/lib/Service/ActivityPub/FollowService.php index 36423fbc..e6f377e5 100644 --- a/lib/Service/ActivityPub/FollowService.php +++ b/lib/Service/ActivityPub/FollowService.php @@ -49,7 +49,6 @@ use OCA\Social\Model\ActivityPub\Person; use OCA\Social\Model\InstancePath; use OCA\Social\Service\ActivityService; use OCA\Social\Service\ConfigService; -use OCA\Social\Service\ICoreService; use OCA\Social\Service\MiscService; diff --git a/lib/Service/ICoreService.php b/lib/Service/ActivityPub/ICoreService.php similarity index 96% rename from lib/Service/ICoreService.php rename to lib/Service/ActivityPub/ICoreService.php index 5035987c..6f377921 100644 --- a/lib/Service/ICoreService.php +++ b/lib/Service/ActivityPub/ICoreService.php @@ -28,7 +28,7 @@ declare(strict_types=1); */ -namespace OCA\Social\Service; +namespace OCA\Social\Service\ActivityPub; use OCA\Social\Model\ActivityPub\ACore; diff --git a/lib/Service/ActivityPub/NoteService.php b/lib/Service/ActivityPub/NoteService.php index 7107c1fe..6a6ce00f 100644 --- a/lib/Service/ActivityPub/NoteService.php +++ b/lib/Service/ActivityPub/NoteService.php @@ -47,7 +47,6 @@ use OCA\Social\Service\ActivityService; use OCA\Social\Service\ActorService; use OCA\Social\Service\ConfigService; use OCA\Social\Service\CurlService; -use OCA\Social\Service\ICoreService; use OCA\Social\Service\MiscService; class NoteService implements ICoreService { diff --git a/lib/Service/ActivityPub/PersonService.php b/lib/Service/ActivityPub/PersonService.php index 432ab2a9..31ac4aaa 100644 --- a/lib/Service/ActivityPub/PersonService.php +++ b/lib/Service/ActivityPub/PersonService.php @@ -44,7 +44,6 @@ use OCA\Social\Exceptions\UrlCloudException; use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\Person; use OCA\Social\Service\ConfigService; -use OCA\Social\Service\ICoreService; use OCA\Social\Service\InstanceService; use OCA\Social\Service\MiscService; diff --git a/lib/Service/ActivityPub/UndoService.php b/lib/Service/ActivityPub/UndoService.php index 8c965648..3941c38a 100644 --- a/lib/Service/ActivityPub/UndoService.php +++ b/lib/Service/ActivityPub/UndoService.php @@ -33,7 +33,6 @@ namespace OCA\Social\Service\ActivityPub; use Exception; use OCA\Social\Model\ActivityPub\ACore; -use OCA\Social\Service\ICoreService; use OCA\Social\Service\MiscService; diff --git a/lib/Service/ImportService.php b/lib/Service/ImportService.php index 381fac1e..f2e848fb 100644 --- a/lib/Service/ImportService.php +++ b/lib/Service/ImportService.php @@ -71,6 +71,7 @@ class ImportService { /** @var DeleteService */ private $deleteService; + /** @var ConfigService */ private $configService; /** @var MiscService */ diff --git a/lib/Service/PostService.php b/lib/Service/PostService.php index d43a5315..980b6089 100644 --- a/lib/Service/PostService.php +++ b/lib/Service/PostService.php @@ -30,6 +30,7 @@ declare(strict_types=1); namespace OCA\Social\Service; +use Exception; use OC\User\NoUserException; use OCA\Social\Exceptions\ActorDoesNotExistException; use OCA\Social\Exceptions\RequestException; @@ -77,20 +78,20 @@ class PostService { * @param Post $post * @param ACore $activity * - * @return array + * @return string * @throws ActorDoesNotExistException * @throws NoUserException - * @throws RequestException * @throws SocialAppConfigException + * @throws Exception */ - public function createPost(Post $post, ACore &$activity = null) { + public function createPost(Post $post, ACore &$activity = null): string { $note = $this->noteService->generateNote( $post->getUserId(), $post->getContent(), $post->getType() ); - $this->noteService->addRecipients($note, $post->getType(), $post->getTo()); $this->noteService->replyTo($note, $post->getReplyTo()); + $this->noteService->addRecipients($note, $post->getType(), $post->getTo()); $actor = $this->actorService->getActorFromUserId($post->getUserId());