8000 [POC] Add PHP 7.1 typehints + remove unused doc for @param and @return, by TomasVotruba · Pull Request #24930 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[POC] Add PHP 7.1 typehints + remove unused doc for @param and @return, #24930

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function __construct(ManagerRegistry $registry)
* Adds the stack logger for a connection.
*
* @param string $name
* @param DebugStack $logger
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this rule :)

*/
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
1 change: 0 additions & 1 deletion src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ public function configureOptions(OptionsResolver $resolver)
/**
* Return the default loader object.
*
* @param ObjectManager $manager
* @param mixed $queryBuilder
* @param string $class
*
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function configureOptions(OptionsResolver $resolver)
/**
* Return the default loader object.
*
* @param ObjectManager $manager
* @param QueryBuilder $queryBuilder
* @param string $class
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function __construct(ManagerRegistry $registry)

/**
* @param object $entity
* @param Constraint $constraint
*
* @throws UnexpectedTypeException
* @throws ConstraintDefinitionException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array

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

/**
* @param Reader $annotationReader
* @param string $phpArrayFile The PHP file where annotations are cached
* @param CacheItemPoolInterface $fallbackPool The pool where runtime-discovered annotations are cached
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ 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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +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 = array(), ContainerBuilder $builder = null);
Expand Down Expand Up @@ -167,7 +166,6 @@ abstract protected function describeEventDispatcherListeners(EventDispatcherInte
* Describes a callable.
*
* @param callable $callable
* @param array $options
*/
abstract protected function describeCallable($callable, array $options = array());

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

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

/**
* @param ContainerBuilder $builder
* @param bool $showPrivate
*
* @return array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public function testGetUserWithEmptyContainer()
}

/**
* @param $token
*
* @return Container
*/
private function getContainerWithTokenStorage($token = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Translator extends BaseTranslator implements WarmableInterface
*
* @param ContainerInterface $container A ContainerInterface instance
* @param MessageFormatterInterface $formatter The message formatter
* @param string $defaultLocale
* @param array $loaderIds An array of loader Ids
* @param array $options An array of options
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ final public function addOption($name, $default = null)
* Subclasses must return the id of a service which implements the
* AuthenticationProviderInterface.
*
* @param ContainerBuilder $container
* @param string $id The unique id of the firewall
* @param array $config The options array for this listener
* @param string $userProviderId The id of the user provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class ExceptionController
protected $debug;

/**
* @param Environment $twig
* @param bool $debug Show error (false) or exception (true) pages by default
*/
public function __construct(Environment $twig, bool $debug)
Expand Down Expand Up @@ -88,7 +87,6 @@ protected function getAndCleanOutputBuffering($startObLevel)
}

