Skip to content

Commit ecf9bc5

Browse files
authored
[PHP8.4] Deprecate implicitly nullable parameter types (#125)
* nullable_type_declaration_for_default_null_value * no_unused_imports
1 parent 1973471 commit ecf9bc5

8 files changed

+13
-21
lines changed

Tests/Controller/ContainerControllerResolverTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
namespace Joomla\Application\Tests\Controller;
99

1010
use Joomla\Application\Controller\ContainerControllerResolver;
11-
use Joomla\Application\Controller\ControllerResolver;
12-
use Joomla\Application\Event\ApplicationEvent;
1311
use Joomla\Application\Tests\Stubs\Controller;
1412
use Joomla\Application\Tests\Stubs\HasArgumentsController;
1513
use Joomla\DI\Container;
16-
use Joomla\Registry\Registry;
1714
use Joomla\Router\ResolvedRoute;
1815
use PHPUnit\Framework\TestCase;
1916

Tests/Controller/ControllerResolverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Joomla\Application\Tests\Controller;
99

1010
use Joomla\Application\Controller\ControllerResolver;
11-
use Joomla\Application\Event\ApplicationEvent;
1211
use Joomla\Application\Tests\Stubs\Controller;
1312
use Joomla\Application\Tests\Stubs\HasArgumentsController;
1413
use Joomla\Registry\Registry;

Tests/SessionAwareWebApplicationTraitTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Joomla\Application\Tests;
99

1010
use Joomla\Application\SessionAwareWebApplicationTrait;
11-
use Joomla\Application\WebApplication;
1211
use Joomla\Input\Input;
1312
use Joomla\Session\SessionInterface;
1413
use PHPUnit\Framework\TestCase;

Tests/Web/WebClientTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace Joomla\Application\Tests\Web;
99

10-
use Joomla\Application\Tests\CompatTestCase;
1110
use Joomla\Application\Web\WebClient;
1211
use PHPUnit\Framework\TestCase;
1312

rector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
declare(strict_types=1);
44

5-
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
65
use Rector\Config\RectorConfig;
76
use Rector\Php71\Rector\ClassConst\PublicConstantVisibilityRector;
8-
use Rector\Set\ValueObject\LevelSetList;
97

108
return static function (RectorConfig $rectorConfig): void {
119
$rectorConfig->paths([

src/AbstractApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ abstract class AbstractApplication implements
5151
*
5252
* @since 1.0.0
5353
*/
54-
public function __construct(Registry $config = null)
54+
public function __construct(?Registry $config = null)
5555
{
5656
$this->config = $config ?: new Registry();
5757

src/AbstractWebApplication.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ abstract class AbstractWebApplication extends AbstractApplication implements Web
191191
* @since 1.0.0
192192
*/
193193
public function __construct(
194-
Input $input = null,
195-
Registry $config = null,
196-
WebClient $client = null,
197-
ResponseInterface $response = null
194+
?Input $input = null,
195+
?Registry $config = null,
196+
?WebClient $client = null,
197+
?ResponseInterface $response = null
198198
) {
199199
$this->input = $input ?: new Input();
200200
$this->client = $client ?: new WebClient();

src/WebApplication.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@ class WebApplication extends AbstractWebApplication implements SessionAwareWebAp
4646
*
4747
* @param ControllerResolverInterface $controllerResolver The application's controller resolver
4848
* @param RouterInterface $router The application's router
49-
* @param Input ?$input An optional argument to provide dependency injection
49+
* @param Input|null $input An optional argument to provide dependency injection
5050
* for the application's input object. If the argument
5151
* is an Input object that object will become the
5252
* application's input object, otherwise a default input
5353
* object is created.
54-
* @param Registry ?$config An optional argument to provide dependency injection
54+
* @param Registry|null $config An optional argument to provide dependency injection
5555
* for the application's config object. If the argument
5656
* is a Registry object that object will become the
5757
* application's config object, otherwise a default
5858
* config object is created.
59-
* @param Web\WebClient ?$client An optional argument to provide dependency injection
59+
* @param WebClient|null $client An optional argument to provide dependency injection
6060
* for the application's client object. If the argument
6161
* is a Web\WebClient object that object will become the
6262
* application's client object, otherwise a default
6363
* client object is created.
64-
* @param ResponseInterface ?$response An optional argument to provide dependency injection
64+
* @param ResponseInterface|null $response An optional argument to provide dependency injection
6565
* for the application's response object. If the
6666
* argument is a ResponseInterface object that object
6767
* will become the application's response object,
@@ -72,10 +72,10 @@ class WebApplication extends AbstractWebApplication implements SessionAwareWebAp
7272
public function __construct(
7373
ControllerResolverInterface $controllerResolver,
7474
RouterInterface $router,
75-
Input $input = null,
76-
Registry $config = null,
77-
WebClient $client = null,
78-
ResponseInterface $response = null
75+
?Input $input = null,
76+
?Registry $config = null,
77+
?WebClient $client = null,
78+
?ResponseInterface $response = null
7979
) {
8080
$this->controllerResolver = $controllerResolver;
8181
$this->router = $router;

0 commit comments

Comments
 (0)