8000 [CS] Enforces null type hint on last position in phpDocs · symfony/symfony@efbba25 · GitHub
[go: up one dir, main page]

Skip to content

Commit efbba25

Browse files
committed
[CS] Enforces null type hint on last position in phpDocs
1 parent a1312fa commit efbba25

File tree

50 files changed

+86
-86
lines changed

Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ abstract protected function getMappingResourceExtension();
453453
/**
454454
* Search for a manager that is declared as 'auto_mapping' = true.
455455
*
456-
* @return null|string The name of the manager. If no one manager is found, returns null
456+
* @return string|null The name of the manager. If no one manager is found, returns null
457457
*
458458
* @throws \LogicException
459459
*/
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface
4545
* @param ObjectManager $manager The object manager
4646
* @param string $class The class name of the loaded objects
4747
* @param IdReader $idReader The reader for the object IDs
48-
* @param null|EntityLoaderInterface $objectLoader The objects loader
48+
* @param EntityLoaderInterface|null $objectLoader The objects loader
4949
*/
5050
public function __construct(ChoiceListFactoryInterface $factory, ObjectManager $manager, $class, IdReader $idReader = null, EntityLoaderInterface $objectLoader = null)
5151
{
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static function parse($str)
8989
* Parses escape sequences in strings (all string types apart from single quoted).
9090
*
9191
* @param string $str String without quotes
92-
* @param null|string $quote Quote type
92+
* @param string|null $quote Quote type
9393
*
9494
* @return string String with escape sequences parsed
9595
*/
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ protected function configure()
140140
* execute() method, you set the code to execute by passing
141141
* a Closure to the setCode() method.
142142
*
143-
* @return null|int null or 0 if everything went fine, or an error code
143+
* @return int|null null or 0 if everything went fine, or an error code
144144
*
145145
* @throws LogicException When this abstract method is not implemented
146146
*
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getName()
109109
*
110110
* This method is public for PHP 5.3 compatibility, it should be private.
111111
*
112-
* @return bool|mixed|null|string
112+
* @return bool|mixed|string|null
113113
*
114114
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
115115
*/
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function setHiddenFallback($fallback)
117117
/**
118118
* Gets values for the autocompleter.
119119
*
120-
* @return null|iterable
120+
* @return iterable|null
121121
*/
122122
public function getAutocompleterValues()
123123
{
@@ -127,7 +127,7 @@ public function getAutocompleterValues()
127127
/**
128128
* Sets values for the autocompleter.
129129
*
130-
* @param null|iterable $values
130+
* @param iterable|null $values
131131
*
132132
* @return $this
133133
*
@@ -156,7 +156,7 @@ public function setAutocompleterValues($values)
156156
/**
157157
* Sets a validator for the question.
158158
*
159-
* @param null|callable $validator
159+
* @param callable|null $validator
160160
*
161161
* @return $this
162162
*/
@@ -170,7 +170,7 @@ public function setValidator($validator)
170170
/**
171171
* Gets the validator for the question.
172172
*
173-
* @return null|callable
173+
* @return callable|null
174174
*/
175175
public function getValidator()
176176
{
@@ -182,7 +182,7 @@ public function getValidator()
182182
*
183183
* Null means an unlimited number of attempts.
184184
*
185-
* @param null|int $attempts
185+
* @param int|null $attempts
186186
*
187187
* @return $this
188188
*
@@ -204,7 +204,7 @@ public function setMaxAttempts($attempts)
204204
*
205205
* Null means an unlimited number of attempts.
206206
*
207-
* @return null|int
207+
* @return int|null
208208
*/
209209
public function getMaxAttempts()
210210
{
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public function __construct($namespace = null, $element = null)
3737
}
3838

3939
/**
40-
* @return null|string
40+
* @return string|null
4141
*/
4242
public function getNamespace()
4343
{
4444
return $this->namespace;
4545
}
4646

4747
/**
48-
* @return null|string
48+
* @return string|null
4949
*/
5050
public function getElement()
5151
{
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SelectorNode extends AbstractNode
2828

2929
/**
3030
* @param NodeInterface $tree
31-
* @param null|string $pseudoElement
31+
* @param string|null $pseudoElement
3232
*/
3333
public function __construct(NodeInterface $tree, $pseudoElement = null)
3434
{
@@ -45,7 +45,7 @@ public function getTree()
4545
}
4646

4747
/**
48-
* @return null|string
48+
* @return string|null
4949
*/
5050
public function getPseudoElement()
5151
{
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function getNextIdentifier()
142142
/**
143143
* Returns nex identifier or star delimiter token.
144144
*
145-
* @return null|string The identifier token value or null if star found
145+
* @return string|null The identifier token value or null if star found
146146
*
147147
* @throws SyntaxErrorException If next token is not an identifier or a star delimiter
148148
*/
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class ErrorHandler
115115
/**
116116
* Registers the error handler.
117117
*
118-
* @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
118+
* @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
119119
* @param bool $replace Whether to replace or not any existing handler
120120
*
121121
* @return self The registered error handler
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ public function setFactoryMethod($factoryMethod)
142142
/**
143143
* Sets the service that this service is decorating.
144144
*
145-
* @param null|string $id The decorated service id, use null to remove decoration
146-
* @param null|string $renamedId The new decorated service id
145+
* @param string|null $id The decorated service id, use null to remove decoration
146+
* @param string|null $renamedId The new decorated service id
147147
* @param int $priority The priority of decoration
148148
*
149149
* @return $this
@@ -168,7 +168,7 @@ public function setDecoratedService($id, $renamedId = null, $priority = 0)
168168
/**
169169
* Gets the service that this service is decorating.
170170
*
171-
* @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
171+
* @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
172172
*/
173173
public function getDecoratedService()
174174
{
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function add($node)
104104
* HTTP 1.1 specification.
105105
*
106106
* @param string $content A string to parse as HTML/XML
107-
* @param null|string $type The content type of the string
107+
* @param string|null $type The content type of the string
108108
*/
109109
public function addContent($content, $type = null)
110110
{
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ public function tempnam($dir, $prefix)
578578
*
579579
* @param string $filename The file to be written to
580580
* @param string $content The data to write into the file
581-
* @param null|int $mode The file mode (octal). If null, file permissions are not modified
581+
* @param int|null $mode The file mode (octal). If null, file permissions are not modified
582582
* Deprecated since version 2.3.12, to be removed in 3.0.
583583
*
584584
* @throws IOException if the file cannot be written to
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public function handleRequest($request = null)
368368
/**
369369
* Submits data to the button.
370370
*
371-
* @param null|string $submittedData The data
371+
* @param string|null $submittedData The data
372372
* @param bool $clearMissing Not used
373373
*
374374
* @return $this
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface ChoiceListFactoryInterface
3232
* argument.
3333
*
3434
* @param iterable $choices The choices
35-
* @param null|callable $value The callable generating the choice
35+
* @param callable|null $value The callable generating the choice
3636
* values
3737
*
3838
* @return ChoiceListInterface The choice list
@@ -51,7 +51,7 @@ public function createListFromChoices($choices, $value = null);
5151
* argument.
5252
*
5353
* @param array|\Traversable $choices The choices
54-
* @param null|callable $value The callable generating the choice
54+
* @param callable|null $value The callable generating the choice
5555
* values
5656
*
5757
* @return ChoiceListInterface The choice list
@@ -69,7 +69,7 @@ public function createListFromFlippedChoices($choices, $value = null);
6969
* argument.
7070
*
7171
* @param ChoiceLoaderInterface $loader The choice loader
72-
* @param null|callable $value The callable generating the choice
72+
* @param callable|null $value The callable generating the choice
7373
* values
7474
*
7575
* @return ChoiceListInterface The choice list
@@ -103,14 +103,14 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
103103
* attributes that should be added to the respective choice.
104104
*
105105
* @param ChoiceListInterface $list The choice list
106-
* @param null|array|callable $preferredChoices The preferred choices
107-
* @param null|callable $label The callable generating the
106+
* @param array|callable|null $preferredChoices The preferred choices
107+
* @param callable|null $label The callable generating the
108108
* choice labels
109-
* @param null|callable $index The callable generating the
109+
* @param callable|null $index The callable generating the
110110
* view indices
111-
* @param null|callable $groupBy The callable generating the
111+
* @param callable|null $groupBy The callable generating the
112112
* group names
113-
* @param null|array|callable $attr The callable generating the
113+
* @param array|callable|null $attr The callable generating the
114114
* HTML attributes
115115
*
116116
* @return ChoiceListView The choice list view
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getDecoratedFactory()
6060
* {@inheritdoc}
6161
*
6262
* @param iterable $choices The choices
63-
* @param null|callable|string|PropertyPath $value The callable or path for
63+
* @param callable|string|PropertyPath|null $value The callable or path for
6464
* generating the choice values
6565
*
6666
* @return ChoiceListInterface The choice list
@@ -91,7 +91,7 @@ public function createListFromChoices($choices, $value = null)
9191
* {@inheritdoc}
9292
*
9393
* @param array|\Traversable $choices The choices
94-
* @param null|callable|string|PropertyPath $value The callable or path for
94+
* @param callable|string|PropertyPath|null $value The callable or path for
9595
* generating the choice values
9696
*
9797
* @return ChoiceListInterface The choice list
@@ -110,7 +110,7 @@ public function createListFromFlippedChoices($choices, $value = null, $triggerDe
110110
* {@inheritdoc}
111111
*
112112
* @param ChoiceLoaderInterface $loader The choice loader
113-
* @param null|callable|string|PropertyPath $value The callable or path for
113+
* @param callable|string|PropertyPath|null $value The callable or path for
114114
* generating the choice values
115115
*
116116
* @return ChoiceListInterface The choice list
@@ -141,11 +141,11 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
141141
* {@inheritdoc}
142142
*
143143
* @param ChoiceListInterface $list The choice list
144-
* @param null|array|callable|string|PropertyPath $preferredChoices The preferred choices
145-
* @param null|callable|string|PropertyPath $label The callable or path generating the choice labels
146-
* @param null|callable|string|PropertyPath $index The callable or path generating the view indices
147-
* @param null|callable|string|PropertyPath $groupBy The callable or path generating the group names
148-
* @param null|array|callable|string|PropertyPath $attr The callable or path generating the HTML attributes
144+
* @param array|callable|string|PropertyPath|null $preferredChoices The preferred choices
145+
* @param callable|string|PropertyPath|null $label The callable or path generating the choice labels
146+
* @param callable|string|PropertyPath|null $index The callable or path generating the view indices
147+
* @param callable|string|PropertyPath|null $groupBy The callable or path generating the group names
148+
* @param array|callable|string|PropertyPath|null $attr The callable or path generating the HTML attributes
149149
*
150150
* @return ChoiceListView The choice list view
151151
*/
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LazyChoiceList implements ChoiceListInterface
3434
*
3535
* If null, choices are simply cast to strings.
3636
*
37-
* @var null|callable
37+
* @var callable|null
3838
*/
3939
private $value;
4040

@@ -51,7 +51,7 @@ class LazyChoiceList implements ChoiceListInterface
5151
* argument.
5252
*
5353
* @param ChoiceLoaderInterface $loader The choice loader
54-
* @param null|callable $value The callable generating the choice values
54+
* @param callable|null $value The callable generating the choice values
5555
*/
5656
public function __construct(ChoiceLoaderInterface $loader, $value = null)
5757
{
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface ChoiceLoaderInterface
3131
* The callable receives the choice as first and the array key as the second
3232
* argument.
3333
*
34-
* @param null|callable $value The callable which generates the values
34+
* @param callable|null $value The callable which generates the values
3535
* from choices
3636
*
3737
* @return ChoiceListInterface The loaded choice list
@@ -50,7 +50,7 @@ public function loadChoiceList($value = null);
5050
*
5151
* @param string[] $values An array of choice values. Non-existing
5252
* values in this array are ignored
53-
* @param null|callable $value The callable generating the choice values
53+
* @param callable|null $value The callable generating the choice values
5454
*
5555
* @return array An array of choices
5656
*/
@@ -68,7 +68,7 @@ public function loadChoicesForValues(array $values, $value = null);
6868
*
6969
* @param array $choices An array of choices. Non-existing choices in
7070
* this array are ignored
71-
* @param null|callable $value The callable generating the choice values
71+
* @param callable|null $value The callable generating the choice values
7272
*
7373
* @return string[] An array of choice values
7474
*/
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CsrfExtension extends AbstractExtension
3232
/**
3333
* @param CsrfTokenManagerInterface $tokenManager The CSRF token manager
3434
* @param TranslatorInterface $translator The translator for translating error messages
35-
* @param null|string $translationDomain The translation domain for translating
35+
* @param string|null $translationDomain The translation domain for translating
3636
*/
3737
public function __construct($tokenManager, TranslatorInterface $translator = null, $translationDomain = null)
3838
{
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function getSubscribedEvents()
5151
* same session and with the same tokenId
5252
* @param string $errorMessage The message displayed in case of an error
5353
* @param TranslatorInterface $translator
54-
* @param null|string $translationDomain
54+
* @param string|null $translationDomain
5555
* @param ServerParams $serverParams
5656
*/
5757
public function __construct($fieldName, $tokenManager, $tokenId, $errorMessage, TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null)
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class FormTypeCsrfExtension extends AbstractTypeExtension
4747
* @param bool $defaultEnabled
4848
* @param string $defaultFieldName
4949
* @param TranslatorInterface $translator
50-
* @param null|string $translationDomain
50+
* @param string|null $translationDomain
5151
* @param ServerParams $serverParams
5252
*/
5353
public function __construct($defaultTokenManager, $defaultEnabled = true, $defaultFieldName = '_token', TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null)
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class UploadValidatorExtension extends AbstractTypeExtension
2727

2828
/**
2929
* @param TranslatorInterface $translator The translator for translating error messages
30-
* @param null|string $translationDomain The translation domain for translating
30+
* @param string|null $translationDomain The translation domain for translating
3131
*/
3232
public function __construct(TranslatorInterface $translator, $translationDomain = null)
3333
{
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getOrigin()
5151
*
5252
* @param string $propertyPath The property path to match against the rule
5353
*
54-
* @return null|FormInterface The mapped form or null
54+
* @return FormInterface|null The mapped form or null
5555
*/
5656
public function match($propertyPath)
5757
{
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function mapViolation(ConstraintViolation $violation, FormInterface $form
144144
* @param FormInterface $form The form to search
145145
* @param PropertyPathIteratorInterface $it The iterator at its current position
146146
*
147-
* @return null|FormInterface The found match or null
147+
* @return FormInterface|null The found match or null
148148
*/
149149
private function matchChild(FormInterface $form, PropertyPathIteratorInterface $it)
150150
{
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function setRequired($required);
146146
/**
147147
* Sets the property path that the form should be mapped to.
148148
*
149-
* @param null|string|PropertyPathInterface $propertyPath The property path or null if the path should be set
149+
* @param string|PropertyPathInterface|null $propertyPath The property path or null if the path should be set
150150
* automatically based on the form's name
151151
*
152152
* @return $this The configuration object