Skip to content

Commit 80d8d78

Browse files
committed
nullable types for parameter typehints;
1 parent 347cd91 commit 80d8d78

18 files changed

+21
-21
lines changed

src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function enterNode(Node $node): ?int
112112
/**
113113
* Resets the state of the object to an empty state.
114114
*/
115-
private function resetState(string $namespace = null): void
115+
private function resetState(?string $namespace = null): void
116116
{
117117
$this->parts = new SplDoublyLinkedList();
118118
$this->parts->push($namespace);

src/phpDocumentor/Reflection/Php/Argument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class Argument
3939
/**
4040
* Initializes the object.
4141
*/
42-
public function __construct(string $name, string $default = null, bool $byReference = false, bool $isVariadic = false)
42+
public function __construct(string $name, ?string $default = null, bool $byReference = false, bool $isVariadic = false)
4343
{
4444
$this->name = $name;
4545
$this->default = $default;

src/phpDocumentor/Reflection/Php/Constant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ final class Constant implements Element
4949
* @param null|string $value
5050
* @param Location|null $location
5151
*/
52-
public function __construct(Fqsen $fqsen, DocBlock $docBlock = null, string $value = null, Location $location = null)
52+
public function __construct(Fqsen $fqsen, ?DocBlock $docBlock = null, ?string $value = null, ?Location $location = null)
5353
{
5454
$this->fqsen = $fqsen;
5555
$this->docBlock = $docBlock;

src/phpDocumentor/Reflection/Php/Factory/AbstractFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ abstract class AbstractFactory implements ProjectFactoryStrategy
1414
{
1515
abstract public function matches($object): bool;
1616

17-
final public function create($object, StrategyContainer $strategies, Context $context = null)
17+
final public function create($object, StrategyContainer $strategies, ?Context $context = null)
1818
{
1919
if (!$this->matches($object)) {
2020
throw new \InvalidArgumentException(
@@ -29,13 +29,13 @@ final public function create($object, StrategyContainer $strategies, Context $co
2929
return $this->doCreate($object, $strategies, $context);
3030
}
3131

32-
abstract protected function doCreate($object, StrategyContainer $strategies, Context $context = null);
32+
abstract protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null);
3333

3434
/**
3535
* @param Node|\PropertyIterator|\ClassConstantIterator|\Doc $stmt
3636
* @return Element
3737
*/
38-
protected function createMember($stmt, StrategyContainer $strategies, Context $context = null)
38+
protected function createMember($stmt, StrategyContainer $strategies, ?Context $context = null)
3939
{
4040
$strategy = $strategies->findMatching($stmt);
4141
return $strategy->create($stmt, $strategies, $context);
@@ -44,7 +44,7 @@ protected function createMember($stmt, StrategyContainer $strategies, Context $c
4444
/**
4545
* @return null|\phpDocumentor\Reflection\DocBlock
4646
*/
47-
protected function createDocBlock(StrategyContainer $strategies, Doc $docBlock = null, Context $context = null)
47+
protected function createDocBlock(StrategyContainer $strategies, ?Doc $docBlock = null, ?Context $context = null)
4848
{
4949
if ($docBlock === null) {
5050
return null;

src/phpDocumentor/Reflection/Php/Factory/Argument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function matches($object): bool
6363
* @param Context $context of the created object
6464
* @return ArgumentDescriptor
6565
*/
66-
protected function doCreate($object, StrategyContainer $strategies, Context $context = null)
66+
protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null)
6767
{
6868
$default = null;
6969
if ($object->default !== null) {

src/phpDocumentor/Reflection/Php/Factory/Class_.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function matches($object): bool
5555
* @param Context $context of the created object
5656
* @return ClassElement
5757
*/
58-
protected function doCreate($object, StrategyContainer $strategies, Context $context = null)
58+
protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null)
5959
{
6060
$docBlock = $this->createDocBlock($strategies, $object->getDocComment(), $context);
6161

src/phpDocumentor/Reflection/Php/Factory/Constant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function matches($object): bool
6262
* @param Context $context of the created object
6363
* @return ConstantElement
6464
*/
65-
protected function doCreate($object, StrategyContainer $strategies, Context $context = null)
65+
protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null)
6666
{
6767
$docBlock = $this->createDocBlock($strategies, $object->getDocComment(), $context);
6868
$default = null;

src/phpDocumentor/Reflection/Php/Factory/DocBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function matches($object): bool
6565
* @param Context $context of the created object
6666
* @return null|DocBlockDescriptor
6767
*/
68-
public function create($object, StrategyContainer $strategies, Context $context = null)
68+
public function create($object, StrategyContainer $strategies, ?Context $context = null)
6969
{
7070
if ($object === null) {
7171
return null;

src/phpDocumentor/Reflection/Php/Factory/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function matches($file): bool
8181
* @param StrategyContainer $strategies used to convert nested objects.
8282
* @return File
8383
*/
84-
protected function doCreate($object, StrategyContainer $strategies, Context $context = null)
84+
protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null)
8585
{
8686
$command = new CreateCommand($object, $strategies);
8787
$middlewareChain = $this->middlewareChain;

src/phpDocumentor/Reflection/Php/Factory/Function_.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function matches($object): bool
5252
* @param Context $context of the created object
5353
* @return FunctionDescriptor
5454
*/
55-
protected function doCreate($object, StrategyContainer $strategies, Context $context = null)
55+
protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null)
5656
{
5757
$docBlock = $this->createDocBlock($strategies, $object->getDocComment(), $context);
5858

0 commit comments

Comments
 (0)