Skip to content

Commit 47f2aee

Browse files
minor symfony#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
2 parents 73d74c4 + efbba25 commit 47f2aee

File tree

50 files changed

+86
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+86
-86
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 1 addition & 1 deletion
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
*/

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 1 addition & 1 deletion
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
{

src/Symfony/Bundle/FrameworkBundle/Translation/PhpStringTokenParser.php

Lines changed: 1 addition & 1 deletion
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
*/

src/Symfony/Component/Console/Command/Command.php

Lines changed: 1 addition & 1 deletion
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
*

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 1 addition & 1 deletion
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
*/

src/Symfony/Component/Console/Question/Question.php

Lines changed: 6 additions & 6 deletions
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
{

src/Symfony/Component/CssSelector/Node/ElementNode.php

Lines changed: 2 additions & 2 deletions
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
{

src/Symfony/Component/CssSelector/Node/SelectorNode.php

Lines changed: 2 additions & 2 deletions
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
{

src/Symfony/Component/CssSelector/Parser/TokenStream.php

Lines changed: 1 addition & 1 deletion
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
*/

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)