Skip to content

Commit 5bf0325

Browse files
authored
Merge pull request #274 from symfony-cmf/styleci
update styleci configuration
2 parents 4358d36 + c948ecc commit 5bf0325

File tree

16 files changed

+96
-146
lines changed

16 files changed

+96
-146
lines changed

.styleci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515

1616

1717
preset: symfony
18+
risky: true
1819

1920
enabled:
2021
- combine_consecutive_unsets
21-
- short_array_syntax
22-
- newline_after_open_tag
23-
- no_php4_constructor
2422
- no_useless_else
2523
- ordered_use
2624
- strict

src/DependencyInjection/CmfCoreExtension.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,6 @@ public function load(array $configs, ContainerBuilder $container)
282282

283283
/**
284284
* Setup the cmf_core_checkbox_url_label form type if the routing bundle is there.
285-
*
286-
* @param ContainerBuilder $container
287-
* @param LoaderInterface $loader
288285
*/
289286
public function setupFormTypes(ContainerBuilder $container, LoaderInterface $loader)
290287
{
@@ -304,8 +301,6 @@ public function setupFormTypes(ContainerBuilder $container, LoaderInterface $loa
304301
* Load and configure the publish workflow services.
305302
*
306303
* @param $config
307-
* @param XmlFileLoader $loader
308-
* @param ContainerBuilder $container
309304
*
310305
* @throws InvalidConfigurationException
311306
*/
@@ -314,17 +309,15 @@ private function loadPublishWorkflow($config, XmlFileLoader $loader, ContainerBu
314309
$bundles = $container->getParameter('kernel.bundles');
315310

316311
if (false === $config['enabled']
317-
|| ('auto' === $config['enabled'] && !array_key_exists('SecurityBundle', $bundles))
312+
|| ('auto' === $config['enabled'] && !\array_key_exists('SecurityBundle', $bundles))
318313
) {
319314
$loader->load('no-publish-workflow.xml');
320315

321316
return;
322317
}
323318

324-
if (!array_key_exists('SecurityBundle', $bundles)) {
325-
throw new InvalidConfigurationException(
326-
'The "publish_workflow" may not be enabled unless "symfony/security-bundle" is available.'
327-
);
319+
if (!\array_key_exists('SecurityBundle', $bundles)) {
320+
throw new InvalidConfigurationException('The "publish_workflow" may not be enabled unless "symfony/security-bundle" is available.');
328321
}
329322

330323
$container->setParameter($this->getAlias().'.publish_workflow.view_non_published_role', $config['view_non_published_role']);
@@ -341,9 +334,7 @@ private function loadPublishWorkflow($config, XmlFileLoader $loader, ContainerBu
341334
return;
342335
}
343336
if (!class_exists(DynamicRouter::class)) {
344-
throw new InvalidConfigurationException(
345-
'The "publish_workflow.request_listener" may not be enabled unless "symfony-cmf/routing-bundle" is available.'
346-
);
337+
throw new InvalidConfigurationException('The "publish_workflow.request_listener" may not be enabled unless "symfony-cmf/routing-bundle" is available.');
347338
}
348339
}
349340

src/Doctrine/Phpcr/NonTranslatableMetadataListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Cmf\Bundle\CoreBundle\Doctrine\Phpcr;
1313

1414
use Doctrine\Common\EventSubscriber;
15-
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1615
use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
16+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1717

1818
/**
1919
* Metadata listener for when translations are disabled in PHPCR-ODM to remove
@@ -36,8 +36,6 @@ public function getSubscribedEvents()
3636
/**
3737
* Handle the load class metadata event: remove translated attribute from
3838
* fields and remove the locale mapping if present.
39-
*
40-
* @param LoadClassMetadataEventArgs $eventArgs
4139
*/
4240
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
4341
{

src/Doctrine/Phpcr/TranslatableMetadataListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Cmf\Bundle\CoreBundle\Doctrine\Phpcr;
1313

1414
use Doctrine\Common\EventSubscriber;
15-
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1615
use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
16+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1717
use Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface;
1818

1919
/**
@@ -48,8 +48,6 @@ public function getSubscribedEvents()
4848

4949
/**
5050
* Handle the load class metadata event: set the translation strategy.
51-
*
52-
* @param LoadClassMetadataEventArgs $eventArgs
5351
*/
5452
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
5553
{

src/EventListener/PublishWorkflowListener.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class PublishWorkflowListener implements EventSubscriberInterface
3939
private $publishWorkflowPermission;
4040

4141
/**
42-
* @param PublishWorkflowChecker $publishWorkflowChecker
43-
* @param string $attribute the attribute name to check
42+
* @param string $attribute the attribute name to check
4443
*/
4544
public function __construct(PublishWorkflowChecker $publishWorkflowChecker, $attribute = PublishWorkflowChecker::VIEW_ATTRIBUTE)
4645
{
@@ -66,8 +65,6 @@ public function setPublishWorkflowPermission($attribute)
6665

6766
/**
6867
* Handling the request event.
69-
*
70-
* @param GetResponseEvent $event
7168
*/
7269
public function onKernelRequest(GetResponseEvent $event)
7370
{

src/Form/Type/CheckboxUrlLabelFormType.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ class CheckboxUrlLabelFormType extends AbstractType
4040
*/
4141
protected $router;
4242

43-
/**
44-
* @param RouterInterface $router
45-
*/
4643
public function __construct(RouterInterface $router)
4744
{
4845
$this->router = $router;

src/PublishWorkflow/PublishTimePeriodInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ interface PublishTimePeriodInterface extends PublishTimePeriodReadInterface
2222
*
2323
* Setting a NULL value asserts that the content
2424
* has always been publishable.
25-
*
26-
* @param \DateTime|null $publishDate
2725
*/
2826
public function setPublishStartDate(\DateTime $publishDate = null);
2927

@@ -33,8 +31,6 @@ public function setPublishStartDate(\DateTime $publishDate = null);
3331
*
3432
* Setting a NULL value asserts that the
3533
* content will always be publishable.
36-
*
37-
* @param \DateTime|null $publishDate
3834
*/
3935
public function setPublishEndDate(\DateTime $publishDate = null);
4036
}

src/PublishWorkflow/PublishWorkflowChecker.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ class PublishWorkflowChecker implements AuthorizationCheckerInterface
7878
private $token;
7979

8080
/**
81-
* @param TokenStorageInterface $tokenStorage
82-
* @param AuthorizationCheckerInterface $authorizationChecker
8381
* @param AccessDecisionManagerInterface $accessDecisionManager Service to do the actual decision
8482
* @param bool|string $bypassingRole A role that is allowed to bypass
8583
* the published check if we ask for
@@ -111,11 +109,11 @@ public function supportsClass($class)
111109
*/
112110
public function isGranted($attributes, $object = null)
113111
{
114-
if (!is_array($attributes)) {
112+
if (!\is_array($attributes)) {
115113
$attributes = [$attributes];
116114
}
117115

118-
if (1 === count($attributes)
116+
if (1 === \count($attributes)
119117
&& self::VIEW_ATTRIBUTE === reset($attributes)
120118
&& null !== $this->tokenStorage->getToken()
121119
&& $this->authorizationChecker->isGranted($this->bypassingRole)

src/PublishWorkflow/Voter/PublishTimePeriodVoter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public function __construct()
3737

3838
/**
3939
* Overwrite the current time.
40-
*
41-
* @param \DateTime $currentTime
4240
*/
4341
public function setCurrentTime(\DateTime $currentTime)
4442
{
@@ -74,7 +72,7 @@ public function supportsClass($class)
7472
*/
7573
public function vote(TokenInterface $token, $subject, array $attributes)
7674
{
77-
if (!is_object($subject) || !$this->supportsClass(get_class($subject))) {
75+
if (!\is_object($subject) || !$this->supportsClass(\get_class($subject))) {
7876
return self::ACCESS_ABSTAIN;
7977
}
8078

src/PublishWorkflow/Voter/PublishableVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function supportsClass($class)
5252
*/
5353
public function vote(TokenInterface $token, $subject, array $attributes)
5454
{
55-
if (!is_object($subject) || !$this->supportsClass(get_class($subject))) {
55+
if (!\is_object($subject) || !$this->supportsClass(\get_class($subject))) {
5656
return self::ACCESS_ABSTAIN;
5757
}
5858

0 commit comments

Comments
 (0)