Skip to content

Commit

Permalink
minor #54906 PHP 8.4 nullability deprecation (sam-bee)
Browse files Browse the repository at this point in the history
This PR was merged into the 7.1 branch.

Discussion
----------

PHP 8.4 nullability deprecation

### PHP 8.4 deprecation of implicit nullability.

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Because PHP 8.4 is adding deprecation warnings for non-nullable parameters with null default, change typehints.

This relates to the [implicit nullability RFC](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types) in PHP 8.4.

Commits
-------

8c3511b Because PHP 8.4 is adding deprecation warnings for non-nullable parameters with null default, change typehints
  • Loading branch information
derrabus committed May 14, 2024
2 parents a797985 + 8c3511b commit d8e1575
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Validator/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static function createCallable(Constraint|ValidatorInterface|null $constr
/**
* Creates a callable that returns true/false instead of throwing validation exceptions.
*
* @return callable(mixed $value, ConstraintViolationListInterface &$violations = null): bool
* @return callable(mixed $value, ?ConstraintViolationListInterface &$violations = null): bool
*/
public static function createIsValidCallable(Constraint|ValidatorInterface|null $constraintOrValidator = null, Constraint ...$constraints): callable
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Contracts/HttpClient/Test/TestHttpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TestHttpServer
/**
* @param string|null $workingDirectory
*/
public static function start(int $port = 8057/* , string $workingDirectory = null */): Process
public static function start(int $port = 8057/* , ?string $workingDirectory = null */): Process
{
$workingDirectory = \func_get_args()[1] ?? __DIR__.'/Fixtures/web';

Expand Down

0 comments on commit d8e1575

Please sign in to comment.