Skip to content

Commit

Permalink
Merge branch '5.4' into 6.3
Browse files Browse the repository at this point in the history
* 5.4:
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents a8a93f0 + abb0a15 commit ea6fe0e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Exception/ClassNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class ClassNotFoundException extends \Exception implements ExceptionInterface
{
public function __construct(string $class, \Throwable $previous = null)
public function __construct(string $class, ?\Throwable $previous = null)
{
parent::__construct(sprintf('Class "%s" not found.', $class), 0, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion Exception/NotInstantiableTypeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class NotInstantiableTypeException extends \Exception implements ExceptionInterface
{
public function __construct(string $type, \Throwable $previous = null)
public function __construct(string $type, ?\Throwable $previous = null)
{
parent::__construct(sprintf('Type "%s" is not instantiable.', $type), 0, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion LazyGhostTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ trait LazyGhostTrait
* that the initializer doesn't set when its a closure
* @param static|null $instance
*/
public static function createLazyGhost(\Closure|array $initializer, array $skippedProperties = null, object $instance = null): static
public static function createLazyGhost(\Closure|array $initializer, ?array $skippedProperties = null, ?object $instance = null): static
{
$onlyProperties = null === $skippedProperties && \is_array($initializer) ? $initializer : null;

Expand Down
2 changes: 1 addition & 1 deletion LazyProxyTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait LazyProxyTrait
* @param \Closure():object $initializer Returns the proxied object
* @param static|null $instance
*/
public static function createLazyProxy(\Closure $initializer, object $instance = null): static
public static function createLazyProxy(\Closure $initializer, ?object $instance = null): static
{
if (self::class !== $class = $instance ? $instance::class : static::class) {
$skippedProperties = ["\0".self::class."\0lazyObjectState" => true];
Expand Down
4 changes: 2 additions & 2 deletions ProxyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class_exists(\Symfony\Component\VarExporter\Internal\LazyObjectState::class);
EOPHP;
}

public static function exportSignature(\ReflectionFunctionAbstract $function, bool $withParameterTypes = true, string &$args = null): string
public static function exportSignature(\ReflectionFunctionAbstract $function, bool $withParameterTypes = true, ?string &$args = null): string
{
$byRefIndex = 0;
$args = '';
Expand Down Expand Up @@ -270,7 +270,7 @@ public static function exportSignature(\ReflectionFunctionAbstract $function, bo
return $signature;
}

public static function exportType(\ReflectionFunctionAbstract|\ReflectionProperty|\ReflectionParameter $owner, bool $noBuiltin = false, \ReflectionType $type = null): ?string
public static function exportType(\ReflectionFunctionAbstract|\ReflectionProperty|\ReflectionParameter $owner, bool $noBuiltin = false, ?\ReflectionType $type = null): ?string
{
if (!$type ??= $owner instanceof \ReflectionFunctionAbstract ? $owner->getReturnType() : $owner->getType()) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion Tests/LazyGhostTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function testReadOnlyClass()
*
* @return T
*/
private function createLazyGhost(string $class, \Closure|array $initializer, array $skippedProperties = null): object
private function createLazyGhost(string $class, \Closure|array $initializer, ?array $skippedProperties = null): object
{
$r = new \ReflectionClass($class);

Expand Down
2 changes: 1 addition & 1 deletion VarExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class VarExporter
*
* @throws ExceptionInterface When the provided value cannot be serialized
*/
public static function export(mixed $value, bool &$isStaticValue = null, array &$foundClasses = []): string
public static function export(mixed $value, ?bool &$isStaticValue = null, array &$foundClasses = []): string
{
$isStaticValue = true;

Expand Down

0 comments on commit ea6fe0e

Please sign in to comment.