Commit 489dd89e authored by Tino Goratsch's avatar Tino Goratsch

renamed the abstract controllers (admin, frontend, widget, installer) to be...

renamed the abstract controllers (admin, frontend, widget, installer) to be *Action, be better reflect, that they are action controllers
parent 709e5752
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Application;
use ACP3\Core\Controller\ControllerInterface;
use ACP3\Core\Controller\ActionInterface;
use ACP3\Core\Exceptions;
use ACP3\Core\Exceptions\ResultNotExists;
use ACP3\Core\Http\RequestInterface;
......@@ -45,7 +50,7 @@ class FrontController
}
if ($this->container->has($serviceId)) {
/** @var \ACP3\Core\Controller\ControllerInterface $controller */
/** @var \ACP3\Core\Controller\ActionInterface $controller */
$controller = $this->container->get($serviceId);
$controller->setContainer($this->container);
$controller->preDispatch();
......@@ -89,18 +94,18 @@ class FrontController
}
/**
* @param \ACP3\Core\Http\RequestInterface $request
* @param \ACP3\Core\Controller\ControllerInterface $controller
* @param string $action
* @param array $arguments
* @param bool $resolveArguments
* @param \ACP3\Core\Http\RequestInterface $request
* @param \ACP3\Core\Controller\ActionInterface $controller
* @param string $action
* @param array $arguments
* @param bool $resolveArguments
*
* @return mixed
* @throws \ACP3\Core\Exceptions\ResultNotExists
*/
private function executeControllerAction(
RequestInterface $request,
ControllerInterface $controller,
ActionInterface $controller,
$action,
array $arguments,
$resolveArguments
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Assets;
use ACP3\Core;
......@@ -22,7 +27,7 @@ class FileResolver
*/
protected $resourcesCache;
/**
* @var \ACP3\Core\Modules\Vendors
* @var \ACP3\Core\Modules\Vendor
*/
protected $vendors;
/**
......@@ -46,13 +51,13 @@ class FileResolver
* @param \ACP3\Core\XML $xml
* @param \ACP3\Core\Assets\Cache $resourcesCache
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Modules\Vendors $vendors
* @param \ACP3\Core\Modules\Vendor $vendors
*/
public function __construct(
Core\XML $xml,
Core\Assets\Cache $resourcesCache,
Core\Environment\ApplicationPath $appPath,
Core\Modules\Vendors $vendors
Core\Modules\Vendor $vendors
) {
$this->xml = $xml;
$this->resourcesCache = $resourcesCache;
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Controller;
......@@ -8,10 +9,10 @@ namespace ACP3\Core\Controller;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Interface ControllerInterface
* Interface ActionInterface
* @package ACP3\Core\Controller
*/
interface ControllerInterface
interface ActionInterface
{
public function preDispatch();
......@@ -32,7 +33,7 @@ interface ControllerInterface
public function setContainer(ContainerInterface $container);
/**
* @param mixed $controllerActionResult
* @param mixed $actionResult
*/
public function display($controllerActionResult);
public function display($actionResult);
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Controller;
......@@ -8,10 +9,10 @@ namespace ACP3\Core\Controller;
use ACP3\Core;
/**
* Class AdminController
* @package ACP3\Core\Modules
* Class AdminAction
* @package ACP3\Core\Controller
*/
abstract class AdminController extends Core\Controller\FrontendController
abstract class AdminAction extends Core\Controller\FrontendAction
{
/**
* @var \ACP3\Core\SessionHandler
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Controller;
......@@ -9,10 +10,10 @@ use ACP3\Core;
use ACP3\Core\Modules\DisplayControllerActionTrait;
/**
* Class FrontendController
* Class FrontendAction
* @package ACP3\Core\Controller
*/
abstract class FrontendController extends Core\Controller\WidgetController
abstract class FrontendAction extends Core\Controller\WidgetAction
{
use DisplayControllerActionTrait;
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Controller;
......@@ -9,10 +10,10 @@ use ACP3\Core;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Class WidgetController
* Class WidgetAction
* @package ACP3\Core\Controller
*/
abstract class WidgetController implements ControllerInterface
abstract class WidgetAction implements ActionInterface
{
/**
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
......@@ -149,7 +150,7 @@ abstract class WidgetController implements ControllerInterface
/**
* @inheritdoc
*/
public function display($controllerActionResult)
public function display($actionResult)
{
if ($this->getNoOutput() === false && $this->getTemplate() !== '') {
$this->view->displayTemplate($this->getTemplate());
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\I18n;
use ACP3\Core\Cache;
use ACP3\Core\Environment\ApplicationPath;
use ACP3\Core\Modules\Vendors;
use ACP3\Core\Modules\Vendor;
/**
* Class Cache
......@@ -20,7 +25,7 @@ class DictionaryCache
*/
protected $appPath;
/**
* @var \ACP3\Core\Modules\Vendors
* @var \ACP3\Core\Modules\Vendor
*/
protected $vendors;
......@@ -29,12 +34,12 @@ class DictionaryCache
*
* @param \ACP3\Core\Cache $cache
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Modules\Vendors $vendors
* @param \ACP3\Core\Modules\Vendor $vendors
*/
public function __construct(
Cache $cache,
ApplicationPath $appPath,
Vendors $vendors
Vendor $vendors
)
{
$this->cache = $cache;
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core;
use ACP3\Core\Environment\ApplicationPath;
use ACP3\Core\Modules\Helper\ControllerActionExists;
use ACP3\Core\Modules\ModuleInfoCache;
use ACP3\Core\Modules\Vendors;
use ACP3\Core\Modules\Vendor;
use ACP3\Modules\ACP3\System;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -31,7 +36,7 @@ class Modules
*/
protected $moduleInfoCache;
/**
* @var \ACP3\Core\Modules\Vendors
* @var \ACP3\Core\Modules\Vendor
*/
protected $vendors;
/**
......@@ -48,14 +53,14 @@ class Modules
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Modules\Helper\ControllerActionExists $controllerActionExists
* @param \ACP3\Core\Modules\ModuleInfoCache $moduleInfoCache
* @param \ACP3\Core\Modules\Vendors $vendors
* @param \ACP3\Core\Modules\Vendor $vendors
*/
public function __construct(
ContainerInterface $container,
ApplicationPath $appPath,
ControllerActionExists $controllerActionExists,
ModuleInfoCache $moduleInfoCache,
Vendors $vendors
Vendor $vendors
)
{
$this->container = $container;
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Modules\Helper;
use ACP3\Core;
use ACP3\Core\Controller\FrontendController;
use ACP3\Core\Controller\FrontendAction;
/**
* Class Action
......@@ -84,17 +89,17 @@ class Action
}
/**
* @param \ACP3\Core\Controller\FrontendController $context
* @param string $action
* @param callable $callback
* @param string|null $moduleConfirmUrl
* @param string|null $moduleIndexUrl
* @param \ACP3\Core\Controller\FrontendAction $context
* @param string $action
* @param callable $callback
* @param string|null $moduleConfirmUrl
* @param string|null $moduleIndexUrl
*
* @return array|string|\Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\RedirectResponse|void
* @throws \ACP3\Core\Exceptions\ResultNotExists
*/
public function handleDeleteAction(
FrontendController $context,
FrontendAction $context,
$action,
callable $callback,
$moduleConfirmUrl = null,
......@@ -117,17 +122,17 @@ class Action
}
/**
* @param \ACP3\Core\Controller\FrontendController $context
* @param string $action
* @param callable $callback
* @param string|null $moduleConfirmUrl
* @param string|null $moduleIndexUrl
* @param \ACP3\Core\Controller\FrontendAction $context
* @param string $action
* @param callable $callback
* @param string|null $moduleConfirmUrl
* @param string|null $moduleIndexUrl
*
* @return void|string|array|\Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\RedirectResponse
* @throws \ACP3\Core\Exceptions\ResultNotExists
*/
public function handleCustomDeleteAction(
FrontendController $context,
FrontendAction $context,
$action,
callable $callback,
$moduleConfirmUrl = null,
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Modules;
use ACP3\Core\Cache;
......@@ -27,7 +32,7 @@ class ModuleInfoCache
*/
protected $translator;
/**
* @var \ACP3\Core\Modules\Vendors
* @var \ACP3\Core\Modules\Vendor
*/
protected $vendors;
/**
......@@ -43,7 +48,7 @@ class ModuleInfoCache
* @param \ACP3\Core\Cache $cache
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\I18n\Translator $translator
* @param \ACP3\Core\Modules\Vendors $vendors
* @param \ACP3\Core\Modules\Vendor $vendors
* @param \ACP3\Core\XML $xml
* @param \ACP3\Modules\ACP3\System\Model\ModuleRepository $systemModuleRepository
*/
......@@ -51,7 +56,7 @@ class ModuleInfoCache
Cache $cache,
ApplicationPath $appPath,
Translator $translator,
Vendors $vendors,
Vendor $vendors,
XML $xml,
ModuleRepository $systemModuleRepository
)
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Core\Modules;
use ACP3\Core\Environment\ApplicationPath;
use ACP3\Core\Filesystem;
/**
* Class Vendors
* Class Vendor
* @package ACP3\Core\Modules
*/
class Vendors
class Vendor
{
/**
* @var \ACP3\Core\Environment\ApplicationPath
......@@ -35,13 +40,21 @@ class Vendors
public function getVendors()
{
if ($this->vendors === []) {
$this->vendors = array_merge(
['ACP3'],
Filesystem::scandir($this->appPath->getModulesDir(), ['ACP3', 'Custom']),
['Custom']
);
$this->cacheVendors();
}
return $this->vendors;
}
/**
* Caches the various module vendors
*/
protected function cacheVendors()
{
$this->vendors = array_merge(
['ACP3'],
Filesystem::scandir($this->appPath->getModulesDir(), ['ACP3', 'Custom']),
['Custom']
);
}
}
\ No newline at end of file
......@@ -60,6 +60,6 @@ services:
parent: core.modules.schemaHelper
core.modules.vendors:
class: ACP3\Core\Modules\Vendors
class: ACP3\Core\Modules\Vendor
arguments:
- @core.environment.application_path
\ No newline at end of file
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Acp\Controller\Admin\Index;
use ACP3\Core;
......@@ -7,7 +12,7 @@ use ACP3\Core;
* Class Index
* @package ACP3\Modules\ACP3\Acp\Controller\Admin\Index
*/
class Index extends Core\Controller\AdminController
class Index extends Core\Controller\AdminAction
{
/**
* @return array
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Articles\Controller\Admin\Index;
use ACP3\Core;
use ACP3\Core\Controller\AdminController;
use ACP3\Core\Controller\AdminAction;
use ACP3\Modules\ACP3\Articles;
use ACP3\Modules\ACP3\Menus;
abstract class AbstractFormAction extends AdminController
/**
* Class AbstractFormAction
* @package ACP3\Modules\ACP3\Articles\Controller\Admin\Index
*/
abstract class AbstractFormAction extends AdminAction
{
/**
* @var \ACP3\Modules\ACP3\Menus\Cache
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Articles\Controller\Admin\Index;
......@@ -13,7 +14,7 @@ use ACP3\Modules\ACP3\Menus;
* Class Index
* @package ACP3\Modules\ACP3\Articles\Controller\Admin\Index
*/
class Index extends Core\Controller\AdminController
class Index extends Core\Controller\AdminAction
{
/**
* @var \ACP3\Modules\ACP3\Articles\Model\ArticleRepository
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Articles\Controller\Frontend\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Articles;
* Class Details
* @package ACP3\Modules\ACP3\Articles\Controller\Frontend\Index
*/
class Details extends Core\Controller\FrontendController
class Details extends Core\Controller\FrontendAction
{
/**
* @var \ACP3\Core\Date
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing
* details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Articles\Controller\Frontend\Index;
......@@ -13,7 +13,7 @@ use ACP3\Modules\ACP3\Articles;
* Class Index
* @package ACP3\Modules\ACP3\Articles\Controller\Frontend\Index
*/
class Index extends Core\Controller\FrontendController
class Index extends Core\Controller\FrontendAction
{
/**
* @var \ACP3\Core\Date
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Articles\Controller\Widget\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Articles;
* Class Index
* @package ACP3\Modules\ACP3\Articles\Controller\Widget\Index
*/
class Index extends Core\Controller\WidgetController
class Index extends Core\Controller\WidgetAction
{
/**
* @var Core\Date
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Articles\Controller\Widget\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Articles;
* Class Single
* @package ACP3\Modules\ACP3\Articles\Controller\Widget\Index
*/
class Single extends Core\Controller\WidgetController
class Single extends Core\Controller\WidgetAction
{
/**
* @var Core\Date
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Captcha\Controller\Index;
......@@ -11,7 +12,7 @@ use ACP3\Core;
* Class Image
* @package ACP3\Modules\ACP3\Captcha\Controller\Index
*/
class Image extends Core\Controller\FrontendController
class Image extends Core\Controller\FrontendAction
{
/**
* @var \ACP3\Core\SessionHandler
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Categories\Controller\Admin\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Categories;
* Class Create
* @package ACP3\Modules\ACP3\Categories\Controller\Admin\Index
*/
class Create extends Core\Controller\AdminController
class Create extends Core\Controller\AdminAction
{
/**
* @var \ACP3\Modules\ACP3\Categories\Model\CategoryRepository
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Categories\Controller\Admin\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Categories;
* Class Delete
* @package ACP3\Modules\ACP3\Categories\Controller\Admin\Index
*/
class Delete extends Core\Controller\AdminController
class Delete extends Core\Controller\AdminAction
{
/**
* @var \ACP3\Modules\ACP3\Categories\Model\CategoryRepository
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Categories\Controller\Admin\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Categories;
* Class Edit
* @package ACP3\Modules\ACP3\Categories\Controller\Admin\Index
*/
class Edit extends Core\Controller\AdminController
class Edit extends Core\Controller\AdminAction
{
/**
* @var \ACP3\Modules\ACP3\Categories\Model\CategoryRepository
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Categories\Controller\Admin\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Categories;
* Class Index
* @package ACP3\Modules\ACP3\Categories\Controller\Admin\Index
*/
class Index extends Core\Controller\AdminController
class Index extends Core\Controller\AdminAction
{
/**
* @var \ACP3\Modules\ACP3\Categories\Model\CategoryRepository
......
<?php
/**
* Copyright (c) 2016 by the ACP3 Developers. See the LICENCE file at the top-level module directory for licencing details.
* Copyright (c) 2016 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Categories\Controller\Admin\Index;
......@@ -12,7 +13,7 @@ use ACP3\Modules\ACP3\Categories;
* Class Settings
* @package ACP3\Modules\ACP3\Categories\Controller\Admin\Index
*/
class Settings extends Core\Controller\AdminController
class Settings extends Core\Controller\AdminAction
{
/**
* @var \ACP3\Modules\ACP3\Categories\Validation\AdminSettingsFormValidation
......