Skip to content

Commit 4e3c7ac

Browse files
committed
run rector & phpstan
1 parent 83247f8 commit 4e3c7ac

18 files changed

+59
-42
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ includes:
22
- utils/phpstan-baseline/loader.neon
33

44
parameters:
5-
phpVersion: 80100
5+
phpVersion: 80200
66
tmpDir: build/phpstan
77
level: 6
88
bootstrapFiles:

system/API/ResponseTrait.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
*
2727
* @property CLIRequest|IncomingRequest $request
2828
* @property ResponseInterface $response
29-
* @property bool $stringAsHtml Whether to treat string data as HTML in JSON response.
30-
* Setting `true` is only for backward compatibility.
3129
*/
3230
trait ResponseTrait
3331
{
@@ -84,6 +82,12 @@ trait ResponseTrait
8482
*/
8583
protected $formatter;
8684

85+
/**
86+
* Whether to treat string data as HTML in JSON response.
87+
* Setting `true` is only for backward compatibility.
88+
*/
89+
protected bool $stringAsHtml = false;
90+
8791
/**
8892
* Provides a single, simple method to return an API response, formatted
8993
* to match the requested format, with proper content-type and status code.

system/Cache/FactoriesCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
use CodeIgniter\Cache\FactoriesCache\FileVarExportHandler;
1717
use CodeIgniter\Config\Factories;
1818

19-
final class FactoriesCache
19+
final readonly class FactoriesCache
2020
{
21-
private readonly CacheInterface|FileVarExportHandler $cache;
21+
private CacheInterface|FileVarExportHandler $cache;
2222

2323
public function __construct(CacheInterface|FileVarExportHandler|null $cache = null)
2424
{

system/Commands/Utilities/Routes/AutoRouteCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*
1919
* @see \CodeIgniter\Commands\Utilities\Routes\AutoRouteCollectorTest
2020
*/
21-
final class AutoRouteCollector
21+
final readonly class AutoRouteCollector
2222
{
2323
/**
2424
* @param string $namespace namespace to search
2525
*/
26-
public function __construct(private readonly string $namespace, private readonly string $defaultController, private readonly string $defaultMethod)
26+
public function __construct(private string $namespace, private string $defaultController, private string $defaultMethod)
2727
{
2828
}
2929

system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @see \CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\AutoRouteCollectorTest
2323
*/
24-
final class AutoRouteCollector
24+
final readonly class AutoRouteCollector
2525
{
2626
/**
2727
* @param string $namespace namespace to search
@@ -31,12 +31,12 @@ final class AutoRouteCollector
3131
* @param string $prefix URI prefix for Module Routing
3232
*/
3333
public function __construct(
34-
private readonly string $namespace,
35-
private readonly string $defaultController,
36-
private readonly string $defaultMethod,
37-
private readonly array $httpMethods,
38-
private readonly array $protectedControllers,
39-
private readonly string $prefix = '',
34+
private string $namespace,
35+
private string $defaultController,
36+
private string $defaultMethod,
37+
private array $httpMethods,
38+
private array $protectedControllers,
39+
private string $prefix = '',
4040
) {
4141
}
4242

system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
*
2323
* @see \CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\ControllerMethodReaderTest
2424
*/
25-
final class ControllerMethodReader
25+
final readonly class ControllerMethodReader
2626
{
27-
private readonly bool $translateURIDashes;
28-
private readonly bool $translateUriToCamelCase;
27+
private bool $translateURIDashes;
28+
private bool $translateUriToCamelCase;
2929

3030
/**
3131
* @param string $namespace the default namespace
3232
* @param list<string> $httpMethods
3333
*/
3434
public function __construct(
35-
private readonly string $namespace,
36-
private readonly array $httpMethods,
35+
private string $namespace,
36+
private array $httpMethods,
3737
) {
3838
$config = config(Routing::class);
3939
$this->translateURIDashes = $config->translateURIDashes;

system/Commands/Utilities/Routes/ControllerFinder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
*
2121
* @see \CodeIgniter\Commands\Utilities\Routes\ControllerFinderTest
2222
*/
23-
final class ControllerFinder
23+
final readonly class ControllerFinder
2424
{
25-
private readonly FileLocatorInterface $locator;
25+
private FileLocatorInterface $locator;
2626

2727
/**
2828
* @param string $namespace namespace to search
2929
*/
3030
public function __construct(
31-
private readonly string $namespace,
31+
private string $namespace,
3232
) {
3333
$this->locator = service('locator');
3434
}

system/Commands/Utilities/Routes/ControllerMethodReader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
*
2222
* @see \CodeIgniter\Commands\Utilities\Routes\ControllerMethodReaderTest
2323
*/
24-
final class ControllerMethodReader
24+
final readonly class ControllerMethodReader
2525
{
2626
/**
2727
* @param string $namespace the default namespace
2828
*/
29-
public function __construct(private readonly string $namespace)
29+
public function __construct(private string $namespace)
3030
{
3131
}
3232

system/Commands/Utilities/Routes/FilterCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
*
2525
* @see \CodeIgniter\Commands\Utilities\Routes\FilterCollectorTest
2626
*/
27-
final class FilterCollector
27+
final readonly class FilterCollector
2828
{
2929
public function __construct(
3030
/**
3131
* Whether to reset Defined Routes.
3232
*
3333
* If set to true, route filters are not found.
3434
*/
35-
private readonly bool $resetRoutes = false,
35+
private bool $resetRoutes = false,
3636
) {
3737
}
3838

system/Commands/Utilities/Routes/FilterFinder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
*
2626
* @see \CodeIgniter\Commands\Utilities\Routes\FilterFinderTest
2727
*/
28-
final class FilterFinder
28+
final readonly class FilterFinder
2929
{
30-
private readonly Router $router;
31-
private readonly Filters $filters;
30+
private Router $router;
31+
private Filters $filters;
3232

3333
public function __construct(?Router $router = null, ?Filters $filters = null)
3434
{

0 commit comments

Comments
 (0)