From 63b146e840998a5cd6d3f8afa5f35ba2adf4387b Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Sun, 12 Apr 2026 19:35:12 +0800 Subject: [PATCH] chore: fixes for php-cs-fixer and psalm --- app/Config/Routes.php | 4 +- app/Config/View.php | 10 +-- psalm-baseline.xml | 72 +------------------ system/Autoloader/Autoloader.php | 4 +- system/CLI/GeneratorTrait.php | 4 +- system/Cache/Handlers/PredisHandler.php | 7 +- system/Cache/Handlers/RedisHandler.php | 7 +- .../Commands/Translation/LocalizationSync.php | 4 +- system/Config/View.php | 24 ++----- system/Cookie/CookieStore.php | 4 +- system/DataCaster/Cast/DatetimeCast.php | 4 +- system/Database/BaseBuilder.php | 4 +- system/Database/BaseConnection.php | 4 +- system/Debug/Toolbar.php | 4 +- system/Helpers/filesystem_helper.php | 4 +- system/Helpers/kint_helper.php | 6 +- system/Pager/Pager.php | 4 +- system/View/Parser.php | 6 +- tests/_support/Config/Filters.php | 4 +- .../Commands/Utilities/ConfigCheckTest.php | 8 +-- .../ControllerMethodReaderTest.php | 3 +- .../Utilities/Routes/FilterCollectorTest.php | 6 +- .../Utilities/Routes/FilterFinderTest.php | 28 ++------ tests/system/Debug/ExceptionHandlerTest.php | 9 +-- tests/system/Debug/ExceptionsTest.php | 9 +-- tests/system/Filters/FiltersTest.php | 3 +- tests/system/Helpers/FormHelperTest.php | 3 +- .../system/Publisher/PublisherOutputTest.php | 4 +- .../SecurityCSRFSessionRandomizeTokenTest.php | 8 +-- .../Security/SecurityCSRFSessionTest.php | 8 +-- tests/system/Validation/RulesTest.php | 6 +- .../guides/first-app/static_pages/003.php | 4 +- .../installation/upgrade_routing/001.php | 4 +- 33 files changed, 59 insertions(+), 224 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index fc4914a6923b..4cf109ed3dd4 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -2,7 +2,5 @@ use CodeIgniter\Router\RouteCollection; -/** - * @var RouteCollection $routes - */ +/** @var RouteCollection $routes */ $routes->get('/', 'Home::index'); diff --git a/app/Config/View.php b/app/Config/View.php index 582ef73276b1..869df3cbce90 100644 --- a/app/Config/View.php +++ b/app/Config/View.php @@ -5,10 +5,6 @@ use CodeIgniter\Config\View as BaseView; use CodeIgniter\View\ViewDecoratorInterface; -/** - * @phpstan-type parser_callable (callable(mixed): mixed) - * @phpstan-type parser_callable_string (callable(mixed): mixed)&string - */ class View extends BaseView { /** @@ -34,8 +30,7 @@ class View extends BaseView * { title|esc(js) } * { created_on|date(Y-m-d)|esc(attr) } * - * @var array - * @phpstan-var array + * @var array */ public $filters = []; @@ -44,8 +39,7 @@ class View extends BaseView * by the core Parser by creating aliases that will be replaced with * any callable. Can be single or tag pair. * - * @var array|string> - * @phpstan-var array|parser_callable_string|parser_callable> + * @var array> */ public $plugins = []; diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 7a03f82c5e21..7285cab94899 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,22 +1,5 @@ - - - - |parser_callable_string|parser_callable>]]> - |parser_callable_string|parser_callable>]]> - ]]> - - - - - - - - |parser_callable_string|parser_callable>]]> - |parser_callable_string|parser_callable>]]> - ]]> - - + @@ -73,14 +56,6 @@ - - - |parser_callable_string|parser_callable>]]> - |parser_callable_string|parser_callable>]]> - - - - @@ -136,51 +111,6 @@ - - - country]]> - created_at]]> - deleted]]> - email]]> - name]]> - country]]> - created_at]]> - deleted]]> - email]]> - name]]> - - - - - country]]> - created_at]]> - created_at]]> - deleted]]> - email]]> - name]]> - name]]> - name]]> - name]]> - - - - - country]]> - deleted]]> - email]]> - id]]> - name]]> - country]]> - country]]> - deleted]]> - id]]> - name]]> - country]]> - deleted]]> - id]]> - name]]> - - diff --git a/system/Autoloader/Autoloader.php b/system/Autoloader/Autoloader.php index 29d119727f94..4666149f27e9 100644 --- a/system/Autoloader/Autoloader.php +++ b/system/Autoloader/Autoloader.php @@ -480,9 +480,7 @@ protected function discoverComposerNamespaces() return; } - /** - * @var ClassLoader $composer - */ + /** @var ClassLoader $composer */ $composer = include $this->composerPath; $paths = $composer->getPrefixesPsr4(); $classes = $composer->getClassMap(); diff --git a/system/CLI/GeneratorTrait.php b/system/CLI/GeneratorTrait.php index 62f5ceec09ae..7d66b8b290af 100644 --- a/system/CLI/GeneratorTrait.php +++ b/system/CLI/GeneratorTrait.php @@ -303,9 +303,7 @@ private function normalizeInputClassName(): string $component = singular($this->component); - /** - * @see https://regex101.com/r/a5KNCR/2 - */ + /** @see https://regex101.com/r/a5KNCR/2 */ $pattern = sprintf('/([a-z][a-z0-9_\/\\\\]+)(%s)$/i', $component); if (preg_match($pattern, $class, $matches) === 1) { diff --git a/system/Cache/Handlers/PredisHandler.php b/system/Cache/Handlers/PredisHandler.php index b1dfb0e18bfd..c868f34550e9 100644 --- a/system/Cache/Handlers/PredisHandler.php +++ b/system/Cache/Handlers/PredisHandler.php @@ -92,10 +92,9 @@ public function get(string $key): mixed } return match ($data['__ci_type']) { - 'array', 'object' => unserialize($data['__ci_value']), - // Yes, 'double' is returned and NOT 'float' + 'array', 'object' => unserialize($data['__ci_value']), 'boolean', 'integer', 'double', 'string', 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, - default => null, + default => null, }; } @@ -111,7 +110,7 @@ public function save(string $key, mixed $value, int $ttl = 60): bool case 'boolean': case 'integer': - case 'double': // Yes, 'double' is returned and NOT 'float' + case 'double': case 'string': case 'NULL': break; diff --git a/system/Cache/Handlers/RedisHandler.php b/system/Cache/Handlers/RedisHandler.php index 7ab6e392bfbc..05cae32da440 100644 --- a/system/Cache/Handlers/RedisHandler.php +++ b/system/Cache/Handlers/RedisHandler.php @@ -108,10 +108,9 @@ public function get(string $key): mixed } return match ($data['__ci_type']) { - 'array', 'object' => unserialize($data['__ci_value']), - // Yes, 'double' is returned and NOT 'float' + 'array', 'object' => unserialize($data['__ci_value']), 'boolean', 'integer', 'double', 'string', 'NULL' => settype($data['__ci_value'], $data['__ci_type']) ? $data['__ci_value'] : null, - default => null, + default => null, }; } @@ -127,7 +126,7 @@ public function save(string $key, mixed $value, int $ttl = 60): bool case 'boolean': case 'integer': - case 'double': // Yes, 'double' is returned and NOT 'float' + case 'double': case 'string': case 'NULL': break; diff --git a/system/Commands/Translation/LocalizationSync.php b/system/Commands/Translation/LocalizationSync.php index 6381ab33ccad..f54df45c364c 100644 --- a/system/Commands/Translation/LocalizationSync.php +++ b/system/Commands/Translation/LocalizationSync.php @@ -131,9 +131,7 @@ private function process(string $originalLocale, string $targetLocale): int ), ); - /** - * @var array $files - */ + /** @var array $files */ $files = iterator_to_array($iterator, true); ksort($files); diff --git a/system/Config/View.php b/system/Config/View.php index 038c6fa774dc..c790a40e4ee2 100644 --- a/system/Config/View.php +++ b/system/Config/View.php @@ -16,16 +16,12 @@ use CodeIgniter\View\ViewDecoratorInterface; /** - * View configuration - * - * @phpstan-type parser_callable (callable(mixed): mixed) - * @phpstan-type parser_callable_string (callable(mixed): mixed)&string + * View configuration. */ class View extends BaseConfig { /** - * When false, the view method will clear the data between each - * call. + * When false, the view method will clear the data between each call. * * @var bool */ @@ -41,8 +37,7 @@ class View extends BaseConfig * * @psalm-suppress UndefinedDocblockClass * - * @var array - * @phpstan-var array + * @var array */ public $filters = []; @@ -53,18 +48,14 @@ class View extends BaseConfig * * @psalm-suppress UndefinedDocblockClass * - * @var array|string> - * @phpstan-var array|parser_callable_string|parser_callable> + * @var array> */ public $plugins = []; /** * Built-in View filters. * - * @psalm-suppress UndefinedDocblockClass - * - * @var array - * @phpstan-var array + * @var array */ protected $coreFilters = [ 'abs' => '\abs', @@ -93,10 +84,7 @@ class View extends BaseConfig /** * Built-in View plugins. * - * @psalm-suppress UndefinedDocblockClass - * - * @var array|string> - * @phpstan-var array|parser_callable_string|parser_callable> + * @var array> */ protected $corePlugins = [ 'csp_script_nonce' => '\CodeIgniter\View\Plugins::cspScriptNonce', diff --git a/system/Cookie/CookieStore.php b/system/Cookie/CookieStore.php index 6d5caa2aa5e0..c4b2994d9cf3 100644 --- a/system/Cookie/CookieStore.php +++ b/system/Cookie/CookieStore.php @@ -45,9 +45,7 @@ class CookieStore implements Countable, IteratorAggregate */ public static function fromCookieHeaders(array $headers, bool $raw = false) { - /** - * @var list $cookies - */ + /** @var list $cookies */ $cookies = array_filter(array_map(static function (string $header) use ($raw) { try { return Cookie::fromHeaderString($header, $raw); diff --git a/system/DataCaster/Cast/DatetimeCast.php b/system/DataCaster/Cast/DatetimeCast.php index b5f346c9c419..398fdc7beed7 100644 --- a/system/DataCaster/Cast/DatetimeCast.php +++ b/system/DataCaster/Cast/DatetimeCast.php @@ -40,9 +40,7 @@ public static function get( throw new InvalidArgumentException($message); } - /** - * @see https://www.php.net/manual/en/datetimeimmutable.createfromformat.php#datetimeimmutable.createfromformat.parameters - */ + /** @see https://www.php.net/manual/en/datetimeimmutable.createfromformat.php#datetimeimmutable.createfromformat.parameters */ $format = self::getDateTimeFormat($params, $helper); return Time::createFromFormat($format, $value); diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index fe646bb1fa6d..d891b3d61954 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -310,9 +310,7 @@ public function __construct($tableName, ConnectionInterface $db, ?array $options throw new DatabaseException('A table must be specified when creating a new Query Builder.'); } - /** - * @var BaseConnection $db - */ + /** @var BaseConnection $db */ $this->db = $db; if ($tableName instanceof TableName) { diff --git a/system/Database/BaseConnection.php b/system/Database/BaseConnection.php index bd2cb62053dd..dea7536de984 100644 --- a/system/Database/BaseConnection.php +++ b/system/Database/BaseConnection.php @@ -795,9 +795,7 @@ public function query(string $sql, $binds = null, bool $setEscapeFlags = true, s $this->initialize(); } - /** - * @var Query $query - */ + /** @var Query $query */ $query = new $queryClass($this); $query->setQuery($sql, $binds, $setEscapeFlags); diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php index cd868e860da0..fdd0b0f3f54c 100644 --- a/system/Debug/Toolbar.php +++ b/system/Debug/Toolbar.php @@ -368,9 +368,7 @@ protected function roundTo(float $number, int $increments = 5): float */ public function prepare(?RequestInterface $request = null, ?ResponseInterface $response = null): void { - /** - * @var IncomingRequest|null $request - */ + /** @var IncomingRequest|null $request */ if (CI_DEBUG && ! is_cli()) { if ($this->hasNativeHeaderConflict()) { return; diff --git a/system/Helpers/filesystem_helper.php b/system/Helpers/filesystem_helper.php index e7bd35441959..da6acabb039e 100644 --- a/system/Helpers/filesystem_helper.php +++ b/system/Helpers/filesystem_helper.php @@ -84,9 +84,7 @@ function directory_mirror(string $originDir, string $targetDir, bool $overwrite $dirLen = strlen($originDir); - /** - * @var SplFileInfo $file - */ + /** @var SplFileInfo $file */ foreach (new RecursiveIteratorIterator( new RecursiveDirectoryIterator($originDir, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST, diff --git a/system/Helpers/kint_helper.php b/system/Helpers/kint_helper.php index 1f89dc78c55b..8d8e73bfc92f 100644 --- a/system/Helpers/kint_helper.php +++ b/system/Helpers/kint_helper.php @@ -69,18 +69,14 @@ function d(...$vars) /** * Provides a backtrace to the current execution point, from Kint. */ - /** - * trace function - */ function trace(): void { Kint::$aliases[] = 'trace'; Kint::trace(); } } else { - // In case that Kint is not loaded. /** - * trace function + * Generic trace function in case that Kint is not loaded. * * @return int */ diff --git a/system/Pager/Pager.php b/system/Pager/Pager.php index e1c38edf3594..a4883f3809ae 100644 --- a/system/Pager/Pager.php +++ b/system/Pager/Pager.php @@ -265,9 +265,7 @@ public function getPageURI(?int $page = null, string $group = 'default', bool $r { $this->ensureGroup($group); - /** - * @var URI $uri - */ + /** @var URI $uri */ $uri = $this->groups[$group]['uri']; $segment = $this->segment[$group] ?? 0; diff --git a/system/View/Parser.php b/system/View/Parser.php index 85d0ff8468db..e0e53812c046 100644 --- a/system/View/Parser.php +++ b/system/View/Parser.php @@ -20,9 +20,6 @@ /** * Class for parsing pseudo-vars * - * @phpstan-type parser_callable (callable(mixed): mixed) - * @phpstan-type parser_callable_string (callable(mixed): mixed)&string - * * @see \CodeIgniter\View\ParserTest */ class Parser extends View @@ -63,8 +60,7 @@ class Parser extends View /** * Stores any plugins registered at run-time. * - * @var array|string> - * @phpstan-var array|parser_callable_string|parser_callable> + * @var array> */ protected $plugins = []; diff --git a/tests/_support/Config/Filters.php b/tests/_support/Config/Filters.php index f3960544f294..f46bf6f6beec 100644 --- a/tests/_support/Config/Filters.php +++ b/tests/_support/Config/Filters.php @@ -16,8 +16,6 @@ use Tests\Support\Filters\Customfilter; use Tests\Support\Filters\RedirectFilter; -/** - * @psalm-suppress UndefinedGlobalVariable - */ +/** @psalm-suppress UndefinedGlobalVariable */ $filters->aliases['test-customfilter'] = Customfilter::class; $filters->aliases['test-redirectfilter'] = RedirectFilter::class; diff --git a/tests/system/Commands/Utilities/ConfigCheckTest.php b/tests/system/Commands/Utilities/ConfigCheckTest.php index 22d0e3d1f1d3..9ac1c84fa51f 100644 --- a/tests/system/Commands/Utilities/ConfigCheckTest.php +++ b/tests/system/Commands/Utilities/ConfigCheckTest.php @@ -89,9 +89,7 @@ public function testCommandConfigCheckNonexistentClass(): void public function testConfigCheckWithKintEnabledUsesKintD(): void { - /** - * @var Closure(mixed...): string - */ + /** @var Closure(mixed...): string */ $command = self::getPrivateMethodInvoker( new ConfigCheck(service('logger'), service('commands')), 'getKintD', @@ -107,9 +105,7 @@ public function testConfigCheckWithKintEnabledUsesKintD(): void public function testConfigCheckWithKintDisabledUsesVarDump(): void { - /** - * @var Closure(mixed...): string - */ + /** @var Closure(mixed...): string */ $command = self::getPrivateMethodInvoker( new ConfigCheck(service('logger'), service('commands')), 'getVarDump', diff --git a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php index 1619dd668b31..2586f4400031 100644 --- a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php +++ b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php @@ -128,8 +128,7 @@ public function testReadTranslateUriToCamelCase(): void 'route' => 'sub-dir/blog-controller', 'route_params' => '', 'handler' => '\CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\Controllers\SubDir\BlogController::getIndex', - 'params' => [ - ], + 'params' => [], ], [ 'method' => 'get', diff --git a/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php b/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php index fb6c0e5e8ebd..3e716fb71edf 100644 --- a/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php +++ b/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php @@ -35,10 +35,8 @@ public function testGet(): void $filters = $collector->get(Method::GET, '/'); $expected = [ - 'before' => [ - ], - 'after' => [ - ], + 'before' => [], + 'after' => [], ]; $this->assertSame($expected, $filters); } diff --git a/tests/system/Commands/Utilities/Routes/FilterFinderTest.php b/tests/system/Commands/Utilities/Routes/FilterFinderTest.php index 8d6db5c20620..ce813ec3631e 100644 --- a/tests/system/Commands/Utilities/Routes/FilterFinderTest.php +++ b/tests/system/Commands/Utilities/Routes/FilterFinderTest.php @@ -102,9 +102,7 @@ private function createFilters(array $config = []): Filters public function testFindGlobalsFilters(): void { - /** - * @var RouteCollection $collection - */ + /** @var RouteCollection $collection */ $collection = $this->createRouteCollection(); $router = $this->createRouter($collection); $filters = $this->createFilters(); @@ -122,9 +120,7 @@ public function testFindGlobalsFilters(): void public function testFindGlobalsFiltersWithRedirectRoute(): void { - /** - * @var RouteCollection $collection - */ + /** @var RouteCollection $collection */ $collection = $this->createRouteCollection(); $collection->addRedirect('users/about', 'profile'); @@ -144,9 +140,7 @@ public function testFindGlobalsFiltersWithRedirectRoute(): void public function testFindGlobalsAndRouteFilters(): void { - /** - * @var RouteCollection $collection - */ + /** @var RouteCollection $collection */ $collection = $this->createRouteCollection(); $collection->get('admin', ' AdminController::index', ['filter' => 'honeypot']); $router = $this->createRouter($collection); @@ -201,9 +195,7 @@ public function testFindClassesGlobalsAndRouteFiltersWithArguments(): void public function testFindGlobalsAndRouteClassnameFilters(): void { - /** - * @var RouteCollection $collection - */ + /** @var RouteCollection $collection */ $collection = $this->createRouteCollection(); $collection->get('admin', ' AdminController::index', ['filter' => InvalidChars::class]); $router = $this->createRouter($collection); @@ -222,9 +214,7 @@ public function testFindGlobalsAndRouteClassnameFilters(): void public function testFindGlobalsAndRouteMultipleFilters(): void { - /** - * @var RouteCollection $collection - */ + /** @var RouteCollection $collection */ $collection = $this->createRouteCollection(); $collection->get('admin', ' AdminController::index', ['filter' => ['honeypot', InvalidChars::class]]); $router = $this->createRouter($collection); @@ -243,9 +233,7 @@ public function testFindGlobalsAndRouteMultipleFilters(): void public function testFilterOrder(): void { - /** - * @var RouteCollection $collection - */ + /** @var RouteCollection $collection */ $collection = $this->createRouteCollection([]); $collection->get('/', ' Home::index', ['filter' => ['route1', 'route2']]); $router = $this->createRouter($collection); @@ -311,9 +299,7 @@ public function testFilterOrderWithOldFilterOrder(): void $feature = config(Feature::class); $feature->oldFilterOrder = true; - /** - * @var RouteCollection $collection - */ + /** @var RouteCollection $collection */ $collection = $this->createRouteCollection([]); $collection->get('/', ' Home::index', ['filter' => ['route1', 'route2']]); $router = $this->createRouter($collection); diff --git a/tests/system/Debug/ExceptionHandlerTest.php b/tests/system/Debug/ExceptionHandlerTest.php index 7bd7bdb35465..43086860b0d6 100644 --- a/tests/system/Debug/ExceptionHandlerTest.php +++ b/tests/system/Debug/ExceptionHandlerTest.php @@ -198,8 +198,7 @@ public function testMaskSensitiveData(): void 'function' => 'index', 'class' => Home::class, 'type' => '->', - 'args' => [ - ], + 'args' => [], ], ]; $keysToMask = ['password']; @@ -224,8 +223,7 @@ public function testMaskSensitiveDataTraceDataKey(): void 'function' => 'f', 'class' => Home::class, 'type' => '->', - 'args' => [ - ], + 'args' => [], ], 1 => [ 'file' => '/var/www/CodeIgniter4/system/CodeIgniter.php', @@ -233,8 +231,7 @@ public function testMaskSensitiveDataTraceDataKey(): void 'function' => 'index', 'class' => Home::class, 'type' => '->', - 'args' => [ - ], + 'args' => [], ], ]; $keysToMask = ['file']; diff --git a/tests/system/Debug/ExceptionsTest.php b/tests/system/Debug/ExceptionsTest.php index 2de1d0d7290f..415b6772c509 100644 --- a/tests/system/Debug/ExceptionsTest.php +++ b/tests/system/Debug/ExceptionsTest.php @@ -160,8 +160,7 @@ public function testMaskSensitiveData(): void 'function' => 'index', 'class' => Home::class, 'type' => '->', - 'args' => [ - ], + 'args' => [], ], ]; $keysToMask = ['password']; @@ -186,8 +185,7 @@ public function testMaskSensitiveDataTraceDataKey(): void 'function' => 'f', 'class' => Home::class, 'type' => '->', - 'args' => [ - ], + 'args' => [], ], 1 => [ 'file' => '/var/www/CodeIgniter4/system/CodeIgniter.php', @@ -195,8 +193,7 @@ public function testMaskSensitiveDataTraceDataKey(): void 'function' => 'index', 'class' => Home::class, 'type' => '->', - 'args' => [ - ], + 'args' => [], ], ]; $keysToMask = ['file']; diff --git a/tests/system/Filters/FiltersTest.php b/tests/system/Filters/FiltersTest.php index bf65d43dd0de..cdf57c8b9211 100644 --- a/tests/system/Filters/FiltersTest.php +++ b/tests/system/Filters/FiltersTest.php @@ -854,8 +854,7 @@ public function testFiltersWithArguments(): void $config = [ 'aliases' => ['role' => Role::class], - 'globals' => [ - ], + 'globals' => [], 'filters' => [ 'role:admin,super' => [ 'before' => ['admin/*'], diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php index 58c1cb2a94cf..04c35458cd01 100644 --- a/tests/system/Helpers/FormHelperTest.php +++ b/tests/system/Helpers/FormHelperTest.php @@ -945,8 +945,7 @@ public function testSetCheckboxWithUnchecked(): void { $_SESSION = [ '_ci_old_input' => [ - 'post' => [ - ], + 'post' => [], ], ]; diff --git a/tests/system/Publisher/PublisherOutputTest.php b/tests/system/Publisher/PublisherOutputTest.php index 0b9b744e01fd..73571cd81a98 100644 --- a/tests/system/Publisher/PublisherOutputTest.php +++ b/tests/system/Publisher/PublisherOutputTest.php @@ -55,9 +55,7 @@ protected function setUp(): void { parent::setUp(); - /** - * Files to seed to VFS - */ + /** Files to seed to VFS */ $structure = [ 'able' => [ 'apple.php' => 'Once upon a midnight dreary', diff --git a/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php b/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php index 50ee40e061fd..f5f1f437c83d 100644 --- a/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php +++ b/tests/system/Security/SecurityCSRFSessionRandomizeTokenTest.php @@ -299,9 +299,7 @@ public function testRegenerateWithFalseSecurityRegenerateProperty(): void service('superglobals')->setServer('REQUEST_METHOD', 'POST'); service('superglobals')->setPost('csrf_test_name', $this->randomizedToken); - /** - * @var SecurityConfig - */ + /** @var SecurityConfig */ $config = Factories::config('Security'); $config->tokenRandomize = true; $config->regenerate = false; @@ -322,9 +320,7 @@ public function testRegenerateWithTrueSecurityRegenerateProperty(): void service('superglobals')->setServer('REQUEST_METHOD', 'POST'); service('superglobals')->setPost('csrf_test_name', $this->randomizedToken); - /** - * @var SecurityConfig - */ + /** @var SecurityConfig */ $config = Factories::config('Security'); $config->tokenRandomize = true; $config->regenerate = true; diff --git a/tests/system/Security/SecurityCSRFSessionTest.php b/tests/system/Security/SecurityCSRFSessionTest.php index 5c7aaf336e1f..fb410ac71ac3 100644 --- a/tests/system/Security/SecurityCSRFSessionTest.php +++ b/tests/system/Security/SecurityCSRFSessionTest.php @@ -288,9 +288,7 @@ public function testRegenerateWithFalseSecurityRegenerateProperty(): void ->setServer('REQUEST_METHOD', 'POST') ->setPost('csrf_test_name', '8b9218a55906f9dcc1dc263dce7f005a'); - /** - * @var SecurityConfig - */ + /** @var SecurityConfig */ $config = Factories::config('Security'); $config->regenerate = false; Factories::injectMock('config', 'Security', $config); @@ -311,9 +309,7 @@ public function testRegenerateWithTrueSecurityRegenerateProperty(): void ->setServer('REQUEST_METHOD', 'POST') ->setPost('csrf_test_name', '8b9218a55906f9dcc1dc263dce7f005a'); - /** - * @var SecurityConfig - */ + /** @var SecurityConfig */ $config = Factories::config('Security'); $config->regenerate = true; Factories::injectMock('config', 'Security', $config); diff --git a/tests/system/Validation/RulesTest.php b/tests/system/Validation/RulesTest.php index 37f7eebdfaa1..288a6d247e50 100644 --- a/tests/system/Validation/RulesTest.php +++ b/tests/system/Validation/RulesTest.php @@ -748,8 +748,8 @@ public static function provideRequiredWithAndOtherRules(): iterable [true, ['mustBeADate' => []]], // `otherField` and `mustBeADate` exist [true, ['mustBeADate' => '', 'otherField' => '']], - [true, ['mustBeADate' => '2023-06-12', 'otherField' => 'exists']], - [true, ['mustBeADate' => '2023-06-12', 'otherField' => '']], + [true, ['mustBeADate' => '2023-06-12', 'otherField' => 'exists']], + [true, ['mustBeADate' => '2023-06-12', 'otherField' => '']], [false, ['mustBeADate' => '', 'otherField' => 'exists']], [false, ['mustBeADate' => [], 'otherField' => 'exists']], [false, ['mustBeADate' => null, 'otherField' => 'exists']], @@ -773,7 +773,7 @@ public static function provideRequiredWithAndOtherRuleWithValueZero(): iterable { yield from [ [true, ['married' => '0', 'partner_name' => '']], - [true, ['married' => '1', 'partner_name' => 'Foo']], + [true, ['married' => '1', 'partner_name' => 'Foo']], [false, ['married' => '1', 'partner_name' => '']], ]; } diff --git a/user_guide_src/source/guides/first-app/static_pages/003.php b/user_guide_src/source/guides/first-app/static_pages/003.php index fc4914a6923b..4cf109ed3dd4 100644 --- a/user_guide_src/source/guides/first-app/static_pages/003.php +++ b/user_guide_src/source/guides/first-app/static_pages/003.php @@ -2,7 +2,5 @@ use CodeIgniter\Router\RouteCollection; -/** - * @var RouteCollection $routes - */ +/** @var RouteCollection $routes */ $routes->get('/', 'Home::index'); diff --git a/user_guide_src/source/installation/upgrade_routing/001.php b/user_guide_src/source/installation/upgrade_routing/001.php index b2cb2ee5d2d5..59450f4863e2 100644 --- a/user_guide_src/source/installation/upgrade_routing/001.php +++ b/user_guide_src/source/installation/upgrade_routing/001.php @@ -2,9 +2,7 @@ use CodeIgniter\Router\RouteCollection; -/** - * @var RouteCollection $routes - */ +/** @var RouteCollection $routes */ $routes->get('/', 'Home::index'); $routes->add('posts/index', 'Posts::index');