Commit b0988630 authored by Tino Goratsch's avatar Tino Goratsch

PSR-2 fixes

parent 47de2c1c
......@@ -67,8 +67,7 @@ class ACL
Permissions\Model\UserRoleRepository $userRoleRepository,
Permissions\Model\PrivilegeRepository $privilegeRepository,
Permissions\Cache $permissionsCache
)
{
) {
$this->user = $user;
$this->modules = $modules;
$this->roleRepository = $roleRepository;
......
......@@ -9,4 +9,4 @@ class PermissionEnum
{
const PERMIT_ACCESS = 1;
const INHERIT_ACCESS = 2;
}
\ No newline at end of file
}
......@@ -14,4 +14,4 @@ class PrivilegeEnum
const ADMIN_VIEW = 3;
const FRONTEND_CREATE = 2;
const FRONTEND_VIEW = 1;
}
\ No newline at end of file
}
......@@ -79,4 +79,4 @@ abstract class AbstractBootstrap implements BootstrapInterface
return true;
}
}
\ No newline at end of file
}
......@@ -15,25 +15,25 @@ interface BootstrapInterface
/**
* Executes the application bootstrapping process and outputs the requested page
*/
function run();
public function run();
/**
* Performs some startup checks
*/
function startUpChecks();
public function startUpChecks();
/**
* Initializes the dependency injection container
*/
function initializeClasses();
public function initializeClasses();
/**
* Handle the request and output the page
*/
function outputPage();
public function outputPage();
/**
* @return \Symfony\Component\DependencyInjection\ContainerInterface
*/
function getContainer();
}
\ No newline at end of file
public function getContainer();
}
......@@ -76,8 +76,7 @@ abstract class AbstractMinifier implements MinifierInterface
Modules $modules,
FileResolver $fileResolver,
$environment
)
{
) {
$this->assets = $assets;
$this->appPath = $appPath;
$this->systemCache = $systemCache;
......@@ -186,5 +185,4 @@ abstract class AbstractMinifier implements MinifierInterface
return 'assets/' . $filenameHash . '-' . $lastGenerated . '.' . $group;
}
}
\ No newline at end of file
}
......@@ -86,5 +86,4 @@ class CSS extends AbstractMinifier
$this->stylesheets[] = $this->fileResolver->getStaticAssetPath($this->systemAssetsModulePath, $this->systemAssetsDesignPath, static::ASSETS_PATH_CSS, 'style.css');
$this->stylesheets[] = $this->fileResolver->getStaticAssetPath('', '', static::ASSETS_PATH_CSS, $layout . '.css');
}
}
\ No newline at end of file
}
......@@ -61,5 +61,4 @@ class JavaScript extends AbstractMinifier
// Include general js file of the layout
$this->javascript[] = $this->fileResolver->getStaticAssetPath('', '', static::ASSETS_PATH_JS, $layout . '.js');
}
}
\ No newline at end of file
}
......@@ -14,5 +14,5 @@ interface MinifierInterface
*
* @return string
*/
function getURI($layout = 'layout');
}
\ No newline at end of file
public function getURI($layout = 'layout');
}
......@@ -30,8 +30,7 @@ class PageCssClasses
public function __construct(
Core\Breadcrumb $breadcrumb,
Core\Http\RequestInterface $request
)
{
) {
$this->breadcrumb = $breadcrumb;
$this->request = $request;
}
......@@ -78,4 +77,4 @@ class PageCssClasses
return $this->details;
}
}
\ No newline at end of file
}
......@@ -11,4 +11,4 @@ interface AuthenticationInterface
* @return array|int
*/
public function authenticate();
}
\ No newline at end of file
}
......@@ -71,4 +71,4 @@ class Native implements AuthenticationInterface
return -1;
}
}
\ No newline at end of file
}
......@@ -38,4 +38,4 @@ class AuthenticationFactory
throw new InvalidAuthenticationMethod();
}
}
\ No newline at end of file
}
......@@ -67,8 +67,7 @@ class Breadcrumb
RequestInterface $request,
RouterInterface $router,
Config $config
)
{
) {
$this->container = $container;
$this->translator = $translator;
$this->request = $request;
......
......@@ -37,8 +37,7 @@ class Cache
Container $container,
ApplicationPath $appPath,
$namespace
)
{
) {
$this->container = $container;
$this->appPath = $appPath;
$this->namespace = $namespace;
......
......@@ -35,8 +35,7 @@ class Config
Cache $coreCache,
System\Model\ModuleRepository $systemModuleRepository,
System\Model\SettingsRepository $systemSettingsRepository
)
{
) {
$this->coreCache = $coreCache;
$this->systemModuleRepository = $systemModuleRepository;
$this->systemSettingsRepository = $systemSettingsRepository;
......
......@@ -15,4 +15,4 @@ class AreaEnum
const AREA_ADMIN = 'admin';
const AREA_FRONTEND = 'frontend';
const AREA_INSTALL = 'install';
}
\ No newline at end of file
}
......@@ -25,8 +25,7 @@ class AdminContext extends FrontendContext
public function __construct(
Core\Controller\Context\FrontendContext $context,
Core\SessionHandler $session
)
{
) {
parent::__construct(
$context,
$context->getAssets(),
......
......@@ -50,8 +50,7 @@ class FrontendContext extends Core\Controller\Context\WidgetContext
Core\SEO $seo,
Core\Modules\Helper\Action $actionHelper,
Response $response
)
{
) {
parent::__construct(
$context->getContainer(),
$context->getEventDispatcher(),
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
......
......@@ -82,4 +82,4 @@ class SQLLogger implements \Doctrine\DBAL\Logging\SQLLogger
$this->logger->debug($this->logFilename, $this->queries);
}
}
}
\ No newline at end of file
}
......@@ -47,8 +47,7 @@ class Date
User $user,
DateTranslator $dateTranslator,
Config $config
)
{
) {
$this->dateTranslator = $dateTranslator;
$this->config = $config;
......
......@@ -135,4 +135,4 @@ class DateTranslator
{
return $this->cacheLocalizedDate($this->monthsFull, 'month_full');
}
}
\ No newline at end of file
}
......@@ -11,4 +11,4 @@ class ApplicationMode
const DEVELOPMENT = 'dev';
const INSTALLER = 'installer';
const UPDATER = 'updater';
}
\ No newline at end of file
}
......@@ -253,4 +253,4 @@ class ApplicationPath
$this->designPathAbsolute = $designPathAbsolute;
return $this;
}
}
\ No newline at end of file
}
......@@ -266,4 +266,4 @@ class ErrorHandler
return 'Unknown PHP error';
}
}
\ No newline at end of file
}
......@@ -7,5 +7,4 @@ namespace ACP3\Core\Exceptions;
*/
class InvalidAuthenticationMethod extends \Exception
{
}
\ No newline at end of file
}
......@@ -27,4 +27,4 @@ class Filesystem
return array_values($filesAndDirectories);
}
}
\ No newline at end of file
}
......@@ -31,8 +31,7 @@ class Alerts
Core\Http\RequestInterface $request,
Core\View $view,
Core\Helpers\Output $outputHelper
)
{
) {
$this->request = $request;
$this->view = $view;
$this->outputHelper = $outputHelper;
......
......@@ -261,4 +261,4 @@ class Country
'ZW' => 'Zimbabwe'
];
}
}
\ No newline at end of file
}
......@@ -71,8 +71,7 @@ class DataGrid
public function __construct(
ACL $acl,
Translator $translator
)
{
) {
$this->acl = $acl;
$this->translator = $translator;
$this->columns = new ColumnPriorityQueue();
......@@ -349,4 +348,4 @@ class DataGrid
}
}
}
}
\ No newline at end of file
}
......@@ -21,4 +21,4 @@ class ColumnPriorityQueue extends \SplPriorityQueue
{
parent::insert($value, [$priority, $this->serial--]);
}
}
\ No newline at end of file
}
......@@ -152,4 +152,4 @@ abstract class AbstractColumnRenderer implements ColumnRendererInterface
{
return $column['fields'];
}
}
\ No newline at end of file
}
......@@ -14,4 +14,4 @@ interface ColumnRendererInterface
* @return string
*/
public function fetchDataAndRenderColumn(array $column, array $dbResultRow);
}
\ No newline at end of file
}
......@@ -26,8 +26,7 @@ class DateColumnRenderer extends AbstractColumnRenderer
public function __construct(
Date $date,
DateRange $dateRangeHelper
)
{
) {
$this->date = $date;
$this->dateRangeHelper = $dateRangeHelper;
}
......@@ -68,4 +67,4 @@ class DateColumnRenderer extends AbstractColumnRenderer
return $value;
}
}
\ No newline at end of file
}
......@@ -60,4 +60,4 @@ class CustomOptionEvent extends Event
{
return $this->identifier;
}
}
\ No newline at end of file
}
<?php
namespace ACP3\Core\Helpers\DataGrid\ColumnRenderer;
use ACP3\Core\Helpers\Formatter\MarkEntries;
/**
......@@ -39,4 +40,4 @@ class HeaderColumnRenderer extends AbstractColumnRenderer
return $this->render($column, $value);
}
}
\ No newline at end of file
}
......@@ -17,4 +17,4 @@ class IntegerColumnRenderer extends AbstractColumnRenderer
{
return isset($dbResultRow[$field]) ? (int)$dbResultRow[$field] : null;
}
}
\ No newline at end of file
}
......@@ -23,4 +23,4 @@ class MassActionColumnRenderer extends AbstractColumnRenderer
return $value;
}
}
\ No newline at end of file
}
<?php
namespace ACP3\Core\Helpers\DataGrid\ColumnRenderer;
use ACP3\Core\Helpers\StringFormatter;
/**
......@@ -30,4 +31,4 @@ class Nl2pColumnRenderer extends AbstractColumnRenderer
{
return isset($dbResultRow[$field]) ? $this->stringFormatter->nl2p($dbResultRow[$field]) : null;
}
}
\ No newline at end of file
}
......@@ -35,8 +35,7 @@ class OptionColumnRenderer extends AbstractColumnRenderer
Translator $translator,
OptionRenderer $optionRenderer,
EventDispatcher $eventDispatcher
)
{
) {
$this->translator = $translator;
$this->optionRenderer = $optionRenderer;
$this->eventDispatcher = $eventDispatcher;
......@@ -102,4 +101,4 @@ class OptionColumnRenderer extends AbstractColumnRenderer
return $value;
}
}
\ No newline at end of file
}
......@@ -34,4 +34,4 @@ class ReplaceValueColumnRenderer extends AbstractColumnRenderer
{
return isset($dbResultRow[$field]) ? str_replace($this->search, $this->replace, $dbResultRow[$field]) : null;
}
}
\ No newline at end of file
}
......@@ -7,4 +7,4 @@ namespace ACP3\Core\Helpers\DataGrid\ColumnRenderer;
*/
class TextColumnRenderer extends AbstractColumnRenderer
{
}
\ No newline at end of file
}
......@@ -37,4 +37,4 @@ class TranslateColumnRenderer extends AbstractColumnRenderer
return null;
}
}
\ No newline at end of file
}
......@@ -27,4 +27,4 @@ class RegisterColumnRendererPass implements CompilerPassInterface
$definition->addMethodCall('registerColumnRenderer', [new Reference($serviceId)]);
}
}
}
\ No newline at end of file
}
......@@ -47,8 +47,7 @@ class Date
Request $request,
Forms $formsHelper,
DateValidationRule $dateValidationRule
)
{
) {
$this->date = $date;
$this->translator = $translator;
$this->request = $request;
......@@ -253,4 +252,4 @@ class Date
{
return $showTime === true ? \ACP3\Core\Date::DEFAULT_DATE_FORMAT_LONG : \ACP3\Core\Date::DEFAULT_DATE_FORMAT_SHORT;
}
}
\ No newline at end of file
}
......@@ -27,8 +27,7 @@ class FormToken
public function __construct(
Core\Http\RequestInterface $request,
Core\SessionHandler $sessionHandler
)
{
) {
$this->request = $request;
$this->sessionHandler = $sessionHandler;
}
......@@ -78,4 +77,4 @@ class FormToken
}
}
}
}
\ No newline at end of file
}
<?php
namespace ACP3\Core\Helpers\Formatter;
use ACP3\Core\Date;
use ACP3\Core\I18n\Translator;
......@@ -27,8 +26,7 @@ class DateRange
public function __construct(
Date $date,
Translator $translator
)
{
) {
$this->date = $date;
$this->translator = $translator;
}
......@@ -77,5 +75,4 @@ class DateRange
$title = !empty($title) ? ' title="' . $title . '"' : '';
return '<time datetime="' . $rfcDate . '"' . $title . '>' . $this->date->format($date, $format) . '</time>';
}
}
\ No newline at end of file
}
......@@ -46,4 +46,4 @@ class MarkEntries
return 'data-mark-all-id="' . $markAllId . '" data-checkbox-name="' . $name . '" data-delete-options=\'' . $deleteOptions . '\'';
}
}
\ No newline at end of file
}
......@@ -46,8 +46,7 @@ class RewriteInternalUri
Core\Http\Request $request,
Core\RouterInterface $router,
UriAliasValidationRule $uriAliasValidationRule
)
{
) {
$this->appPath = $appPath;
$this->controllerActionExists = $controllerActionExists;
$this->request = $request;
......
......@@ -27,8 +27,7 @@ class Forms
public function __construct(
Translator $translator,
RequestInterface $request
)
{
) {
$this->translator = $translator;
$this->request = $request;
}
......
......@@ -39,8 +39,7 @@ class PageBreaks
Core\Http\RequestInterface $request,
Core\RouterInterface $router,
TableOfContents $tableOfContents
)
{
) {
$this->tableOfContents = $tableOfContents;
$this->seo = $seo;
$this->request = $request;
......@@ -99,5 +98,4 @@ class PageBreaks
{
return '/<hr(.+)class="page-break"(.*)(\/>|>)/iU';
}
}
......@@ -37,8 +37,7 @@ class RedirectMessages
Core\Http\RequestInterface $request,
Core\SessionHandler $sessionHandler,
Core\View $view
)
{
) {
$this->redirect = $redirect;
$this->request = $request;
$this->sessionHandler = $sessionHandler;
......
......@@ -57,8 +57,7 @@ class TableOfContents
Core\RouterInterface $router,
Core\Validation\ValidationRules\IntegerValidationRule $integerValidationRule,
Core\View $view
)
{
) {
$this->breadcrumb = $breadcrumb;
$this->translator = $translator;
$this->seo = $seo;
......
......@@ -39,8 +39,7 @@ class CheckAccess
Core\I18n\Translator $translator,
Core\RouterInterface $router,
Core\View $view
)
{
) {
$this->translator = $translator;
$this->acl = $acl;
$this->router = $router;
......
......@@ -22,4 +22,4 @@ class CookiesParameterBag extends ParameterBag
parent::set($key, $value);
}
}
\ No newline at end of file
}
......@@ -24,4 +24,4 @@ class FilesParameterBag extends ParameterBag
{
return array_key_exists($key, $this->all()) && !empty($this->all()[$key]['name']);
}
}
\ No newline at end of file
}
......@@ -7,7 +7,7 @@ namespace ACP3\Core\Http\Request;
*/
class ParameterBag extends \Symfony\Component\HttpFoundation\ParameterBag
{
/**
/**
* @return int
*/
public function count()
......@@ -22,4 +22,4 @@ class ParameterBag extends \Symfony\Component\HttpFoundation\ParameterBag
{
return $this->count() === 0;
}
}
\ No newline at end of file
}
......@@ -69,4 +69,4 @@ class UserAgent
return $locales;
}
}
\ No newline at end of file
}
......@@ -40,8 +40,7 @@ class DictionaryCache
Cache $cache,
ApplicationPath $appPath,
Vendor $vendors
)
{
) {
$this->cache = $cache;
$this->appPath = $appPath;
$this->vendors = $vendors;
......@@ -181,5 +180,4 @@ class DictionaryCache
{
return substr($file, strrpos($file, '/') + 1, -4);
}
}
\ No newline at end of file
}
......@@ -58,8 +58,7 @@ class Translator
ApplicationPath $appPath,
LanguageCache $dictionaryCache,
Config $config
)
{
) {
$this->user = $user;
$this->appPath = $appPath;
$this->dictionaryCache = $dictionaryCache;
......
......@@ -83,8 +83,7 @@ class Mailer
View $view,
Config $config,
StringFormatter $stringFormatter
)
{
) {
$this->logger = $logger;
$this->view = $view;
$this->config = $config;
......@@ -243,7 +242,6 @@ class Mailer
if (!empty($this->recipients)) {
return $this->bcc === true ? $this->sendBcc() : $this->sendTo();
}
} catch (\phpmailerException $e) {
$this->logger->error('mailer', $e->getMessage());
} catch (\Exception $e) {
......
......@@ -13,4 +13,4 @@ interface FloodBarrierAwareRepositoryInterface
* @return mixed
*/
public function getLastDateFromIp($ipAddress);
}
\ No newline at end of file
}
......@@ -23,4 +23,4 @@ trait PublicationPeriodAwareTrait
$tableAlias
);
}
}
\ No newline at end of file
}
......@@ -61,8 +61,7 @@ class Modules
ControllerActionExists $controllerActionExists,
ModuleInfoCache $moduleInfoCache,
Vendor $vendors
)
{
) {
$this->container = $container;
$this->appPath = $appPath;
$this->controllerActionExists = $controllerActionExists;
......@@ -193,4 +192,4 @@ class Modules
return $this->allModules;
}
}
\ No newline at end of file
}
......@@ -29,4 +29,4 @@ class AbstractCacheStorage
{
return $this->cache->getDriver();
}
}
\ No newline at end of file
}
......@@ -255,4 +255,4 @@ class AclInstaller implements InstallerInterface
{