Skip to content

Remove superfluous phpdoc tags #33151

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

Merged
merged 1 commit into from
Aug 14, 2019
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
13 changes: 5 additions & 8 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ return PhpCsFixer\Config::create()
'array_syntax' => ['syntax' => 'short'],
'fopen_flags' => false,
'ordered_imports' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'protected_to_private' => false,
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
Expand All @@ -25,29 +27,24 @@ return PhpCsFixer\Config::create()
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->append([__FILE__])
->notPath('#/Fixtures/#')
->exclude([
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
'Symfony/Component/DependencyInjection/Tests/Fixtures',
'Symfony/Component/Routing/Tests/Fixtures/dumper',
// fixture templates
'Symfony/Component/Templating/Tests/Fixtures/templates',
'Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TemplatePathsCache',
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
// generated fixtures
'Symfony/Component/VarDumper/Tests/Fixtures',
// resource templates
'Symfony/Bundle/FrameworkBundle/Resources/views/Form',
// explicit trigger_error tests
'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/',
])
// Support for older PHPunit version
->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php')
->notPath('#Symfony/Bridge/PhpUnit/.*Mock\.php#')
->notPath('#Symfony/Bridge/PhpUnit/.*Legacy#')
// file content autogenerated by `var_export`
->notPath('Symfony/Component/Translation/Tests/fixtures/resources.php')
// test template
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
// explicit heredoc test
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
// explicit trigger_error tests
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public function __construct(ManagerRegistry $registry)
/**
* Adds the stack logger for a connection.
*
* @param string $name
* @param DebugStack $logger
* @param string $name
*/
public function addLogger($name, DebugStack $logger)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ protected function setMappingDriverAlias($mappingConfig, $mappingName)
/**
* Register the mapping driver configuration for later use with the object managers metadata driver chain.
*
* @param array $mappingConfig
* @param string $mappingName
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -225,7 +224,6 @@ protected function registerMappingDrivers($objectManager, ContainerBuilder $cont
/**
* Assertion if the specified mapping information is valid.
*
* @param array $mappingConfig
* @param string $objectManagerName
*
* @throws \InvalidArgumentException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public function process(ContainerBuilder $container)
* Gets the validation mapping files for the format and extends them with
* files matching a doctrine search pattern (Resources/config/validation.orm.xml).
*
* @param ContainerBuilder $container
* @param string $mapping
* @param string $extension
* @param string $mapping
* @param string $extension
*/
private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ private function getEventManagerDef(ContainerBuilder $container, $name)
* @see https://bugs.php.net/53710
* @see https://bugs.php.net/60926
*
* @param string $tagName
* @param ContainerBuilder $container
* @param string $tagName
*
* @return array
*/
Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,8 @@ public function configureOptions(OptionsResolver $resolver)
/**
* Return the default loader object.
*
* @param ObjectManager $manager
* @param mixed $queryBuilder
* @param string $class
* @param mixed $queryBuilder
* @param string $class
*
* @return EntityLoaderInterface
*/
Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ public function configureOptions(OptionsResolver $resolver)
/**
* Return the default loader object.
*
* @param ObjectManager $manager
* @param QueryBuilder $queryBuilder
* @param string $class
* @param QueryBuilder $queryBuilder
* @param string $class
*
* @return ORMQueryBuilderLoader
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ public function getTypes($class, $property, array $context = [])
/**
* Determines whether an association is nullable.
*
* @param array $associationMapping
*
* @return bool
*
* @see https://github.com/doctrine/doctrine2/blob/v2.5.4/lib/Doctrine/ORM/Tools/EntityGenerator.php#L1221-L1246
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class DoctrineTestHelper
/**
* Returns an entity manager for testing.
*
* @param Configuration|null $config
*
* @return EntityManager
*/
public static function createTestEntityManager(Configuration $config = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ public function providerBasicDrivers()

/**
* @param string $class
* @param array $config
*
* @dataProvider providerBasicDrivers
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public function __construct(ManagerRegistry $registry)
}

/**
* @param object $entity
* @param Constraint $constraint
* @param object $entity
*
* @throws UnexpectedTypeException
* @throws ConstraintDefinitionException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ protected function setUp()
/**
* @dataProvider getProxyCandidates
*
* @param Definition $definition
* @param bool $expected
* @param bool $expected
*/
public function testIsProxyCandidate(Definition $definition, $expected)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public function getPriority()
}

