Permalink
Browse files

minor #28675 [CS] Enforces null type hint on last position in phpDocs…

… (carusogabriel)

This PR was merged into the 2.8 branch.

Discussion
----------

[CS] Enforces null type hint on last position in phpDocs

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

As a majority in our codebase, the `null` typehint usually comes in the last position in phpDocs.

Commits
-------

efbba25 [CS] Enforces null type hint on last position in phpDocs
  • Loading branch information...
nicolas-grekas committed Oct 2, 2018
2 parents 73d74c4 + efbba25 commit 47f2aee4a51de2c6739e14dbaa12318181ec2db4
Showing with 86 additions and 86 deletions.
  1. +1 −1 src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
  2. +1 −1 src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
  3. +1 −1 src/Symfony/Bundle/FrameworkBundle/Translation/PhpStringTokenParser.php
  4. +1 −1 src/Symfony/Component/Console/Command/Command.php
  5. +1 −1 src/Symfony/Component/Console/Helper/QuestionHelper.php
  6. +6 −6 src/Symfony/Component/Console/Question/Question.php
  7. +2 −2 src/Symfony/Component/CssSelector/Node/ElementNode.php
  8. +2 −2 src/Symfony/Component/CssSelector/Node/SelectorNode.php
  9. +1 −1 src/Symfony/Component/CssSelector/Parser/TokenStream.php
  10. +1 −1 src/Symfony/Component/Debug/ErrorHandler.php
  11. +3 −3 src/Symfony/Component/DependencyInjection/Definition.php
  12. +1 −1 src/Symfony/Component/DomCrawler/Crawler.php
  13. +1 −1 src/Symfony/Component/Filesystem/Filesystem.php
  14. +1 −1 src/Symfony/Component/Form/Button.php
  15. +8 −8 src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php
  16. +8 −8 src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php
  17. +2 −2 src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php
  18. +3 −3 src/Symfony/Component/Form/ChoiceList/Loader/ChoiceLoaderInterface.php
  19. +1 −1 src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php
  20. +1 −1 src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php
  21. +1 −1 src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php
  22. +1 −1 src/Symfony/Component/Form/Extension/Validator/Type/UploadValidatorExtension.php
  23. +1 −1 src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php
  24. +1 −1 src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php
  25. +1 −1 src/Symfony/Component/Form/FormConfigBuilderInterface.php
  26. +2 −2 src/Symfony/Component/Form/FormConfigInterface.php
  27. +1 −1 src/Symfony/Component/Form/FormTypeInterface.php
  28. +1 −1 src/Symfony/Component/Form/SubmitButton.php
  29. +1 −1 src/Symfony/Component/Form/Util/ServerParams.php
  30. +2 −2 src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
  31. +1 −1 src/Symfony/Component/HttpFoundation/HeaderBag.php
  32. +1 −1 src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php
  33. +1 −1 src/Symfony/Component/HttpKernel/Config/FileLocator.php
  34. +1 −1 src/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php
  35. +1 −1 src/Symfony/Component/HttpKernel/Profiler/Profile.php
  36. +1 −1 src/Symfony/Component/Intl/Intl.php
  37. +3 −3 src/Symfony/Component/Process/Process.php
  38. +2 −2 src/Symfony/Component/Process/ProcessBuilder.php
  39. +3 −3 src/Symfony/Component/Process/Tests/ProcessTest.php
  40. +1 −1 src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php
  41. +1 −1 src/Symfony/Component/Routing/Route.php
  42. +1 −1 src/Symfony/Component/Security/Csrf/CsrfTokenManager.php
  43. +2 −2 src/Symfony/Component/Security/Guard/GuardAuthenticatorHandler.php
  44. +1 −1 src/Symfony/Component/Serializer/NameConverter/CamelCaseToSnakeCaseNameConverter.php
  45. +1 −1 src/Symfony/Component/Stopwatch/Section.php
  46. +1 −1 src/Symfony/Component/Translation/Catalogue/AbstractOperation.php
  47. +2 −2 src/Symfony/Component/Validator/ExecutionContext.php
  48. +2 −2 src/Symfony/Component/Validator/ExecutionContextInterface.php
  49. +1 −1 src/Symfony/Component/Validator/Validator.php
  50. +1 −1 src/Symfony/Component/Validator/ValidatorBuilder.php
