Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump doctrine/coding-standard to latest #939

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 2 additions & 6 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
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
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
11 changes: 3 additions & 8 deletions DependencyInjection/JMSSerializerExtension.php
Original file line number Diff line number Diff line change
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
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(): 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
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
Original file line number Diff line number Diff line change
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
Loading
Loading