Skip to content

Commit

Permalink
Merge pull request #939 from mbabker/bump-cs
Browse files Browse the repository at this point in the history
Bump `doctrine/coding-standard` to latest
  • Loading branch information
goetas committed Dec 18, 2023
2 parents f9e82cb + 5798830 commit 100725a
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 161 deletions.
4 changes: 0 additions & 4 deletions .phpcs.xml.dist
Expand Up @@ -108,10 +108,6 @@
<exclude-pattern>tests/*</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements">
<exclude-pattern>tests/*</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="annotationsGroups" type="array">
Expand Down
12 changes: 3 additions & 9 deletions Cache/CacheClearer.php
Expand Up @@ -8,19 +8,13 @@
use Metadata\Cache\ClearableCacheInterface;
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;

/**
* @author Alexander Strizhak <gam6itko@gmail.com>
*/
/** @author Alexander Strizhak <gam6itko@gmail.com> */
class CacheClearer implements CacheClearerInterface
{
/**
* @var CacheInterface|ClearableCacheInterface
*/
/** @var CacheInterface|ClearableCacheInterface */
private $cache;

/**
* @param CacheInterface|ClearableCacheInterface $cache
*/
/** @param CacheInterface|ClearableCacheInterface $cache */
public function __construct(CacheInterface $cache)
{
$this->cache = $cache;
Expand Down
16 changes: 4 additions & 12 deletions Cache/CacheWarmer.php
Expand Up @@ -8,22 +8,14 @@
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;

/**
* @author Asmir Mustafic <goetas@gmail.com>
*/
/** @author Asmir Mustafic <goetas@gmail.com> */
class CacheWarmer implements CacheWarmerInterface
{
/**
* @var MetadataFactoryInterface
*/
/** @var MetadataFactoryInterface */
private $metadataFactory;
/**
* @var string[]
*/
/** @var string[] */
private $includePaths = [];
/**
* @var string[]
*/
/** @var string[] */
private $excludePaths = [];

public function __construct(array $includePaths, MetadataFactoryInterface $metadataFactory, array $excludePaths = [])
Expand Down
16 changes: 4 additions & 12 deletions ContextFactory/ConfiguredContextFactory.php
Expand Up @@ -47,17 +47,13 @@ class ConfiguredContextFactory implements SerializationContextFactoryInterface,
*/
private $groups = [];

/**
* @param string|null $version
*/
/** @param string|null $version */
public function setVersion($version)
{
$this->version = $version;
}

/**
* @param bool $serializeNulls
*/
/** @param bool $serializeNulls */
public function setSerializeNulls($serializeNulls)
{
$this->serializeNulls = (bool) $serializeNulls;
Expand All @@ -68,17 +64,13 @@ public function enableMaxDepthChecks()
$this->enableMaxDepthChecks = true;
}

/**
* @param array $attributes
*/
/** @param array $attributes */
public function setAttributes(array $attributes)
{
$this->attributes = $attributes;
}

/**
* @param string[] $groups
*/
/** @param string[] $groups */
public function setGroups(array $groups)
{
$this->groups = $groups;
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Compiler/AssignVisitorsPass.php
Expand Up @@ -7,9 +7,7 @@
use JMS\SerializerBundle\DependencyInjection\ScopedContainer;
use Symfony\Component\DependencyInjection\Reference;

/**
* @internal
*/
/** @internal */
final class AssignVisitorsPass extends PerInstancePass
{
protected function processInstance(ScopedContainer $container): void
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Compiler/CustomHandlersPass.php
Expand Up @@ -11,9 +11,7 @@
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\DependencyInjection\Reference;

/**
* @internal
*/
/** @internal */
final class CustomHandlersPass extends PerInstancePass
{
protected function processInstance(ScopedContainer $container): void
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Compiler/DoctrinePass.php
Expand Up @@ -7,9 +7,7 @@
use JMS\SerializerBundle\DependencyInjection\ScopedContainer;
use Symfony\Component\DependencyInjection\Reference;

/**
* @internal
*/
/** @internal */
final class DoctrinePass extends PerInstancePass
{
protected function processInstance(ScopedContainer $container): void
Expand Down
Expand Up @@ -8,9 +8,7 @@
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\DependencyInjection\Reference;

/**
* @internal
*/
/** @internal */
final class ExpressionFunctionProviderPass extends PerInstancePass
{
protected function processInstance(ScopedContainer $container): void
Expand Down
Expand Up @@ -6,9 +6,7 @@

use JMS\SerializerBundle\DependencyInjection\ScopedContainer;

/**
* @internal
*/
/** @internal */
final class FormErrorHandlerTranslationDomainPass extends PerInstancePass
{
protected function processInstance(ScopedContainer $container): void
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Compiler/PerInstancePass.php
Expand Up @@ -8,9 +8,7 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* @internal
*/
/** @internal */
abstract class PerInstancePass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
Expand Down
Expand Up @@ -9,9 +9,7 @@
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\DependencyInjection\Reference;

/**
* @internal
*/
/** @internal */
final class RegisterEventListenersAndSubscribersPass extends PerInstancePass
{
protected function processInstance(ScopedContainer $container): void
Expand Down
4 changes: 1 addition & 3 deletions DependencyInjection/Compiler/TwigExtensionPass.php
Expand Up @@ -6,9 +6,7 @@

use JMS\SerializerBundle\DependencyInjection\ScopedContainer;

/**
* @internal
*/
/** @internal */
final class TwigExtensionPass extends PerInstancePass
{
protected function processInstance(ScopedContainer $container): void
Expand Down
8 changes: 2 additions & 6 deletions DependencyInjection/Configuration.php
Expand Up @@ -10,16 +10,12 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Exception\InvalidTypeException;

/**
* @internal
*/
/** @internal */
final class Configuration implements ConfigurationInterface
{
private $debug;

/**
* @param bool $debug
*/
/** @param bool $debug */
public function __construct($debug = false)
{
$this->debug = $debug;
Expand Down
8 changes: 2 additions & 6 deletions DependencyInjection/DIUtils.php
Expand Up @@ -9,14 +9,10 @@
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

/**
* @internal
*/
/** @internal */
final class DIUtils
{
/**
* @see \JMS\SerializerBundle\DependencyInjection\Compiler\AdjustDecorationPass
*/
/** @see \JMS\SerializerBundle\DependencyInjection\Compiler\AdjustDecorationPass */
public static function adjustDecorators(ContainerBuilder $container): void
{
foreach ($container->getDefinitions() as $definition) {
Expand Down
11 changes: 3 additions & 8 deletions DependencyInjection/JMSSerializerExtension.php
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -25,13 +24,11 @@
use Symfony\Component\Uid\AbstractUid;
use Symfony\Component\Yaml\Yaml;

/**
* @internal
*/
/** @internal */
final class JMSSerializerExtension extends Extension
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function load(array $rawConfigs, ContainerBuilder $container): void
{
Expand Down Expand Up @@ -321,9 +318,7 @@ private function loadInternal(array $config, ScopedContainer $container, array $
$this->setContextFactories($container, $config);
}

/**
* @return ConfigurationInterface
*/
/** @return ConfigurationInterface */
public function getConfiguration(array $config, ContainerBuilder $container)
{
return new Configuration($container->getParameterBag()->resolveValue('%kernel.debug%'));
Expand Down
6 changes: 2 additions & 4 deletions ExpressionLanguage/BasicSerializerFunctionsProvider.php
Expand Up @@ -9,9 +9,7 @@

class BasicSerializerFunctionsProvider implements ExpressionFunctionProviderInterface
{
/**
* @return ExpressionFunction[]
*/
/** @return ExpressionFunction[] */
public function getFunctions(): array
{
return [
Expand All @@ -30,7 +28,7 @@ public function getFunctions(): array
}, static function (array $variables, $attribute, $object = null) {
return call_user_func_array(
[$variables['container']->get('jms_serializer.authorization_checker'), 'isGranted'],
[$attribute, $object]
[$attribute, $object],
);
}),
];
Expand Down
14 changes: 4 additions & 10 deletions Serializer/StopwatchEventSubscriber.php
Expand Up @@ -8,13 +8,11 @@
use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
use JMS\Serializer\EventDispatcher\ObjectEvent;

/**
* @author Adrien Brault <adrien.brault@gmail.com>
*/
/** @author Adrien Brault <adrien.brault@gmail.com> */
class StopwatchEventSubscriber implements EventSubscriberInterface
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public static function getSubscribedEvents()
{
Expand All @@ -31,14 +29,10 @@ public static function getSubscribedEvents()
*/
private $stopwatch;

/**
* @var string
*/
/** @var string */
private $name;

/**
* @var object
*/
/** @var object */
private $rootObject;

public function __construct($stopwatch, $name = 'jms_serializer')
Expand Down
4 changes: 2 additions & 2 deletions Templating/SerializerHelper.php
Expand Up @@ -12,9 +12,9 @@
*
* Basically provides access to JMSSerializer from PHP templates
*
* @author Rafał Wrzeszcz <rafal.wrzeszcz@wrzasq.pl>
*
* @deprecated use Twig instead
*
* @author Rafał Wrzeszcz <rafal.wrzeszcz@wrzasq.pl>
*/
class SerializerHelper extends Helper
{
Expand Down
4 changes: 1 addition & 3 deletions Tests/DependencyInjection/Fixture/AnotherSimpleObject.php
Expand Up @@ -12,9 +12,7 @@ class AnotherSimpleObject
#[Type(name: 'float')]
private $num;

/**
* @Type("string")
*/
/** @Type("string") */
#[Type(name: 'string')]
private $str;

Expand Down
7 changes: 5 additions & 2 deletions Tests/DependencyInjection/Fixture/DefaultValuePropObject.php
@@ -1,11 +1,14 @@
<?php

declare(strict_types=1);

namespace JMS\SerializerBundle\Tests\DependencyInjection\Fixture;

class DefaultValuePropObject
{
private string $foo = "some-value";
private string $foo = 'some-value';

public function __construct(private string $boo = "another-value") {
public function __construct(private string $boo = 'another-value')
{
}
}
Expand Up @@ -8,9 +8,7 @@

class AnInterfaceImplementation implements AnInterface
{
/**
* @Type("string")
*/
/** @Type("string") */
#[Type(name: 'string')]
private $bar;

Expand Down
Expand Up @@ -8,15 +8,11 @@

class AnObject
{
/**
* @Type("string")
*/
/** @Type("string") */
#[Type(name: 'string')]
private $foo;

/**
* @Type("JMS\SerializerBundle\Tests\DependencyInjection\Fixture\IncludeInterfaces\AnInterface")
*/
/** @Type("JMS\SerializerBundle\Tests\DependencyInjection\Fixture\IncludeInterfaces\AnInterface") */
#[Type(name: 'JMS\SerializerBundle\Tests\DependencyInjection\Fixture\IncludeInterfaces\AnInterface')]
private $bar;

Expand Down
Expand Up @@ -10,14 +10,10 @@ class ObjectUsingEnumDeserialize
{
private ObjectUsingEnumDeserializeCard $one;

/**
* @Type("enum<'JMS\SerializerBundle\Tests\DependencyInjection\Fixture\ObjectUsingEnumDeserializeCard'>")
*/
/** @Type("enum<'JMS\SerializerBundle\Tests\DependencyInjection\Fixture\ObjectUsingEnumDeserializeCard'>") */
#[Type(name: 'enum<"JMS\SerializerBundle\Tests\DependencyInjection\Fixture\ObjectUsingEnumDeserializeCard">')]
private $two;
/**
* @Type("array<enum<'JMS\SerializerBundle\Tests\DependencyInjection\Fixture\ObjectUsingEnumDeserializeCard'>>")
*/
/** @Type("array<enum<'JMS\SerializerBundle\Tests\DependencyInjection\Fixture\ObjectUsingEnumDeserializeCard'>>") */
#[Type(name: 'array<enum<"JMS\SerializerBundle\Tests\DependencyInjection\Fixture\ObjectUsingEnumDeserializeCard">>')]
private array $three;

Expand Down

0 comments on commit 100725a

Please sign in to comment.