/**
* @param Node $arguments
* @param int $index
* @param int $index
*
* @return string|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Twig\Error\SyntaxError;
use Twig\Node\Expression\AbstractExpression;
use Twig\Node\Expression\ArrayExpression;
use Twig\Node\Node;
use Twig\Node\TextNode;
use Twig\Token;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bridge\Twig\TokenParser;

use Symfony\Bridge\Twig\Node\TransDefaultDomainNode;
use Twig\Node\Node;
use Twig\Token;
use Twig\TokenParser\AbstractTokenParser;

Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Bridge/Twig/TokenParser/TransTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Twig\Error\SyntaxError;
use Twig\Node\Expression\AbstractExpression;
use Twig\Node\Expression\ArrayExpression;
use Twig\Node\Node;
use Twig\Node\TextNode;
use Twig\Token;
use Twig\TokenParser\AbstractTokenParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ final protected function ignoreAutoloadException($class, \Exception $exception)
}

/**
* @param string $cacheDir
* @param ArrayAdapter $arrayAdapter
* @param string $cacheDir
*
* @return bool false if there is nothing to warm-up
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ class AnnotationsCacheWarmer extends AbstractPhpFileCacheWarmer
private $debug;

/**
* @param Reader $annotationReader
* @param string $phpArrayFile The PHP file where annotations are cached
* @param CacheItemPoolInterface $fallbackPool The pool where runtime-discovered annotations are cached
* @param bool $debug Run in debug mode
* @param string $phpArrayFile The PHP file where annotations are cached
* @param CacheItemPoolInterface $fallbackPool The pool where runtime-discovered annotations are cached
* @param bool $debug Run in debug mode
*/
public function __construct(Reader $annotationReader, $phpArrayFile, CacheItemPoolInterface $fallbackPool, $excludeRegexp = null, $debug = false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer
private $validatorBuilder;

/**
* @param ValidatorBuilderInterface $validatorBuilder
* @param string $phpArrayFile The PHP file where metadata are cached
* @param CacheItemPoolInterface $fallbackPool The pool where runtime-discovered metadata are cached
* @param string $phpArrayFile The PHP file where metadata are cached
* @param CacheItemPoolInterface $fallbackPool The pool where runtime-discovered metadata are cached
*/
public function __construct(ValidatorBuilderInterface $validatorBuilder, $phpArrayFile, CacheItemPoolInterface $fallbackPool)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class CacheClearCommand extends ContainerAwareCommand

/**
* @param CacheClearerInterface $cacheClearer
* @param Filesystem|null $filesystem
*/
public function __construct($cacheClearer = null, Filesystem $filesystem = null)
{
Expand Down Expand Up @@ -267,10 +266,9 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
}

/**
* @param KernelInterface $parent
* @param string $namespace
* @param string $parentClass
* @param string $warmupDir
* @param string $namespace
* @param string $parentClass
* @param string $warmupDir
*
* @return KernelInterface
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ abstract protected function describeContainerTags(ContainerBuilder $builder, arr
* * name: name of described service
*
* @param Definition|Alias|object $service
* @param array $options
* @param ContainerBuilder|null $builder
*/
abstract protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null);

Expand Down Expand Up @@ -167,7 +165,6 @@ abstract protected function describeEventDispatcherListeners(EventDispatcherInte
* Describes a callable.
*
* @param callable $callable
* @param array $options
*/
abstract protected function describeCallable($callable, array $options = []);

Expand Down Expand Up @@ -214,8 +211,7 @@ protected function formatParameter($value)
}

/**
* @param ContainerBuilder $builder
* @param string $serviceId
* @param string $serviceId
*
* @return mixed
*/
Expand All @@ -235,8 +231,7 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI
}

/**
* @param ContainerBuilder $builder
* @param bool $showPrivate
* @param bool $showPrivate
*
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ protected function getRouteData(Route $route)
}

/**
* @param Definition $definition
* @param bool $omitTags
* @param bool $omitTags
*
* @return array
*/
Expand Down Expand Up @@ -285,8 +284,7 @@ private function getContainerAliasData(Alias $alias)
}

/**
* @param EventDispatcherInterface $eventDispatcher
* @param string|null $event
* @param string|null $event
*
* @return array
*/
Expand Down Expand Up @@ -318,7 +316,6 @@ private function getEventDispatcherListenersData(EventDispatcherInterface $event

/**
* @param callable $callable
* @param array $options
*
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ private function renderEventListenerTable(EventDispatcherInterface $eventDispatc
}

/**
* @param array $config
*
* @return string
*/
private function formatRouterConfig(array $config)
Expand Down Expand Up @@ -494,7 +492,6 @@ private function formatCallable($callable)

/**
* @param string $content
* @param array $options
*/
private function writeText($content, array $options = [])
{
Expand Down
Loading