/**
* @param Request $request
* @param string $format
* @param int $code An HTTP response status code
* @param bool $showException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function __construct(Profiler $profiler, Environment $twig, array $templa
/**
* Gets the template name for a given panel.
*
* @param Profile $profile
* @param string $panel
*
* @return mixed
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Cache/Adapter/ArrayAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class ArrayAdapter implements AdapterInterface, LoggerAwareInterface, Resettable
private $createCacheItem;

/**
* @param int $defaultLifetime
* @param bool $storeSerialized Disabling serialization can lead to cache corruptions when storing mutable values but increases performance otherwise
*/
public function __construct(int $defaultLifetime = 0, bool $storeSerialized = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class CacheDataCollector extends DataCollector implements LateDataCollectorInter

/**
* @param string $name
* @param TraceableAdapter $instance
*/
public function addInstance($name, TraceableAdapter $instance)
{
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Cache/Simple/ArrayCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class ArrayCache implements CacheInterface, LoggerAwareInterface, ResettableInte
private $defaultLifetime;

/**
* @param int $defaultLifetime
* @param bool $storeSerialized Disabling serialization can lead to cache corruptions when storing mutable values but increases performance otherwise
*/
public function __construct(int $defaultLifetime = 0, bool $storeSerialized = true)
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/Cache/Simple/RedisCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class RedisCache extends AbstractCache

/**
* @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient
* @param string $namespace
* @param int $defaultLifetime
*/
public function __construct($redisClient, string $namespace = '', int $defaultLifetime = 0)
{
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Config/Definition/BaseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ final public function normalize($value)
/**
* Normalizes the value before any other normalization is applied.
*
* @param $value
*
* @return $value The normalized array value
*/
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Console/Descriptor/XmlDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function getCommandDocument(Command $command)
}

/**
* @param Application $application
* @param string|null $namespace
*
* @return \DOMDocument
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/Console/Helper/DescriptorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ public function __construct()
* * format: string, the output format name
* * raw_text: boolean, sets output type as raw
*
* @param OutputInterface $output
* @param object $object
* @param array $options
*
* @throws InvalidArgumentException when the given format is not supported
*/
Expand All @@ -73,7 +71,6 @@ public function describe(OutputInterface $output, $object, array $options = arra
* Registers a descriptor.
*
* @param string $format
* @param DescriptorInterface $descriptor
*
* @return $this
*/
Expand Down
5 changes: 0 additions & 5 deletions src/Symfony/Component/Console/Helper/ProgressIndicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class ProgressIndicator
private static $formats;

/**
* @param OutputInterface $output
* @param string|null $format Indicator format
* @param int $indicatorChangeInterval Change interval in milliseconds
* @param array|null $indicatorValues Animated indicator characters
Expand Down Expand Up @@ -77,8 +76,6 @@ public function setMessage($message)

/**
* Starts the indicator output.
*
* @param $message
*/
public function start($message)
{
Expand Down Expand Up @@ -122,8 +119,6 @@ public function advance()

/**
* Finish the indicator with message.
*
* @param $message
*/
public function finish($message)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/Console/Helper/QuestionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ protected function writeError(OutputInterface $output, \Exception $error)
/**
* Autocompletes a question.
*
* @param OutputInterface $output
* @param Question $question
* @param resource $inputStream
*/
private function autocomplete(OutputInterface $output, Question $question, $inputStream): string
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Console/Helper/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ public function setColumnWidth($columnIndex, $width)
/**
* Sets the minimum width of all columns.
*
* @param array $widths
*
* @return $this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class SyntaxErrorException extends ParseException
{
/**
* @param string $expectedValue
* @param Token $foundToken
*
* @return self
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Symfony/Component/CssSelector/Node/AbstractNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ abstract class AbstractNode implements NodeInterface
*/
private $nodeName;

/**
* @return string
*/
public function getNodeName(): string
{
if (null === $this->nodeName) {
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/CssSelector/Node/FunctionNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class FunctionNode extends AbstractNode
private $arguments;

/**
* @param NodeInterface $selector
* @param string $name
* @param Token[] $arguments
*/
public function __construct(NodeInterface $selector, string $name, array $arguments = array())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ public function getCombinationTranslators(): array
);
}

/**
* @return XPathExpr
*/
public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath): XPathExpr
{
return $xpath->join('/descendant-or-self::*/', $combinedXpath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ protected function processValue($value, $isRoot = false)
}

/**
* @param Definition $definition
* @param bool $required
*
* @return \ReflectionFunctionAbstract|null
Expand Down Expand Up @@ -133,7 +132,6 @@ protected function getConstructor(Definition $definition, $required)
}

/**
* @param Definition $definition
* @param string $method
*
* @throws RuntimeException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ private function doProcessValue($value, $isRoot = false)

/**
* @param \ReflectionClass $reflectionClass
* @param array $methodCalls
*
* @return array
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ protected function processValue($value, $isRoot = false)
}

/**
* @param ContainerBuilder $container
* @param Reference[] $refMap
*
* @return Reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ public function getReflectionClass(?string $class, bool $throw = true): ?\Reflec
* @param bool|string $trackContents Whether to track contents of the given resource. If a string is passed,
* it will be used as pattern for tracking contents of the requested directory
*
* @return bool
*
* @final
*/
Expand Down Expand Up @@ -1453,7 +1452,6 @@ private function callMethod($service, $call)
/**
* Shares a given service in the container.
*
* @param Definition $definition
* @param object $service
* @param string|null $id
*/
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/DependencyInjection/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,6 @@ public function getBindings()
* injected in the matching parameters (of the constructor, of methods
* called and of controller actions).
*
* @param array $bindings
*
* @return $this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ private function addService($definition, $id, \DOMElement $parent)
* Adds a service alias.
*
* @param string $alias
* @param Alias $id
* @param \DOMElement $parent
*/
private function addServiceAlias($alias, Alias $id, \DOMElement $parent)
Expand Down Expand Up @@ -254,7 +253,6 @@ private function addServices(\DOMElement $parent)
/**
* Converts parameters.
*
* @param array $parameters
* @param string $type
* @param \DOMElement $parent
* @param string $keyAttribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public function registerClasses(Definition $prototype, $namespace, $resource, $e
* Registers a definition in the container with its instanceof-conditionals.
*
* @param string $id
* @param Definition $definition
*/
protected function setDefinition($id, Definition $definition)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ private function getServiceDefaults(\DOMDocument $xml, $file)
*
* @param \DOMElement $service
* @param string $file
* @param array $defaults
*
* @return Definition|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ private function isUsingShortSyntax(array $service): bool
* @param string $id
* @param array|string $service
* @param string $file
* @param array $defaults
*
* @throws InvalidArgumentException When tags are invalid
*/
Expand Down
Loading
0