Skip to content

Commit

Permalink
Bump doctrine/coding-standard to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
mbabker committed Nov 3, 2023
1 parent f998dcb commit 3cc69c7
Show file tree
Hide file tree
Showing 29 changed files with 59 additions and 159 deletions.
4 changes: 0 additions & 4 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
use Metadata\Cache\ClearableCacheInterface;
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;

/**
* @author Alexander Strizhak <[email protected]>
*/
/** @author Alexander Strizhak <[email protected]> */
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,14 @@
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;

/**
* @author Asmir Mustafic <[email protected]>
*/
/** @author Asmir Mustafic <[email protected]> */
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
12 changes: 3 additions & 9 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,18 @@
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;
}

/**
* @return TreeBuilder
*/
/** @return TreeBuilder */
public function getConfigTreeBuilder()
{
$tb = new TreeBuilder('jms_serializer');
Expand Down
8 changes: 2 additions & 6 deletions DependencyInjection/DIUtils.php
Original file line number Diff line number Diff line change
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
12 changes: 3 additions & 9 deletions DependencyInjection/JMSSerializerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
use JMS\Serializer\Expression\CompilableExpressionEvaluatorInterface;
use JMS\Serializer\Handler\SubscribingHandlerInterface;
use JMS\Serializer\Handler\SymfonyUidHandler;
use JMS\Serializer\Metadata\Driver\AttributeDriver;
use JMS\Serializer\Metadata\Driver\AttributeDriver\AttributeReader;
use JMS\Serializer\Metadata\Driver\DocBlockDriver;
use Symfony\Component\Config\Definition\ConfigurationInterface;
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 +23,11 @@
use Symfony\Component\Templating\Helper\Helper;
use Symfony\Component\Uid\AbstractUid;

/**
* @internal
*/
/** @internal */
final class JMSSerializerExtension extends Extension
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function load(array $rawConfigs, ContainerBuilder $container): void
{
Expand Down Expand Up @@ -305,9 +301,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
4 changes: 1 addition & 3 deletions ExpressionLanguage/BasicSerializerFunctionsProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

class BasicSerializerFunctionsProvider implements ExpressionFunctionProviderInterface
{
/**
* @return ExpressionFunction[]
*/
/** @return ExpressionFunction[] */
public function getFunctions()
{
return [
Expand Down
14 changes: 4 additions & 10 deletions Serializer/StopwatchEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
use JMS\Serializer\EventDispatcher\ObjectEvent;

/**
* @author Adrien Brault <[email protected]>
*/
/** @author Adrien Brault <[email protected]> */
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*
* Basically provides access to JMSSerializer from PHP templates
*
* @author Rafał Wrzeszcz <[email protected]>
*
* @deprecated use Twig instead
*
* @author Rafał Wrzeszcz <[email protected]>
*/
class SerializerHelper extends Helper
{
Expand Down
4 changes: 1 addition & 3 deletions Tests/DependencyInjection/Fixture/AnotherSimpleObject.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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')
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

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

Expand Down
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 3cc69c7

Please sign in to comment.