summaryrefslogtreecommitdiffstats
path: root/lib/Controller
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-11-30 10:21:11 -0100
committerMaxence Lange <maxence@artificial-owl.com>2018-11-30 10:21:11 -0100
commitc27f697f0a64ac253b938d2b4535e108b0cca7e1 (patch)
treea1652e7df77457579d88ab85718538439d860a34 /lib/Controller
parent75447af7671b9e45d3f5db0ba75bbfcd6a0318a3 (diff)
cleaning
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/ActivityPubController.php7
-rw-r--r--lib/Controller/ConfigController.php17
-rw-r--r--lib/Controller/LocalController.php3
-rw-r--r--lib/Controller/NavigationController.php20
-rw-r--r--lib/Controller/QueueController.php2
-rw-r--r--lib/Controller/SocialPubController.php2
6 files changed, 20 insertions, 31 deletions
diff --git a/lib/Controller/ActivityPubController.php b/lib/Controller/ActivityPubController.php
index a958f7bc..83646e36 100644
--- a/lib/Controller/ActivityPubController.php
+++ b/lib/Controller/ActivityPubController.php
@@ -74,9 +74,6 @@ class ActivityPubController extends Controller {
/** @var MiscService */
private $miscService;
- /** @var NavigationController */
- private $navigationController;
-
/**
* ActivityPubController constructor.
@@ -94,13 +91,11 @@ class ActivityPubController extends Controller {
IRequest $request, SocialPubController $socialPubController,
ActivityService $activityService, ImportService $importService,
FollowService $followService, ActorService $actorService, NotesRequest $notesRequest,
- NavigationController $navigationController,
MiscService $miscService
) {
parent::__construct(Application::APP_NAME, $request);
$this->socialPubController = $socialPubController;
- $this->navigationController = $navigationController;
$this->activityService = $activityService;
$this->importService = $importService;
@@ -258,7 +253,7 @@ class ActivityPubController extends Controller {
*
* @return Response
*/
- public function followers(string $username, $data): Response {
+ public function followers(string $username): Response {
if (!$this->checkSourceActivityStreams()) {
return $this->socialPubController->followers($username);
diff --git a/lib/Controller/ConfigController.php b/lib/Controller/ConfigController.php
index dc2ee989..3059ec14 100644
--- a/lib/Controller/ConfigController.php
+++ b/lib/Controller/ConfigController.php
@@ -25,11 +25,8 @@ declare(strict_types=1);
namespace OCA\Social\Controller;
-use OCA\Activity\Data;
-use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Service\ConfigService;
use OCP\AppFramework\Controller;
-use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
@@ -46,16 +43,12 @@ class ConfigController extends Controller {
/**
* @param string $cloudAddress
+ *
* @return DataResponse
*/
public function setCloudAddress(string $cloudAddress): DataResponse {
- try {
- $this->configService->setCloudAddress($cloudAddress);
- return new DataResponse([]);
- } catch (SocialAppConfigException $e) {
- return new DataResponse([
- 'message' => $e->getMessage()
- ], Http::STATUS_BAD_REQUEST);
- }
+ $this->configService->setCloudAddress($cloudAddress);
+
+ return new DataResponse([]);
}
-} \ No newline at end of file
+}
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php
index 73a05cec..03dba180 100644
--- a/lib/Controller/LocalController.php
+++ b/lib/Controller/LocalController.php
@@ -219,6 +219,9 @@ class LocalController extends Controller {
* @NoAdminRequired
* @NoSubAdminRequired
*
+ * @param int $since
+ * @param int $limit
+ *
* @return DataResponse
*/
public function streamDirect(int $since = 0, int $limit = 5): DataResponse {
diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php
index b14f46bd..0911b12f 100644
--- a/lib/Controller/NavigationController.php
+++ b/lib/Controller/NavigationController.php
@@ -30,11 +30,9 @@ declare(strict_types=1);
namespace OCA\Social\Controller;
-use daita\MySmallPhpTools\Traits\TArrayTools;
use daita\MySmallPhpTools\Traits\Nextcloud\TNCDataResponse;
+use daita\MySmallPhpTools\Traits\TArrayTools;
use Exception;
-use OC\Files\Node\File;
-use OC\Files\SimpleFS\SimpleFile;
use OC\User\NoUserException;
use OCA\Social\AppInfo\Application;
use OCA\Social\Exceptions\AccountAlreadyExistsException;
@@ -48,9 +46,7 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\FileDisplayResponse;
-use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\Response;
-use OCP\AppFramework\Http\Template\PublicTemplateResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IL10N;
@@ -132,9 +128,11 @@ class NavigationController extends Controller {
* @NoAdminRequired
* @NoSubAdminRequired
*
+ * @param string $path
+ *
* @return TemplateResponse
*/
- public function navigate($path = ''): TemplateResponse {
+ public function navigate(string $path = ''): TemplateResponse {
$data = [
'serverData' => [
'public' => false,
@@ -230,10 +228,11 @@ class NavigationController extends Controller {
* @NoAdminRequired
* @NoSubAdminRequired
*
+ * @param string $path
+ *
* @return TemplateResponse
- * @throws NoUserException
*/
- public function timeline($path = ''): TemplateResponse {
+ public function timeline(string $path = ''): TemplateResponse {
return $this->navigate();
}
@@ -244,10 +243,11 @@ class NavigationController extends Controller {
* @NoAdminRequired
* @NoSubAdminRequired
*
+ * @param string $path
+ *
* @return TemplateResponse
- * @throws NoUserException
*/
- public function account($path = ''): TemplateResponse {
+ public function account(string $path = ''): TemplateResponse {
return $this->navigate();
}
diff --git a/lib/Controller/QueueController.php b/lib/Controller/QueueController.php
index 26cdddfa..c85dee2b 100644
--- a/lib/Controller/QueueController.php
+++ b/lib/Controller/QueueController.php
@@ -32,12 +32,10 @@ namespace OCA\Social\Controller;
use daita\MySmallPhpTools\Traits\TAsync;
use OCA\Social\AppInfo\Application;
-use OCA\Social\Exceptions\ActorDoesNotExistException;
use OCA\Social\Exceptions\RequestException;
use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Model\RequestQueue;
use OCA\Social\Service\ActivityService;
-use OCA\Social\Service\CurlService;
use OCA\Social\Service\MiscService;
use OCA\Social\Service\QueueService;
use OCP\AppFramework\Controller;
diff --git a/lib/Controller/SocialPubController.php b/lib/Controller/SocialPubController.php
index f0ddb1d4..efd35049 100644
--- a/lib/Controller/SocialPubController.php
+++ b/lib/Controller/SocialPubController.php
@@ -137,7 +137,7 @@ class SocialPubController extends Controller {
} catch (CacheActorDoesNotExistException $e) {
return new NotFoundResponse();
} catch (Exception $e) {
- $this->fail($e);
+ return $this->fail($e);
}
}