diff --git a/.github/workflows/pull-request-check.yml b/.github/workflows/pull-request-check.yml index a1935ace9..6b739b842 100644 --- a/.github/workflows/pull-request-check.yml +++ b/.github/workflows/pull-request-check.yml @@ -29,3 +29,41 @@ jobs: - name: Running unit test run: vendor/bin/phpunit --configuration phpunit.xml + + php84-syntax-check: + name: PHP 8.4 syntax compatibility + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup PHP 8.4 + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + tools: composer + coverage: none + + - name: Cache Composer dependencies + uses: actions/cache@v3 + with: + path: /tmp/composer-cache + key: ${{ runner.os }}-${{ hashFiles('composer.lock') }} + + - name: Install dependencies + env: + COMPOSER_CACHE_DIR: /tmp/composer-cache + run: composer install --no-interaction --no-progress --prefer-dist + + - name: Run Rector dry-run on changed PHP files + run: | + CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- '*.php') + if [ -z "$CHANGED" ]; then + echo "No PHP files changed." + exit 0 + fi + echo "Changed PHP files:" + echo "$CHANGED" + vendor/bin/rector process --dry-run --no-progress-bar $CHANGED diff --git a/composer.json b/composer.json index a0807c5d1..a3307c3d1 100755 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "nesbot/carbon": "^2.71", "opis/closure": "~3.6", "pda/pheanstalk": "~4.0", - "predis/predis": "^1.1", + "predis/predis": "3.3", "symfony/browser-kit": "~6.4", "symfony/console": "~6.4", "symfony/css-selector": "~6.4", @@ -35,7 +35,7 @@ "symfony/routing": "~6.4", "symfony/security-core": "~6.4", "symfony/translation": "~6.4", - "voku/portable-ascii": "~1.5" + "voku/portable-ascii": "2.0.3" }, "replace": { "illuminate/auth": "self.version", diff --git a/rector.php b/rector.php index 763d98814..ac674c62a 100644 --- a/rector.php +++ b/rector.php @@ -4,6 +4,9 @@ use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector; use Rector\Config\RectorConfig; +use Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector; +use Rector\Php84\Rector\FuncCall\AddEscapeArgumentRector; +use Rector\ValueObject\PhpVersion; use Rector\Php83\Rector\BooleanAnd\JsonValidateRector; use Rector\Php83\Rector\Class_\ReadOnlyAnonymousClassRector; use Rector\Php83\Rector\ClassConst\AddTypeToConstRector; @@ -13,6 +16,7 @@ use Rector\Php83\Rector\FuncCall\RemoveGetClassGetParentClassNoArgsRector; return RectorConfig::configure() + ->withPhpVersion(PhpVersion::PHP_84) ->withPaths([ __DIR__ . '/src', __DIR__ . '/tests', @@ -25,5 +29,7 @@ AddTypeToConstRector::class, JsonValidateRector::class, ReadOnlyAnonymousClassRector::class, - AddOverrideAttributeToOverriddenMethodsRector::class + AddOverrideAttributeToOverriddenMethodsRector::class, + ExplicitNullableParamTypeRector::class, + AddEscapeArgumentRector::class ]); diff --git a/src/Illuminate/Auth/Guard.php b/src/Illuminate/Auth/Guard.php index c3b96d111..31515494d 100755 --- a/src/Illuminate/Auth/Guard.php +++ b/src/Illuminate/Auth/Guard.php @@ -89,7 +89,7 @@ class Guard { */ public function __construct(UserProviderInterface $provider, SessionStore $session, - Request $request = null) + ?Request $request = null) { $this->session = $session; $this->request = $request; @@ -269,7 +269,7 @@ public function validate(array $credentials = array()) * @param \Symfony\Component\HttpFoundation\Request $request * @return \Symfony\Component\HttpFoundation\Response|null */ - public function basic($field = 'email', Request $request = null) + public function basic($field = 'email', ?Request $request = null) { if ($this->check()) return; @@ -290,7 +290,7 @@ public function basic($field = 'email', Request $request = null) * @param \Symfony\Component\HttpFoundation\Request $request * @return \Symfony\Component\HttpFoundation\Response|null */ - public function onceBasic($field = 'email', Request $request = null) + public function onceBasic($field = 'email', ?Request $request = null) { $request = $request ?: $this->getRequest(); diff --git a/src/Illuminate/Auth/Reminders/PasswordBroker.php b/src/Illuminate/Auth/Reminders/PasswordBroker.php index 61597b25a..7c43e8efd 100755 --- a/src/Illuminate/Auth/Reminders/PasswordBroker.php +++ b/src/Illuminate/Auth/Reminders/PasswordBroker.php @@ -93,7 +93,7 @@ public function __construct(ReminderRepositoryInterface $reminders, * @param \Closure $callback * @return string */ - public function remind(array $credentials, Closure $callback = null): string + public function remind(array $credentials, ?Closure $callback = null): string { // First we will check to see if we found a user at the given credentials and // if we did not we will redirect back to this current URI with a piece of @@ -123,7 +123,7 @@ public function remind(array $credentials, Closure $callback = null): string * @param Closure $callback * @return void */ - public function sendReminder(RemindableInterface $user, string $token, Closure $callback = null): void + public function sendReminder(RemindableInterface $user, string $token, ?Closure $callback = null): void { // We will use the reminder view that was given to the broker to display the // password reminder e-mail. We'll pass a "token" variable into the views diff --git a/src/Illuminate/Console/Application.php b/src/Illuminate/Console/Application.php index df3235886..059a8c9c0 100755 --- a/src/Illuminate/Console/Application.php +++ b/src/Illuminate/Console/Application.php @@ -87,7 +87,7 @@ public function boot() * @param \Symfony\Component\Console\Output\OutputInterface $output * @return void */ - public function call($command, array $parameters = array(), OutputInterface $output = null) + public function call($command, array $parameters = array(), ?OutputInterface $output = null) { $parameters['command'] = $command; diff --git a/src/Illuminate/Console/ConfirmableTrait.php b/src/Illuminate/Console/ConfirmableTrait.php index 69a587ab8..4de0e8549 100644 --- a/src/Illuminate/Console/ConfirmableTrait.php +++ b/src/Illuminate/Console/ConfirmableTrait.php @@ -11,7 +11,7 @@ trait ConfirmableTrait { * @param \Closure $callback * @return bool */ - public function confirmToProceed($warning = 'Application In Production!', Closure $callback = null) + public function confirmToProceed($warning = 'Application In Production!', ?Closure $callback = null) { $shouldConfirm = $callback ?: $this->getDefaultConfirmCallback(); diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php index ebeff0803..b8627ac6b 100755 --- a/src/Illuminate/Container/Container.php +++ b/src/Illuminate/Container/Container.php @@ -126,7 +126,7 @@ public static function getInstance(): Container * * @param Container|null $container */ - public static function setInstance(Container $container = null): ?Container + public static function setInstance(?Container $container = null): ?Container { return static::$instance = $container; } @@ -1169,7 +1169,7 @@ protected function keyParametersByArgument(array $dependencies, array $parameter * @param \Closure|null $callback * @return void */ - public function beforeResolving($abstract, Closure $callback = null) + public function beforeResolving($abstract, ?Closure $callback = null) { if (is_string($abstract)) { $abstract = $this->getAlias($abstract); @@ -1189,7 +1189,7 @@ public function beforeResolving($abstract, Closure $callback = null) * @param \Closure $callback * @return void */ - public function resolving($abstract, Closure $callback = null): void + public function resolving($abstract, ?Closure $callback = null): void { if (is_string($abstract)) { $abstract = $this->getAlias($abstract); @@ -1212,7 +1212,7 @@ public function resolving($abstract, Closure $callback = null): void * @param \Closure|null $callback * @return void */ - public function afterResolving($abstract, Closure $callback = null) + public function afterResolving($abstract, ?Closure $callback = null) { if (is_string($abstract)) { $abstract = $this->getAlias($abstract); diff --git a/src/Illuminate/Database/Capsule/Manager.php b/src/Illuminate/Database/Capsule/Manager.php index 408e5630a..4ac654884 100755 --- a/src/Illuminate/Database/Capsule/Manager.php +++ b/src/Illuminate/Database/Capsule/Manager.php @@ -26,7 +26,7 @@ class Manager { * @param \Illuminate\Container\Container|null $container * @return void */ - public function __construct(Container $container = null) + public function __construct(?Container $container = null) { $this->setupContainer($container); diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index cf4252375..8f99e8e35 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -596,7 +596,7 @@ public function orWhere($column, $operator = null, $value = null) * @param \Closure|null $callback * @return \Illuminate\Database\Eloquent\Builder|static */ - public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) + public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null) { if (strpos($relation, '.') !== false) { @@ -652,7 +652,7 @@ protected function hasNested($relations, $operator = '>=', $count = 1, $boolean * @param \Closure|null $callback * @return \Illuminate\Database\Eloquent\Builder|static */ - public function doesntHave($relation, $boolean = 'and', Closure $callback = null) + public function doesntHave($relation, $boolean = 'and', ?Closure $callback = null) { return $this->has($relation, '<', 1, $boolean, $callback); } @@ -678,7 +678,7 @@ public function whereHas($relation, Closure $callback, $operator = '>=', $count * @param \Closure|null $callback * @return \Illuminate\Database\Eloquent\Builder|static */ - public function whereDoesntHave($relation, Closure $callback = null) + public function whereDoesntHave($relation, ?Closure $callback = null) { return $this->doesntHave($relation, 'and', $callback); } diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 8718ea4ef..da9551a1b 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -2670,7 +2670,7 @@ protected function getDateFormat():string * @param array $except * @return Model */ - public function replicate(array $except = null):Model + public function replicate(?array $except = null):Model { $except = $except ?: [ $this->getKeyName(), diff --git a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php b/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php index ddf119065..b708ed32a 100644 --- a/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php +++ b/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php @@ -91,7 +91,7 @@ public function getRelationCountQuery(Builder $query, Builder $parent) * @param \Illuminate\Database\Eloquent\Builder|null $query * @return void */ - protected function setJoin(Builder $query = null) + protected function setJoin(?Builder $query = null) { $query = $query ?: $this->query; diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 67f5a340c..c8702e174 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -42,7 +42,7 @@ class Blueprint { * @param \Closure $callback * @return void */ - public function __construct($table, Closure $callback = null) + public function __construct($table, ?Closure $callback = null) { $this->table = $table; diff --git a/src/Illuminate/Database/Schema/Builder.php b/src/Illuminate/Database/Schema/Builder.php index 707909b3d..2da428216 100755 --- a/src/Illuminate/Database/Schema/Builder.php +++ b/src/Illuminate/Database/Schema/Builder.php @@ -176,7 +176,7 @@ protected function build(Blueprint $blueprint) * @param \Closure $callback * @return \Illuminate\Database\Schema\Blueprint */ - protected function createBlueprint($table, Closure $callback = null) + protected function createBlueprint($table, ?Closure $callback = null) { if (isset($this->resolver)) { diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index 4fe001d75..6ff5ae2be 100755 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -46,7 +46,7 @@ class Dispatcher { * @param \Illuminate\Container\Container $container * @return void */ - public function __construct(Container $container = null) + public function __construct(?Container $container = null) { $this->container = $container ?: new Container; } diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 73a724031..55e3790bb 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -108,7 +108,7 @@ class Application extends Container implements HttpKernelInterface, TerminableIn * @param \Illuminate\Http\Request $request * @return void */ - public function __construct(Request $request = null) + public function __construct(?Request $request = null) { $this->registerBaseBindings($request ?: $this->createNewRequest()); @@ -550,7 +550,7 @@ public function finish($callback) * @param callable $callback * @return void */ - public function shutdown(callable $callback = null) + public function shutdown(?callable $callback = null) { if (is_null($callback)) { @@ -647,7 +647,7 @@ public function booted($callback) * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ - public function run(SymfonyRequest $request = null) + public function run(?SymfonyRequest $request = null) { $request = $request ?: $this['request']; diff --git a/src/Illuminate/Html/HtmlBuilder.php b/src/Illuminate/Html/HtmlBuilder.php index fdab72475..9428bc0e0 100755 --- a/src/Illuminate/Html/HtmlBuilder.php +++ b/src/Illuminate/Html/HtmlBuilder.php @@ -20,7 +20,7 @@ class HtmlBuilder { * @param \Illuminate\Routing\UrlGenerator $url * @return void */ - public function __construct(UrlGenerator $url = null) + public function __construct(?UrlGenerator $url = null) { $this->url = $url; } diff --git a/src/Illuminate/Http/RedirectResponse.php b/src/Illuminate/Http/RedirectResponse.php index 56debbf56..a0cf8038b 100755 --- a/src/Illuminate/Http/RedirectResponse.php +++ b/src/Illuminate/Http/RedirectResponse.php @@ -92,7 +92,7 @@ public function withCookies(array $cookies) * @param array $input * @return $this */ - public function withInput(array $input = null) + public function withInput(?array $input = null) { $input = $input ?: $this->request->input(); diff --git a/src/Illuminate/Log/Writer.php b/src/Illuminate/Log/Writer.php index 4767ef645..99d305806 100755 --- a/src/Illuminate/Log/Writer.php +++ b/src/Illuminate/Log/Writer.php @@ -49,7 +49,7 @@ class Writer { * @param \Illuminate\Events\Dispatcher $dispatcher * @return void */ - public function __construct(MonologLogger $monolog, Dispatcher $dispatcher = null) + public function __construct(MonologLogger $monolog, ?Dispatcher $dispatcher = null) { $this->monolog = $monolog; diff --git a/src/Illuminate/Mail/Transport/ArrayTransport.php b/src/Illuminate/Mail/Transport/ArrayTransport.php index 9b0ccfcef..17b23d9ff 100644 --- a/src/Illuminate/Mail/Transport/ArrayTransport.php +++ b/src/Illuminate/Mail/Transport/ArrayTransport.php @@ -30,7 +30,7 @@ public function __construct() /** * {@inheritdoc} */ - public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage + public function send(RawMessage $message, ?Envelope $envelope = null): ?SentMessage { return $this->messages[] = new SentMessage($message, $envelope ?? Envelope::create($message)); } diff --git a/src/Illuminate/Queue/Capsule/Manager.php b/src/Illuminate/Queue/Capsule/Manager.php index a182ede5e..de6c743c4 100644 --- a/src/Illuminate/Queue/Capsule/Manager.php +++ b/src/Illuminate/Queue/Capsule/Manager.php @@ -22,7 +22,7 @@ class Manager { * @param \Illuminate\Container\Container $container * @return void */ - public function __construct(Container $container = null) + public function __construct(?Container $container = null) { $this->setupContainer($container); diff --git a/src/Illuminate/Queue/IronQueue.php b/src/Illuminate/Queue/IronQueue.php index bbcf056c1..040bd114b 100755 --- a/src/Illuminate/Queue/IronQueue.php +++ b/src/Illuminate/Queue/IronQueue.php @@ -88,7 +88,7 @@ public function pushRaw($payload, $queue = null, array $options = array()) * @param int $delay * @return mixed */ - public function recreate($payload, $queue = null, $delay) + public function recreate($payload, $queue = null, $delay = 0) { $options = array('delay' => $this->getSeconds($delay)); diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index ecdbdd1ec..a60ef6934 100755 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -51,8 +51,8 @@ class Worker { * @return void */ public function __construct(QueueManager $manager, - FailedJobProviderInterface $failer = null, - Dispatcher $events = null) + ?FailedJobProviderInterface $failer = null, + ?Dispatcher $events = null) { $this->failer = $failer; $this->events = $events; diff --git a/src/Illuminate/Routing/ControllerDispatcher.php b/src/Illuminate/Routing/ControllerDispatcher.php index c8c08a792..bd9736fb5 100644 --- a/src/Illuminate/Routing/ControllerDispatcher.php +++ b/src/Illuminate/Routing/ControllerDispatcher.php @@ -28,7 +28,7 @@ class ControllerDispatcher { * @return void */ public function __construct(RouteFiltererInterface $filterer, - Container $container = null) + ?Container $container = null) { $this->filterer = $filterer; $this->container = $container; diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index 06a1595b4..96881aa63 100755 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -118,7 +118,7 @@ class Router implements HttpKernelInterface, RouteFiltererInterface { * * @return void */ - public function __construct(Dispatcher $events, Container $container = null) + public function __construct(Dispatcher $events, ?Container $container = null) { $this->events = $events; $this->routes = new RouteCollection; @@ -1241,7 +1241,7 @@ public function whenRegex($pattern, $name, $methods = null) * * @throws NotFoundHttpException */ - public function model($key, $class, Closure $callback = null) + public function model($key, $class, ?Closure $callback = null) { $this->bind($key, function($value) use ($class, $callback) { diff --git a/src/Illuminate/Session/Middleware.php b/src/Illuminate/Session/Middleware.php index 7bad30c04..e99937459 100644 --- a/src/Illuminate/Session/Middleware.php +++ b/src/Illuminate/Session/Middleware.php @@ -38,7 +38,7 @@ class Middleware implements HttpKernelInterface { * @param \Closure|null $reject * @return void */ - public function __construct(HttpKernelInterface $app, SessionManager $manager, Closure $reject = null) + public function __construct(HttpKernelInterface $app, SessionManager $manager, ?Closure $reject = null) { $this->app = $app; $this->reject = $reject; @@ -238,7 +238,7 @@ protected function sessionConfigured() * @param array|null $config * @return bool */ - protected function sessionIsPersistent(array $config = null) + protected function sessionIsPersistent(?array $config = null) { // Some session drivers are not persistent, such as the test array driver or even // when the developer don't have a session driver configured at all, which the diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index 94bd57c95..d3a4e4964 100755 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -142,7 +142,7 @@ public function filter(Closure $callback) * @param mixed $default * @return mixed|null */ - public function first(Closure $callback = null, $default = null) + public function first(?Closure $callback = null, $default = null) { if (is_null($callback)) { diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index a4236186d..1a5f63123 100755 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -67,7 +67,7 @@ public static function camel(string $value): string * * @return bool */ - public static function contains(?string $haystack = null, array|string $needles = null): bool + public static function contains(?string $haystack = null, array|string|null $needles = null): bool { if (empty($haystack) || empty($needles)) { return false; diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 0a3955592..953e20085 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -893,7 +893,7 @@ function str_random($length = 16) * @param string $subject * @return string */ - function str_replace_array($search, array $replace = null, string $subject = '') + function str_replace_array($search, ?array $replace = null, string $subject = '') { if (empty($replace)) { return $subject; diff --git a/src/Illuminate/Validation/Factory.php b/src/Illuminate/Validation/Factory.php index fbcd62557..007b8ff6c 100755 --- a/src/Illuminate/Validation/Factory.php +++ b/src/Illuminate/Validation/Factory.php @@ -69,7 +69,7 @@ class Factory { * @param \Illuminate\Container\Container $container * @return void */ - public function __construct(TranslatorInterface $translator, Container $container = null) + public function __construct(TranslatorInterface $translator, ?Container $container = null) { $this->container = $container; $this->translator = $translator; diff --git a/src/Illuminate/Validation/Validator.php b/src/Illuminate/Validation/Validator.php index bf5d6c9a8..e5a48cedc 100755 --- a/src/Illuminate/Validation/Validator.php +++ b/src/Illuminate/Validation/Validator.php @@ -2082,7 +2082,7 @@ protected function parseParameters($rule, $parameter) { if (strtolower($rule) == 'regex') return array($parameter); - return str_getcsv($parameter); + return str_getcsv($parameter, escape: '\\'); } /** diff --git a/src/Illuminate/View/FileViewFinder.php b/src/Illuminate/View/FileViewFinder.php index 4effca2a7..47d0f082b 100755 --- a/src/Illuminate/View/FileViewFinder.php +++ b/src/Illuminate/View/FileViewFinder.php @@ -54,7 +54,7 @@ class FileViewFinder implements ViewFinderInterface { * @param array $extensions * @return void */ - public function __construct(Filesystem $files, array $paths, array $extensions = null) + public function __construct(Filesystem $files, array $paths, ?array $extensions = null) { $this->files = $files; $this->paths = $paths; diff --git a/src/Illuminate/View/View.php b/src/Illuminate/View/View.php index d23b94e58..278fd9d7f 100755 --- a/src/Illuminate/View/View.php +++ b/src/Illuminate/View/View.php @@ -72,7 +72,7 @@ public function __construct(Factory $factory, EngineInterface $engine, $view, $p * @param \Closure $callback * @return string */ - public function render(Closure $callback = null) + public function render(?Closure $callback = null) { try { $contents = $this->renderContents(); diff --git a/src/Illuminate/Workbench/Starter.php b/src/Illuminate/Workbench/Starter.php index b90c3686d..249e66043 100755 --- a/src/Illuminate/Workbench/Starter.php +++ b/src/Illuminate/Workbench/Starter.php @@ -13,7 +13,7 @@ class Starter { * @param \Illuminate\Filesystem\Filesystem $files * @return void */ - public static function start($path, Finder $finder = null, Filesystem $files = null) + public static function start($path, ?Finder $finder = null, ?Filesystem $files = null) { $finder = $finder ?: new Finder; diff --git a/tests/Container/ContainerContextualBindingTest.php b/tests/Container/ContainerContextualBindingTest.php index 9446d692d..bba576471 100644 --- a/tests/Container/ContainerContextualBindingTest.php +++ b/tests/Container/ContainerContextualBindingTest.php @@ -572,7 +572,7 @@ class ContainerTestContextWithOptionalInnerDependency { public $inner; - public function __construct(ContainerTestContextInjectOne $inner = null) + public function __construct(?ContainerTestContextInjectOne $inner = null) { $this->inner = $inner; } diff --git a/tests/Container/ContainerResolveNonInstantiableTest.php b/tests/Container/ContainerResolveNonInstantiableTest.php index 35473468a..2dae6b206 100644 --- a/tests/Container/ContainerResolveNonInstantiableTest.php +++ b/tests/Container/ContainerResolveNonInstantiableTest.php @@ -36,7 +36,7 @@ class ParentClass */ public $i; - public function __construct(TestInterface $testObject = null, int $i = 0) + public function __construct(?TestInterface $testObject = null, int $i = 0) { $this->i = $i; }