Skip to content

Commit

Permalink
Merge pull request #38878 from nextcloud/cleanup/controller-service-a…
Browse files Browse the repository at this point in the history
…liases

Cleanup controller service aliases
  • Loading branch information
provokateurin committed Jun 19, 2023
2 parents 59f63a7 + efb7448 commit 885dc63
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion apps/comments/composer/composer/autoload_classmap.php
Expand Up @@ -14,7 +14,7 @@
'OCA\\Comments\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
'OCA\\Comments\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
'OCA\\Comments\\Collaboration\\CommentersSorter' => $baseDir . '/../lib/Collaboration/CommentersSorter.php',
'OCA\\Comments\\Controller\\Notifications' => $baseDir . '/../lib/Controller/Notifications.php',
'OCA\\Comments\\Controller\\NotificationsController' => $baseDir . '/../lib/Controller/NotificationsController.php',
'OCA\\Comments\\EventHandler' => $baseDir . '/../lib/EventHandler.php',
'OCA\\Comments\\Listener\\CommentsEntityEventListener' => $baseDir . '/../lib/Listener/CommentsEntityEventListener.php',
'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir . '/../lib/Listener/LoadAdditionalScripts.php',
Expand Down
6 changes: 3 additions & 3 deletions apps/comments/composer/composer/autoload_static.php
Expand Up @@ -7,14 +7,14 @@
class ComposerStaticInitComments
{
public static $prefixLengthsPsr4 = array (
'O' =>
'O' =>
array (
'OCA\\Comments\\' => 13,
),
);

public static $prefixDirsPsr4 = array (
'OCA\\Comments\\' =>
'OCA\\Comments\\' =>
array (
0 => __DIR__ . '/..' . '/../lib',
),
Expand All @@ -29,7 +29,7 @@ class ComposerStaticInitComments
'OCA\\Comments\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
'OCA\\Comments\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
'OCA\\Comments\\Collaboration\\CommentersSorter' => __DIR__ . '/..' . '/../lib/Collaboration/CommentersSorter.php',
'OCA\\Comments\\Controller\\Notifications' => __DIR__ . '/..' . '/../lib/Controller/Notifications.php',
'OCA\\Comments\\Controller\\NotificationsController' => __DIR__ . '/..' . '/../lib/Controller/NotificationsController.php',
'OCA\\Comments\\EventHandler' => __DIR__ . '/..' . '/../lib/EventHandler.php',
'OCA\\Comments\\Listener\\CommentsEntityEventListener' => __DIR__ . '/..' . '/../lib/Listener/CommentsEntityEventListener.php',
'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalScripts.php',
Expand Down
3 changes: 0 additions & 3 deletions apps/comments/lib/AppInfo/Application.php
Expand Up @@ -28,7 +28,6 @@

use Closure;
use OCA\Comments\Capabilities;
use OCA\Comments\Controller\Notifications;
use OCA\Comments\EventHandler;
use OCA\Comments\Listener\CommentsEntityEventListener;
use OCA\Comments\Listener\LoadAdditionalScripts;
Expand Down Expand Up @@ -58,8 +57,6 @@ public function __construct(array $urlParams = []) {
public function register(IRegistrationContext $context): void {
$context->registerCapability(Capabilities::class);

$context->registerServiceAlias('NotificationsController', Notifications::class);

$context->registerEventListener(
LoadAdditionalScriptsEvent::class,
LoadAdditionalScripts::class
Expand Down
Expand Up @@ -38,11 +38,11 @@
use OCP\Notification\IManager;

/**
* Class Notifications
* Class NotificationsController
*
* @package OCA\Comments\Controller
*/
class Notifications extends Controller {
class NotificationsController extends Controller {

protected IRootFolder $rootFolder;
protected ICommentsManager $commentsManager;
Expand All @@ -51,7 +51,7 @@ class Notifications extends Controller {
protected IUserSession $userSession;

/**
* Notifications constructor.
* NotificationsController constructor.
*/
public function __construct(
string $appName,
Expand Down
5 changes: 1 addition & 4 deletions apps/comments/tests/Unit/AppInfo/ApplicationTest.php
Expand Up @@ -51,11 +51,8 @@ public function test() {
$app = new Application();
$c = $app->getContainer();

// assert service instances in the container are properly setup
$s = $c->get('NotificationsController');
$this->assertInstanceOf('OCA\Comments\Controller\Notifications', $s);

$services = [
'OCA\Comments\Controller\NotificationsController',
'OCA\Comments\Activity\Filter',
'OCA\Comments\Activity\Listener',
'OCA\Comments\Activity\Provider',
Expand Down
6 changes: 3 additions & 3 deletions apps/comments/tests/Unit/Controller/NotificationsTest.php
Expand Up @@ -25,7 +25,7 @@
*/
namespace OCA\Comments\Tests\Unit\Controller;

use OCA\Comments\Controller\Notifications;
use OCA\Comments\Controller\NotificationsController;
use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\Comments\IComment;
Expand All @@ -43,7 +43,7 @@
use Test\TestCase;

class NotificationsTest extends TestCase {
/** @var Notifications */
/** @var NotificationsController */
protected $notificationsController;

/** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
Expand All @@ -70,7 +70,7 @@ protected function setUp(): void {
$this->notificationManager = $this->createMock(IManager::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);

$this->notificationsController = new Notifications(
$this->notificationsController = new NotificationsController(
'comments',
$this->createMock(IRequest::class),
$this->commentsManager,
Expand Down
Expand Up @@ -23,7 +23,7 @@
'OCA\\WorkflowEngine\\Command\\Index' => $baseDir . '/../lib/Command/Index.php',
'OCA\\WorkflowEngine\\Controller\\AWorkflowController' => $baseDir . '/../lib/Controller/AWorkflowController.php',
'OCA\\WorkflowEngine\\Controller\\GlobalWorkflowsController' => $baseDir . '/../lib/Controller/GlobalWorkflowsController.php',
'OCA\\WorkflowEngine\\Controller\\RequestTime' => $baseDir . '/../lib/Controller/RequestTime.php',
'OCA\\WorkflowEngine\\Controller\\RequestTimeController' => $baseDir . '/../lib/Controller/RequestTimeController.php',
'OCA\\WorkflowEngine\\Controller\\UserWorkflowsController' => $baseDir . '/../lib/Controller/UserWorkflowsController.php',
'OCA\\WorkflowEngine\\Entity\\File' => $baseDir . '/../lib/Entity/File.php',
'OCA\\WorkflowEngine\\Helper\\LogContext' => $baseDir . '/../lib/Helper/LogContext.php',
Expand Down
2 changes: 1 addition & 1 deletion apps/workflowengine/composer/composer/autoload_static.php
Expand Up @@ -38,7 +38,7 @@ class ComposerStaticInitWorkflowEngine
'OCA\\WorkflowEngine\\Command\\Index' => __DIR__ . '/..' . '/../lib/Command/Index.php',
'OCA\\WorkflowEngine\\Controller\\AWorkflowController' => __DIR__ . '/..' . '/../lib/Controller/AWorkflowController.php',
'OCA\\WorkflowEngine\\Controller\\GlobalWorkflowsController' => __DIR__ . '/..' . '/../lib/Controller/GlobalWorkflowsController.php',
'OCA\\WorkflowEngine\\Controller\\RequestTime' => __DIR__ . '/..' . '/../lib/Controller/RequestTime.php',
'OCA\\WorkflowEngine\\Controller\\RequestTimeController' => __DIR__ . '/..' . '/../lib/Controller/RequestTimeController.php',
'OCA\\WorkflowEngine\\Controller\\UserWorkflowsController' => __DIR__ . '/..' . '/../lib/Controller/UserWorkflowsController.php',
'OCA\\WorkflowEngine\\Entity\\File' => __DIR__ . '/..' . '/../lib/Entity/File.php',
'OCA\\WorkflowEngine\\Helper\\LogContext' => __DIR__ . '/..' . '/../lib/Helper/LogContext.php',
Expand Down
2 changes: 0 additions & 2 deletions apps/workflowengine/lib/AppInfo/Application.php
Expand Up @@ -27,7 +27,6 @@
namespace OCA\WorkflowEngine\AppInfo;

use Closure;
use OCA\WorkflowEngine\Controller\RequestTime;
use OCA\WorkflowEngine\Helper\LogContext;
use OCA\WorkflowEngine\Listener\LoadAdditionalSettingsScriptsListener;
use OCA\WorkflowEngine\Manager;
Expand All @@ -53,7 +52,6 @@ public function __construct() {
}

public function register(IRegistrationContext $context): void {
$context->registerServiceAlias('RequestTimeController', RequestTime::class);
$context->registerEventListener(
LoadSettingsScriptsEvent::class,
LoadAdditionalSettingsScriptsListener::class,
Expand Down
Expand Up @@ -26,7 +26,7 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;

class RequestTime extends Controller {
class RequestTimeController extends Controller {

/**
* @NoAdminRequired
Expand Down
2 changes: 1 addition & 1 deletion apps/workflowengine/src/components/Checks/request.js
Expand Up @@ -38,7 +38,7 @@ const RequestChecks = [
component: RequestURL,
},
{
class: 'OCA\\WorkflowEngine\\Check\\RequestTime',
class: 'OCA\\WorkflowEngine\\Check\\RequestTimeController',
name: t('workflowengine', 'Request time'),
operators: [
{ operator: 'in', name: t('workflowengine', 'between') },
Expand Down
4 changes: 2 additions & 2 deletions dist/workflowengine-workflowengine.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/workflowengine-workflowengine.js.map

Large diffs are not rendered by default.

0 comments on commit 885dc63

Please sign in to comment.