@@ -453,7 +453,7 @@ protected function fixManagersAutoMappings(array $managerConfigs, array $bundles
/**
* Search for a manager that is declared as 'auto_mapping' = true.
*
* @return null|string The name of the manager. If no one manager is found, returns null
* @return string|null The name of the manager. If no one manager is found, returns null
*
* @throws \LogicException
*/
@@ -45,7 +45,7 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface
* @param ObjectManager $manager The object manager
* @param string $class The class name of the loaded objects
* @param IdReader $idReader The reader for the object IDs
* @param null|EntityLoaderInterface $objectLoader The objects loader
* @param EntityLoaderInterface|null $objectLoader The objects loader
*/
public function __construct(ChoiceListFactoryInterface $factory, ObjectManager $manager, $class, IdReader $idReader = null, EntityLoaderInterface $objectLoader = null)
{
@@ -89,7 +89,7 @@ public static function parse($str)
* Parses escape sequences in strings (all string types apart from single quoted).
*
* @param string $str String without quotes
* @param null|string $quote Quote type
* @param string|null $quote Quote type
*
* @return string String with escape sequences parsed
*/
@@ -140,7 +140,7 @@ protected function configure()
* execute() method, you set the code to execute by passing
* a Closure to the setCode() method.
*
* @return null|int null or 0 if everything went fine, or an error code
* @return int|null null or 0 if everything went fine, or an error code
*
* @throws LogicException When this abstract method is not implemented
*
@@ -109,7 +109,7 @@ public function getName()
*
* This method is public for PHP 5.3 compatibility, it should be private.
*
* @return bool|mixed|null|string
* @return bool|mixed|string|null
*
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
*/
@@ -117,7 +117,7 @@ public function setHiddenFallback($fallback)
/**
* Gets values for the autocompleter.
*
* @return null|iterable
* @return iterable|null
*/
public function getAutocompleterValues()
{
@@ -127,7 +127,7 @@ public function getAutocompleterValues()
/**
* Sets values for the autocompleter.
*
* @param null|iterable $values
* @param iterable|null $values
*
* @return $this
*
@@ -156,7 +156,7 @@ public function setAutocompleterValues($values)
/**
* Sets a validator for the question.
*
* @param null|callable $validator
* @param callable|null $validator
*
* @return $this
*/
@@ -170,7 +170,7 @@ public function setValidator($validator)
/**
* Gets the validator for the question.
*
* @return null|callable
* @return callable|null
*/
public function getValidator()
{
@@ -182,7 +182,7 @@ public function getValidator()
*
* Null means an unlimited number of attempts.
*
* @param null|int $attempts
* @param int|null $attempts
*
* @return $this
*
@@ -204,7 +204,7 @@ public function setMaxAttempts($attempts)
*
* Null means an unlimited number of attempts.
*
* @return null|int
* @return int|null
*/
public function getMaxAttempts()
{
@@ -37,15 +37,15 @@ public function __construct($namespace = null, $element = null)
}
/**
* @return null|string
* @return string|null
*/
public function getNamespace()
{
return $this->namespace;
}
/**
* @return null|string
* @return string|null
*/
public function getElement()
{
@@ -28,7 +28,7 @@ class SelectorNode extends AbstractNode
/**
* @param NodeInterface $tree
* @param null|string $pseudoElement
* @param string|null $pseudoElement
*/
public function __construct(NodeInterface $tree, $pseudoElement = null)
{
@@ -45,7 +45,7 @@ public function getTree()
}
/**
* @return null|string
* @return string|null
*/
public function getPseudoElement()
{
@@ -142,7 +142,7 @@ public function getNextIdentifier()
/**
* Returns nex identifier or star delimiter token.
*
* @return null|string The identifier token value or null if star found
* @return string|null The identifier token value or null if star found
*
* @throws SyntaxErrorException If next token is not an identifier or a star delimiter
*/
@@ -115,7 +115,7 @@ class ErrorHandler
/**
* Registers the error handler.
*
* @param self|null|int $handler The handler to register, or @deprecated (since version 2.6, to be removed in 3.0) bit field of thrown levels
* @param self|int|null $handler The handler to register, or @deprecated (since version 2.6, to be removed in 3.0) bit field of thrown levels
* @param bool $replace Whether to replace or not any existing handler
*
* @return self The registered error handler
@@ -142,8 +142,8 @@ public function setFactoryMethod($factoryMethod)
/**
* Sets the service that this service is decorating.
*
* @param null|string $id The decorated service id, use null to remove decoration
* @param null|string $renamedId The new decorated service id
* @param string|null $id The decorated service id, use null to remove decoration
* @param string|null $renamedId The new decorated service id
* @param int $priority The priority of decoration
*
* @return $this
@@ -168,7 +168,7 @@ public function setDecoratedService($id, $renamedId = null, $priority = 0)
/**
* Gets the service that this service is decorating.
*
* @return null|array An array composed of the decorated service id, the new id for it and the priority of decoration, null if no service is decorated
* @return array|null An array composed of the decorated service id, the new id for it and the priority of decoration, null if no service is decorated
*/
public function getDecoratedService()
{
@@ -104,7 +104,7 @@ public function add($node)
* HTTP 1.1 specification.
*
* @param string $content A string to parse as HTML/XML
* @param null|string $type The content type of the string
* @param string|null $type The content type of the string
*/
public function addContent($content, $type = null)
{
@@ -578,7 +578,7 @@ public function tempnam($dir, $prefix)
*
* @param string $filename The file to be written to
* @param string $content The data to write into the file
* @param null|int $mode The file mode (octal). If null, file permissions are not modified
* @param int|null $mode The file mode (octal). If null, file permissions are not modified
* Deprecated since version 2.3.12, to be removed in 3.0.
*
* @throws IOException if the file cannot be written to
@@ -368,7 +368,7 @@ public function handleRequest($request = null)
/**
* Submits data to the button.
*
* @param null|string $submittedData The data
* @param string|null $submittedData The data
* @param bool $clearMissing Not used
*
* @return $this
@@ -32,7 +32,7 @@
* argument.
*
* @param iterable $choices The choices
* @param null|callable $value The callable generating the choice
* @param callable|null $value The callable generating the choice
* values
*
* @return ChoiceListInterface The choice list
@@ -51,7 +51,7 @@ public function createListFromChoices($choices, $value = null);
* argument.
*
* @param array|\Traversable $choices The choices
* @param null|callable $value The callable generating the choice
* @param callable|null $value The callable generating the choice
* values
*
* @return ChoiceListInterface The choice list
@@ -69,7 +69,7 @@ public function createListFromFlippedChoices($choices, $value = null);
* argument.
*
* @param ChoiceLoaderInterface $loader The choice loader
* @param null|callable $value The callable generating the choice
* @param callable|null $value The callable generating the choice
* values
*
* @return ChoiceListInterface The choice list
@@ -103,14 +103,14 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
* attributes that should be added to the respective choice.
*
* @param ChoiceListInterface $list The choice list
* @param null|array|callable $preferredChoices The preferred choices
* @param null|callable $label The callable generating the
* @param array|callable|null $preferredChoices The preferred choices
* @param callable|null $label The callable generating the
* choice labels
* @param null|callable $index The callable generating the
* @param callable|null $index The callable generating the
* view indices
* @param null|callable $groupBy The callable generating the
* @param callable|null $groupBy The callable generating the
* group names
* @param null|array|callable $attr The callable generating the
* @param array|callable|null $attr The callable generating the
* HTML attributes
*
* @return ChoiceListView The choice list view
@@ -60,7 +60,7 @@ public function getDecoratedFactory()
* {@inheritdoc}
*
* @param iterable $choices The choices
* @param null|callable|string|PropertyPath $value The callable or path for
* @param callable|string|PropertyPath|null $value The callable or path for
* generating the choice values
*
* @return ChoiceListInterface The choice list
@@ -91,7 +91,7 @@ public function createListFromChoices($choices, $value = null)
* {@inheritdoc}
*
* @param array|\Traversable $choices The choices
* @param null|callable|string|PropertyPath $value The callable or path for
* @param callable|string|PropertyPath|null $value The callable or path for
* generating the choice values
*
* @return ChoiceListInterface The choice list
@@ -110,7 +110,7 @@ public function createListFromFlippedChoices($choices, $value = null, $triggerDe
* {@inheritdoc}
*
* @param ChoiceLoaderInterface $loader The choice loader
* @param null|callable|string|PropertyPath $value The callable or path for
* @param callable|string|PropertyPath|null $value The callable or path for
* generating the choice values
*
* @return ChoiceListInterface The choice list
@@ -141,11 +141,11 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
* {@inheritdoc}
*
* @param ChoiceListInterface $list The choice list
* @param null|array|callable|string|PropertyPath $preferredChoices The preferred choices
* @param null|callable|string|PropertyPath $label The callable or path generating the choice labels
* @param null|callable|string|PropertyPath $index The callable or path generating the view indices
* @param null|callable|string|PropertyPath $groupBy The callable or path generating the group names
* @param null|array|callable|string|PropertyPath $attr The callable or path generating the HTML attributes
* @param array|callable|string|PropertyPath|null $preferredChoices The preferred choices
* @param callable|string|PropertyPath|null $label The callable or path generating the choice labels
* @param callable|string|PropertyPath|null $index The callable or path generating the view indices
* @param callable|string|PropertyPath|null $groupBy The callable or path generating the group names
* @param array|callable|string|PropertyPath|null $attr The callable or path generating the HTML attributes
*
* @return ChoiceListView The choice list view
*/
@@ -34,7 +34,7 @@ class LazyChoiceList implements ChoiceListInterface
*
* If null, choices are simply cast to strings.
*
* @var null|callable
* @var callable|null
*/
private $value;
@@ -51,7 +51,7 @@ class LazyChoiceList implements ChoiceListInterface
* argument.
*
* @param ChoiceLoaderInterface $loader The choice loader
* @param null|callable $value The callable generating the choice values
* @param callable|null $value The callable generating the choice values
*/
public function __construct(ChoiceLoaderInterface $loader, $value = null)
{
@@ -31,7 +31,7 @@
* The callable receives the choice as first and the array key as the second
* argument.
*
* @param null|callable $value The callable which generates the values
* @param callable|null $value The callable which generates the values
* from choices
*
* @return ChoiceListInterface The loaded choice list
@@ -50,7 +50,7 @@ public function loadChoiceList($value = null);
*
* @param string[] $values An array of choice values. Non-existing
* values in this array are ignored
* @param null|callable $value The callable generating the choice values
* @param callable|null $value The callable generating the choice values
*
* @return array An array of choices
*/
@@ -68,7 +68,7 @@ public function loadChoicesForValues(array $values, $value = null);
*
* @param array $choices An array of choices. Non-existing choices in
* this array are ignored
* @param null|callable $value The callable generating the choice values
* @param callable|null $value The callable generating the choice values
*
* @return string[] An array of choice values
*/
@@ -32,7 +32,7 @@ class CsrfExtension extends AbstractExtension
/**
* @param CsrfTokenManagerInterface $tokenManager The CSRF token manager
* @param TranslatorInterface $translator The translator for translating error messages
* @param null|string $translationDomain The translation domain for translating
* @param string|null $translationDomain The translation domain for translating
*/
public function __construct($tokenManager, TranslatorInterface $translator = null, $translationDomain = null)
{
@@ -51,7 +51,7 @@ public static function getSubscribedEvents()
* same session and with the same tokenId
* @param string $errorMessage The message displayed in case of an error
* @param TranslatorInterface $translator
* @param null|string $translationDomain
* @param string|null $translationDomain
* @param ServerParams $serverParams
*/
public function __construct($fieldName, $tokenManager, $tokenId, $errorMessage, TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null)
@@ -47,7 +47,7 @@ class FormTypeCsrfExtension extends AbstractTypeExtension
* @param bool $defaultEnabled
* @param string $defaultFieldName
* @param TranslatorInterface $translator
* @param null|string $translationDomain
* @param string|null $translationDomain
* @param ServerParams $serverParams
*/
public function __construct($defaultTokenManager, $defaultEnabled = true, $defaultFieldName = '_token', TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null)
@@ -27,7 +27,7 @@ class UploadValidatorExtension extends AbstractTypeExtension
/**
* @param TranslatorInterface $translator The translator for translating error messages
* @param null|string $translationDomain The translation domain for translating
* @param string|null $translationDomain The translation domain for translating
*/
public function __construct(TranslatorInterface $translator, $translationDomain = null)
{
@@ -51,7 +51,7 @@ public function getOrigin()
*
* @param string $propertyPath The property path to match against the rule
*
* @return null|FormInterface The mapped form or null
* @return FormInterface|null The mapped form or null
*/
public function match($propertyPath)
{
@@ -144,7 +144,7 @@ public function mapViolation(ConstraintViolation $violation, FormInterface $form
* @param FormInterface $form The form to search
* @param PropertyPathIteratorInterface $it The iterator at its current position
*
* @return null|FormInterface The found match or null
* @return FormInterface|null The found match or null
*/
private function matchChild(FormInterface $form, PropertyPathIteratorInterface $it)
{
@@ -146,7 +146,7 @@ public function setRequired($required);
/**
* Sets the property path that the form should be mapped to.
*
* @param null|string|PropertyPathInterface $propertyPath The property path or null if the path should be set
* @param string|PropertyPathInterface|null $propertyPath The property path or null if the path should be set
* automatically based on the form's name
*
* @return $this The configuration object
Oops, something went wrong.

0 comments on commit 47f2aee

Please sign in to comment.