Commit 04b1f417 authored by Tino Goratsch's avatar Tino Goratsch

run phpcs

parent a5b68b6e
Pipeline #15511460 failed with stages
in 2 minutes and 43 seconds
......@@ -66,7 +66,10 @@ class Bootstrap extends AbstractBootstrap
if (!$containerConfigCache->isFresh()) {
$containerBuilder = ServiceContainerBuilder::create(
$this->logger, $this->appPath, $symfonyRequest, $this->appMode
$this->logger,
$this->appPath,
$symfonyRequest,
$this->appMode
);
$dumper = new PhpDumper($containerBuilder);
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Application\BootstrapCache\Event\Listener;
use ACP3\Core\View\Renderer\Smarty\Filters\MoveToBottom;
use FOS\HttpCache\SymfonyCache\CacheEvent;
use FOS\HttpCache\SymfonyCache\Events;
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Authentication;
use ACP3\Core\Authentication\Exception\InvalidAuthenticationMethodException;
class AuthenticationRegistrar
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Authentication\DependencyInjection;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
......
......@@ -76,10 +76,12 @@ class ServiceContainerBuilder extends ContainerBuilder
$this->setParameter('core.environment', $this->applicationMode);
$this
->addCompilerPass(new RegisterListenersPass(
->addCompilerPass(
new RegisterListenersPass(
'core.event_dispatcher',
'core.eventListener',
'core.eventSubscriber')
'core.eventSubscriber'
)
)
->addCompilerPass(new RegisterAuthenticationsCompilerPass())
->addCompilerPass(new RegisterSmartyPluginsPass())
......
......@@ -46,7 +46,8 @@ class DateColumnRenderer extends AbstractColumnRenderer
}
return $this->render(
$column, $value
$column,
$value
);
}
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Helpers\DataGrid\ColumnRenderer;
use ACP3\Core\I18n\Translator;
use ACP3\Core\Router\RouterInterface;
......@@ -46,7 +45,8 @@ class RouteColumnRenderer extends AbstractColumnRenderer
HTML;
$value = sprintf(
$pattern,
$route, $this->translator->t('system', 'open_in_new_window'),
$route,
$this->translator->t('system', 'open_in_new_window'),
$value
);
}
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\I18n;
trait ExtractFromPathTrait
{
/**
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Installer\DependencyInjection;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Installer;
use ACP3\Core\Modules\Installer\MigrationInterface;
class MigrationRegistrar
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Installer;
use ACP3\Core\Modules\Installer\SampleDataInterface;
class SampleDataRegistrar
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Installer;
use ACP3\Core\Modules\Installer\SchemaInterface;
class SchemaRegistrar
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Logger;
use ACP3\Core\Environment\ApplicationPath;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Mailer;
class MailerMessage
{
/**
......
......@@ -165,7 +165,9 @@ abstract class AbstractModel
$this->dispatchEvent('core.model.before_delete', $entryId, false);
$this->dispatchEvent(
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.before_delete', $entryId, false
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.before_delete',
$entryId,
false
);
$affectedRows = 0;
......@@ -175,7 +177,9 @@ abstract class AbstractModel
$this->dispatchEvent('core.model.before_delete', $entryId, false);
$this->dispatchEvent(
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.after_delete', $entryId, false
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.after_delete',
$entryId,
false
);
return $affectedRows;
......
......@@ -98,7 +98,9 @@ abstract class AbstractNestedSetModel extends AbstractModel
$this->dispatchEvent('core.model.before_delete', $entryId, false);
$this->dispatchEvent(
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.before_delete', $entryId, false
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.before_delete',
$entryId,
false
);
$affectedRows = 0;
......@@ -108,7 +110,9 @@ abstract class AbstractNestedSetModel extends AbstractModel
$this->dispatchEvent('core.model.before_delete', $entryId, false);
$this->dispatchEvent(
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.after_delete', $entryId, false
static::EVENT_PREFIX . '.model.' . $repository::TABLE_NAME . '.after_delete',
$entryId,
false
);
return $affectedRows;
......
......@@ -8,7 +8,8 @@ namespace ACP3\Core\Model;
use ACP3\Core\Model\Repository\AbstractRepository;
trait DuplicationAwareTrait {
trait DuplicationAwareTrait
{
/**
* @param int $entryId
* @return bool|int
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\Model\Event\Listener;
use ACP3\Core\ACL;
use ACP3\Core\Helpers\DataGrid\ColumnRenderer\Event\CustomOptionEvent;
use ACP3\Core\I18n\Translator;
......
......@@ -67,8 +67,8 @@ class SchemaUpdater extends SchemaHelper
$moduleName,
$schemaVersion,
array $schemaUpdates,
$installedSchemaVersion)
{
$installedSchemaVersion
) {
$result = -1;
foreach ($schemaUpdates as $schemaUpdateVersion => $queries) {
// Do schema updates only, if the current schema version is older then the new one
......
......@@ -95,8 +95,10 @@ abstract class NestedSetRepository extends AbstractRepository
*/
public function fetchNodeById($nodeId)
{
return $this->db->fetchAssoc("SELECT `root_id`, `left_id`, `right_id` FROM {$this->getTableName()} WHERE id = ?",
[$nodeId]);
return $this->db->fetchAssoc(
"SELECT `root_id`, `left_id`, `right_id` FROM {$this->getTableName()} WHERE id = ?",
[$nodeId]
);
}
/**
......
......@@ -25,8 +25,10 @@ class Delete extends AbstractOperation
$callback = function () use ($resultId) {
$nodes = $this->nestedSetRepository->fetchNodeWithSiblings((int)$resultId);
if (!empty($nodes)) {
$this->db->getConnection()->delete($this->nestedSetRepository->getTableName(),
['id' => (int)$resultId]);
$this->db->getConnection()->delete(
$this->nestedSetRepository->getTableName(),
['id' => (int)$resultId]
);
$this->moveSiblingsOneLevelUp($nodes);
$this->adjustParentNodesAfterSeparation(2, $nodes[0]['left_id'], $nodes[0]['right_id']);
......
......@@ -36,7 +36,8 @@ class Edit extends AbstractOperation
);
} else {
$currentParent = $this->nestedSetRepository->fetchParentNode(
$nodes[0]['left_id'], $nodes[0]['right_id']
$nodes[0]['left_id'],
$nodes[0]['right_id']
);
// Überprüfung, falls Seite kein Root-Element ist und auch keine Veränderung vorgenommen werden soll...
......@@ -182,7 +183,8 @@ class Edit extends AbstractOperation
$node['right_id'] += $diff;
$parentId = $this->nestedSetRepository->fetchParentNode(
$node['left_id'], $node['right_id']
$node['left_id'],
$node['right_id']
);
if ($this->isBlockAware === true) {
$bool = $this->db->getConnection()->executeUpdate(
......
......@@ -25,13 +25,15 @@ class Sort extends AbstractOperation
if ($mode === 'up' &&
$this->nestedSetRepository->nextNodeExists(
$nodes[0]['left_id'] - 1, $this->getBlockId($nodes[0])
$nodes[0]['left_id'] - 1,
$this->getBlockId($nodes[0])
) === true
) {
return $this->sortUp($nodes);
} elseif ($mode === 'down' &&
$this->nestedSetRepository->previousNodeExists(
$nodes[0]['right_id'] + 1, $this->getBlockId($nodes[0])
$nodes[0]['right_id'] + 1,
$this->getBlockId($nodes[0])
) === true
) {
return $this->sortDown($nodes);
......
......@@ -265,7 +265,7 @@ class Picture
*/
private function getMimeType($pictureType)
{
switch($pictureType) {
switch ($pictureType) {
case IMAGETYPE_GIF:
return 'image/gif';
case IMAGETYPE_JPEG:
......
......@@ -102,8 +102,11 @@ class DateRangeTest extends \PHPUnit_Framework_TestCase
public function testInvalidDateRangeWithLongFormat()
{
$this->setUpLangMockExpectation('date_published_since', 'Published since 2012-12-20 13:12',
['%date%' => '2012-12-20 13:12']);
$this->setUpLangMockExpectation(
'date_published_since',
'Published since 2012-12-20 13:12',
['%date%' => '2012-12-20 13:12']
);
$dateStart = '2012-12-20 12:12:12';
$dateEnd = '2012-12-19 12:12:12';
$expected = '<time datetime="2012-12-20T13:12:12+01:00" title="Published since 2012-12-20 13:12">2012-12-20 13:12</time>';
......@@ -113,8 +116,11 @@ class DateRangeTest extends \PHPUnit_Framework_TestCase
public function testInvalidDateRangeWithShortFormat()
{
$this->setUpLangMockExpectation('date_published_since', 'Published since 2012-12-20',
['%date%' => '2012-12-20']);
$this->setUpLangMockExpectation(
'date_published_since',
'Published since 2012-12-20',
['%date%' => '2012-12-20']
);
$dateStart = '2012-12-20 12:12:12';
$dateEnd = '2012-12-19 12:12:12';
$expected = '<time datetime="2012-12-20T13:12:12+01:00" title="Published since 2012-12-20">2012-12-20</time>';
......
......@@ -145,7 +145,8 @@ abstract class AbstractFormValidationTest extends \PHPUnit_Framework_TestCase
{
$requestMock->expects($this->any())
->method('getPost')
->willReturn(new \Symfony\Component\HttpFoundation\ParameterBag(
->willReturn(
new \Symfony\Component\HttpFoundation\ParameterBag(
[SessionHandlerInterface::XSRF_TOKEN_NAME => self::XSRF_FORM_TOKEN]
)
);
......
......@@ -27,8 +27,8 @@ abstract class AbstractFloodBarrierValidationRule extends AbstractValidationRule
*/
public function __construct(
Date $date,
FloodBarrierAwareRepositoryInterface $repository)
{
FloodBarrierAwareRepositoryInterface $repository
) {
$this->date = $date;
$this->repository = $repository;
}
......
......@@ -35,8 +35,8 @@ class Smarty implements RendererInterface
public function __construct(
\Smarty $smarty,
ApplicationPath $appPath,
$environment)
{
$environment
) {
$this->smarty = $smarty;
$this->appPath = $appPath;
$this->environment = $environment;
......
......@@ -28,8 +28,8 @@ class PageCssClasses extends AbstractFilter
*/
public function __construct(
Core\Assets\PageCssClasses $pageCssClasses,
Core\Http\RequestInterface $request)
{
Core\Http\RequestInterface $request
) {
$this->pageCssClasses = $pageCssClasses;
$this->request = $request;
}
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\View\Renderer\Smarty\Functions;
use ACP3\Core\Application\BootstrapInterface;
use ACP3\Core\Assets\FileResolver;
use ACP3\Core\Environment\ApplicationPath;
......
......@@ -34,8 +34,8 @@ class LoadModule extends AbstractFunction
public function __construct(
ACL $acl,
RouterInterface $router,
$applicationMode)
{
$applicationMode
) {
$this->acl = $acl;
$this->router = $router;
$this->applicationMode = $applicationMode;
......
......@@ -6,7 +6,6 @@
namespace ACP3\Core\WYSIWYG;
use ACP3\Core\WYSIWYG\Editor\AbstractWYSIWYG;
class WysiwygEditorRegistrar
......
......@@ -6,7 +6,6 @@
namespace ACP3\Modules\ACP3\Articles\Controller\Admin\Index;
use ACP3\Core\Controller\AbstractFrontendAction;
use ACP3\Core\Controller\Context\FrontendContext;
use ACP3\Modules\ACP3\Articles\Model\ArticlesModel;
......
......@@ -49,8 +49,8 @@ class Details extends Core\Controller\AbstractFrontendAction
Core\Date $date,
Core\Helpers\PageBreaks $pageBreaksHelper,
Articles\Model\Repository\ArticleRepository $articleRepository,
Articles\Cache $articlesCache)
{
Articles\Cache $articlesCache
) {
parent::__construct($context);
$this->date = $date;
......
......@@ -41,8 +41,8 @@ class Index extends Core\Controller\AbstractWidgetAction
Core\Controller\Context\WidgetContext $context,
Core\Date $date,
Articles\Model\Repository\ArticleRepository $articleRepository,
Articles\Cache $articlesCache)
{
Articles\Cache $articlesCache
) {
parent::__construct($context);
$this->date = $date;
......
......@@ -41,8 +41,8 @@ class Single extends Core\Controller\AbstractWidgetAction
Core\Controller\Context\WidgetContext $context,
Core\Date $date,
Articles\Model\Repository\ArticleRepository $articleRepository,
Articles\Cache $articlesCache)
{
Articles\Cache $articlesCache
) {
parent::__construct($context);
$this->date = $date;
......
......@@ -27,8 +27,10 @@ class ArticleRepository extends Core\Model\Repository\AbstractRepository
public function resultExists($articleId, $time = '')
{
$period = empty($time) === false ? ' AND ' . $this->getPublicationPeriod() . ' AND `active` = :active' : '';
return $this->db->fetchColumn("SELECT COUNT(*) FROM {$this->getTableName()} WHERE id = :id{$period}",
['id' => $articleId, 'time' => $time, 'active' => 1]) > 0;
return $this->db->fetchColumn(
"SELECT COUNT(*) FROM {$this->getTableName()} WHERE id = :id{$period}",
['id' => $articleId, 'time' => $time, 'active' => 1]
) > 0;
}
/**
......
......@@ -47,14 +47,16 @@ class AdminFormValidation extends Core\Validation\AbstractFormValidation
'extra' => [
'haystack' => [0, 1]
]
])
]
)
->addConstraint(
Core\Validation\ValidationRules\DateValidationRule::class,
[
'data' => $formData,
'field' => ['start', 'end'],
'message' => $this->translator->t('system', 'select_date')
])
]
)
->addConstraint(
Core\Validation\ValidationRules\MinLengthValidationRule::class,
[
......@@ -64,7 +66,8 @@ class AdminFormValidation extends Core\Validation\AbstractFormValidation
'extra' => [
'length' => 3
]
])
]
)
->addConstraint(
Core\Validation\ValidationRules\MinLengthValidationRule::class,
[
......@@ -74,7 +77,8 @@ class AdminFormValidation extends Core\Validation\AbstractFormValidation
'extra' => [
'length' => 3
]
]);
]
);
$this->validator->dispatchValidationEvent(
'menus.validation.validate_manage_menu_item',
......
......@@ -42,8 +42,8 @@ class RenderRecaptchaOnLayoutContentBeforeListener
Translator $translator,
SettingsInterface $settings,
View $view,
UserModel $userModel)
{
UserModel $userModel
) {
$this->settings = $settings;
$this->view = $view;
$this->userModel = $userModel;
......
......@@ -51,8 +51,8 @@ class ReCaptchaCaptchaExtension implements CaptchaExtensionInterface
RequestInterface $request,
SettingsInterface $settings,
View $view,
UserModel $user)
{
UserModel $user
) {
$this->translator = $translator;
$this->view = $view;
$this->user = $user;
......
......@@ -44,8 +44,8 @@ class Create extends Core\Controller\AbstractFrontendAction
Core\Helpers\Forms $formsHelper,
Categories\Model\CategoriesModel $categoriesModel,
Categories\Validation\AdminFormValidation $adminFormValidation,
Core\Helpers\FormToken $formTokenHelper)
{
Core\Helpers\FormToken $formTokenHelper
) {
parent::__construct($context);
$this->formsHelper = $formsHelper;
......
......@@ -38,8 +38,8 @@ class Edit extends Core\Controller\AbstractFrontendAction
Core\Controller\Context\FrontendContext $context,
Categories\Model\CategoriesModel $categoriesModel,
Categories\Validation\AdminFormValidation $adminFormValidation,
Core\Helpers\FormToken $formTokenHelper)
{
Core\Helpers\FormToken $formTokenHelper
) {
parent::__construct($context);
$this->adminFormValidation = $adminFormValidation;
......
......@@ -34,8 +34,8 @@ class Settings extends Core\Controller\AbstractFrontendAction
public function __construct(
Core\Controller\Context\FrontendContext $context,
Categories\Validation\AdminSettingsFormValidation $adminSettingsFormValidation,
Core\Helpers\FormToken $formTokenHelper)
{
Core\Helpers\FormToken $formTokenHelper
) {
parent::__construct($context);
$this->adminSettingsFormValidation = $adminSettingsFormValidation;
......
......@@ -91,7 +91,8 @@ class AdminFormValidation extends Core\Validation\AbstractFormValidation
'data' => $formData,
'field' => 'title',
'message' => $this->translator->t('categories', 'title_to_short')
])
]
)
->addConstraint(
Core\Validation\ValidationRules\PictureValidationRule::class,
[
......@@ -104,7 +105,8 @@ class AdminFormValidation extends Core\Validation\AbstractFormValidation
'filesize' => $this->settings['filesize'],
'required' => false
]
])
]
)
->addConstraint(
DuplicateCategoryValidationRule::class,
[
......@@ -115,7 +117,8 @@ class AdminFormValidation extends Core\Validation\AbstractFormValidation
'module_id' => empty($this->categoryId) ? $formData['module'] : $this->categoryRepository->getModuleIdByCategoryId($this->categoryId),
'category_id' => $this->categoryId
]
]);
]
);
if (empty($this->categoryId)) {
$this->validator->addConstraint(
......@@ -124,7 +127,8 @@ class AdminFormValidation extends Core\Validation\AbstractFormValidation
'data' => $formData,
'field' => 'module',
'message' => $this->translator->t('categories', 'select_module')
]);
]
);
}
$this->validator->validate();
......
......@@ -29,21 +29,24 @@ class AdminSettingsFormValidation extends AbstractFormValidation
'data' => $formData,
'field' => 'width',
'message' => $this->translator->t('categories', 'invalid_image_width_entered')
])
]
)
->addConstraint(
Core\Validation\ValidationRules\IntegerValidationRule::class,
[
'data' => $formData,
'field' => 'height',
'message' => $this->translator->t('categories', 'invalid_image_height_entered')
])
]
)
->addConstraint(
Core\Validation\ValidationRules\IntegerValidationRule::class,
[
'data' => $formData,
'field' => 'filesize',
'message' => $this->translator->t('categories', 'invalid_image_filesize_entered')
]);
]
);
$this->validator->validate();
}
......
......@@ -42,8 +42,8 @@ class Edit extends Core\Controller\AbstractFrontendAction
Core\Controller\Context\FrontendContext $context,
Comments\Model\CommentsModel $commentsModel,
Comments\Validation\AdminFormValidation $adminFormValidation,
Core\Helpers\FormToken $formTokenHelper)
{
Core\Helpers\FormToken $formTokenHelper
) {