Skip to content

Commit 819948c

Browse files
committed
Removed optionality from constructor parameters
1 parent b7489e8 commit 819948c

13 files changed

Lines changed: 18 additions & 10 deletions

src/Reflection/AllowedConstantsResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class AllowedConstantsResult
2121
public function __construct(
2222
private array $disallowedConstants,
2323
private array $violatedExclusiveGroups,
24-
private bool $bitmaskNotAllowed = false,
24+
private bool $bitmaskNotAllowed,
2525
)
2626
{
2727
}

src/Reflection/Annotations/AnnotationsMethodParameterReflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getAllowedConstants(): ?ParameterAllowedConstants
8989

9090
public function checkAllowedConstants(array $constants): AllowedConstantsResult
9191
{
92-
return new AllowedConstantsResult([], []);
92+
return new AllowedConstantsResult([], [], false);
9393
}
9494

9595
}

src/Reflection/GenericParametersAcceptorResolver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public static function resolve(array $argTypes, ParametersAcceptor $parametersAc
105105
TrinaryLogic::createMaybe(),
106106
null,
107107
[],
108+
null,
108109
), $parameters),
109110
$parametersAcceptor->isVariadic(),
110111
$returnType,

src/Reflection/Native/ExtendedNativeParameterReflection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(
3030
private TrinaryLogic $immediatelyInvokedCallable,
3131
private ?Type $closureThisType,
3232
private array $attributes,
33-
private ?ParameterAllowedConstants $allowedConstants = null,
33+
private ?ParameterAllowedConstants $allowedConstants,
3434
)
3535
{
3636
}
@@ -108,7 +108,7 @@ public function getAllowedConstants(): ?ParameterAllowedConstants
108108
public function checkAllowedConstants(array $constants): AllowedConstantsResult
109109
{
110110
if ($this->allowedConstants === null) {
111-
return new AllowedConstantsResult([], []);
111+
return new AllowedConstantsResult([], [], false);
112112
}
113113

114114
return $this->allowedConstants->check($constants);

src/Reflection/ParameterAllowedConstants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class ParameterAllowedConstants
2929
public function __construct(
3030
private string $type,
3131
private array $constants,
32-
private array $exclusiveGroups = [],
32+
private array $exclusiveGroups,
3333
)
3434
{
3535
}

src/Reflection/ParametersAcceptorSelector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ public static function combineAcceptors(array $acceptors): ExtendedParametersAcc
831831
$immediatelyInvokedCallable,
832832
$closureThisType,
833833
$attributes,
834+
null,
834835
);
835836

836837
if ($isVariadic) {
@@ -929,6 +930,7 @@ private static function wrapParameter(ParameterReflection $parameter): ExtendedP
929930
TrinaryLogic::createMaybe(),
930931
null,
931932
[],
933+
null,
932934
);
933935
}
934936

src/Reflection/Php/ClosureCallMethodReflection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function getVariants(): array
9898
TrinaryLogic::createMaybe(),
9999
null,
100100
[],
101+
null,
101102
), $parameters),
102103
$this->closureType->isVariadic(),
103104
$this->closureType->getReturnType(),

src/Reflection/Php/ExitFunctionReflection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function getVariants(): array
5959
TrinaryLogic::createNo(),
6060
null,
6161
[],
62+
null,
6263
),
6364
],
6465
false,

src/Reflection/Php/ExtendedDummyParameter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(
3030
private TrinaryLogic $immediatelyInvokedCallable,
3131
private ?Type $closureThisType,
3232
private array $attributes,
33-
private ?ParameterAllowedConstants $allowedConstants = null,
33+
private ?ParameterAllowedConstants $allowedConstants,
3434
)
3535
{
3636
parent::__construct($name, $type, $optional, $passedByReference, $variadic, $defaultValue);
@@ -79,7 +79,7 @@ public function getAllowedConstants(): ?ParameterAllowedConstants
7979
public function checkAllowedConstants(array $constants): AllowedConstantsResult
8080
{
8181
if ($this->allowedConstants === null) {
82-
return new AllowedConstantsResult([], []);
82+
return new AllowedConstantsResult([], [], false);
8383
}
8484

8585
return $this->allowedConstants->check($constants);

src/Reflection/Php/PhpParameterFromParserNodeReflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getAllowedConstants(): ?ParameterAllowedConstants
122122

123123
public function checkAllowedConstants(array $constants): AllowedConstantsResult
124124
{
125-
return new AllowedConstantsResult([], []);
125+
return new AllowedConstantsResult([], [], false);
126126
}
127127

128128
}

0 commit comments

Comments
 (0)