summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-12-17 08:24:42 -0100
committerMaxence Lange <maxence@artificial-owl.com>2018-12-17 08:24:42 -0100
commitd923faabf3b628a5a45ce9a5f6e5605b07163425 (patch)
tree71819e3708640b98bf62963f857d6dbebfd4354c /lib
parent86f2029834f8e474873c335d29e9bf9f6b6f4abf (diff)
cleaning code
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Command/QueueProcess.php7
-rw-r--r--lib/Service/ActorService.php89
2 files changed, 48 insertions, 48 deletions
diff --git a/lib/Command/QueueProcess.php b/lib/Command/QueueProcess.php
index e73229ec..337185bd 100644
--- a/lib/Command/QueueProcess.php
+++ b/lib/Command/QueueProcess.php
@@ -31,9 +31,12 @@ declare(strict_types=1);
namespace OCA\Social\Command;
+use daita\MySmallPhpTools\Exceptions\MalformedArrayException;
use OC\Core\Command\Base;
+use OCA\Social\Exceptions\RedundancyLimitException;
use OCA\Social\Exceptions\RequestException;
use OCA\Social\Exceptions\SocialAppConfigException;
+use OCA\Social\Exceptions\UnknownItemException;
use OCA\Social\Service\ActivityService;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
@@ -92,6 +95,10 @@ class QueueProcess extends Base {
/**
* @param InputInterface $input
* @param OutputInterface $output
+ *
+ * @throws RedundancyLimitException
+ * @throws UnknownItemException
+ * @throws MalformedArrayException
*/
protected function execute(InputInterface $input, OutputInterface $output) {
diff --git a/lib/Service/ActorService.php b/lib/Service/ActorService.php
index 147d8857..980f4be0 100644
--- a/lib/Service/ActorService.php
+++ b/lib/Service/ActorService.php
@@ -30,20 +30,13 @@ declare(strict_types=1);
namespace OCA\Social\Service;
-use daita\MySmallPhpTools\Exceptions\MalformedArrayException;
use daita\MySmallPhpTools\Traits\TArrayTools;
-use Exception;
-use OCA\Social\AP;
use OCA\Social\Db\CacheActorsRequest;
use OCA\Social\Db\CacheDocumentsRequest;
-use OCA\Social\Exceptions\CacheActorDoesNotExistException;
use OCA\Social\Exceptions\CacheDocumentDoesNotExistException;
use OCA\Social\Exceptions\InvalidResourceEntryException;
use OCA\Social\Exceptions\InvalidResourceException;
-use OCA\Social\Exceptions\Request410Exception;
-use OCA\Social\Exceptions\RequestException;
use OCA\Social\Exceptions\SocialAppConfigException;
-use OCA\Social\Exceptions\UnknownItemException;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\Actor\Person;
@@ -131,47 +124,47 @@ class ActorService {
}
- /**
- * @param string $id
- *
- * @param bool $refresh
- *
- * @return Person
- * @throws InvalidResourceException
- * @throws RequestException
- * @throws SocialAppConfigException
- * @throws UrlCloudException
- * @throws Request410Exception
- * @throws MalformedArrayException
- * @throws InvalidResourceEntryException
- */
- public function getFromId(string $id, bool $refresh = false): Person {
-
- $posAnchor = strpos($id, '#');
- if ($posAnchor !== false) {
- $id = substr($id, 0, $posAnchor);
- }
-
- try {
- if ($refresh) {
- $this->cacheActorsRequest->deleteFromId($id);
- throw new CacheActorDoesNotExistException();
- }
-
- $actor = $this->cacheActorsRequest->getFromId($id);
- } catch (CacheActorDoesNotExistException $e) {
- $object = $this->curlService->retrieveObject($id);
- $actor = $this->generateActorFromObject($object);
- $actor->setAccount($actor->getPreferredUsername() . '@' . $this->get('_host', $object));
- try {
- $this->save($actor);
- } catch (Exception $e) {
- throw new InvalidResourceException($e->getMessage());
- }
- }
-
- return $actor;
- }
+// /**
+// * @param string $id
+// *
+// * @param bool $refresh
+// *
+// * @return Person
+// * @throws InvalidResourceException
+// * @throws RequestException
+// * @throws SocialAppConfigException
+// * @throws UrlCloudException
+// * @throws Request410Exception
+// * @throws MalformedArrayException
+// * @throws InvalidResourceEntryException
+// */
+// public function getFromId(string $id, bool $refresh = false): Person {
+//
+// $posAnchor = strpos($id, '#');
+// if ($posAnchor !== false) {
+// $id = substr($id, 0, $posAnchor);
+// }
+//
+// try {
+// if ($refresh) {
+// $this->cacheActorsRequest->deleteFromId($id);
+// throw new CacheActorDoesNotExistException();
+// }
+//
+// $actor = $this->cacheActorsRequest->getFromId($id);
+// } catch (CacheActorDoesNotExistException $e) {
+// $object = $this->curlService->retrieveObject($id);
+// $actor = $this->generateActorFromObject($object);
+// $actor->setAccount($actor->getPreferredUsername() . '@' . $this->get('_host', $object));
+// try {
+// $this->save($actor);
+// } catch (Exception $e) {
+// throw new InvalidResourceException($e->getMessage());
+// }
+// }
+//
+// return $actor;
+// }
// /**