diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
index 4ee4901658..c9c24c7a06 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php-cs-fixer.dist.php
@@ -40,7 +40,17 @@ $finder = Finder::create()
]);
$overrides = [
- 'get_class_to_class_keyword' => true,
+ 'get_class_to_class_keyword' => true,
+ 'trailing_comma_in_multiline' => [
+ 'after_heredoc' => true,
+ 'elements' => [
+ 'arguments',
+ 'array_destructuring',
+ 'arrays',
+ 'match',
+ 'parameters',
+ ],
+ ],
];
$options = [
@@ -55,5 +65,5 @@ $options = [
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
'CodeIgniter 4 framework',
'CodeIgniter Foundation',
- 'admin@codeigniter.com'
+ 'admin@codeigniter.com',
);
diff --git a/admin/create-new-changelog.php b/admin/create-new-changelog.php
index ff333f4269..cc7f8359a5 100644
--- a/admin/create-new-changelog.php
+++ b/admin/create-new-changelog.php
@@ -47,7 +47,7 @@ if ($isMinorUpdate) {
replace_file_content(
$changelogIndex,
'/\.\. toctree::\n :titlesonly:\n/u',
- ".. toctree::\n :titlesonly:\n\n v{$version}"
+ ".. toctree::\n :titlesonly:\n\n v{$version}",
);
// Replace {version}
$length = mb_strlen("Version {$version}");
@@ -55,12 +55,12 @@ $underline = str_repeat('#', $length);
replace_file_content(
$changelog,
'/#################\nVersion {version}\n#################/u',
- "{$underline}\nVersion {$version}\n{$underline}"
+ "{$underline}\nVersion {$version}\n{$underline}",
);
replace_file_content(
$changelog,
'/{version}/u',
- "{$version}"
+ "{$version}",
);
// Copy upgrading
@@ -72,7 +72,7 @@ copy('./admin/next-upgrading-guide.rst', $upgrading);
replace_file_content(
$upgradingIndex,
'/ backward_compatibility_notes\n/u',
- " backward_compatibility_notes\n\n upgrade_{$versionWithoutDots}"
+ " backward_compatibility_notes\n\n upgrade_{$versionWithoutDots}",
);
// Replace {version}
$length = mb_strlen("Upgrading from {$versionCurrent} to {$version}");
@@ -80,7 +80,7 @@ $underline = str_repeat('#', $length);
replace_file_content(
$upgrading,
'/##############################\nUpgrading from {version} to {version}\n##############################/u',
- "{$underline}\nUpgrading from {$versionCurrent} to {$version}\n{$underline}"
+ "{$underline}\nUpgrading from {$versionCurrent} to {$version}\n{$underline}",
);
// Commits
diff --git a/admin/prepare-release.php b/admin/prepare-release.php
index c0dcab6866..5d66a43b8c 100644
--- a/admin/prepare-release.php
+++ b/admin/prepare-release.php
@@ -33,31 +33,31 @@ system('git switch -c release-' . $version);
replace_file_content(
'./system/CodeIgniter.php',
'/public const CI_VERSION = \'.*?\';/u',
- "public const CI_VERSION = '{$version}';"
+ "public const CI_VERSION = '{$version}';",
);
// Updates version number in "conf.py".
replace_file_content(
'./user_guide_src/source/conf.py',
'/^version = \'.*?\'/mu',
- "version = '{$minor}'"
+ "version = '{$minor}'",
);
replace_file_content(
'./user_guide_src/source/conf.py',
'/^release = \'.*?\'/mu',
- "release = '{$version}'"
+ "release = '{$version}'",
);
// Updates version number in "phpdoc.dist.xml".
replace_file_content(
'./phpdoc.dist.xml',
'!
CodeIgniter v.*? API!mu',
- "CodeIgniter v{$minor} API"
+ "CodeIgniter v{$minor} API",
);
replace_file_content(
'./phpdoc.dist.xml',
'//mu',
- ""
+ "",
);
// Updates release date in changelogs.
@@ -65,7 +65,7 @@ $date = date('F j, Y');
replace_file_content(
"./user_guide_src/source/changelogs/v{$version}.rst",
'/^Release Date: .*/mu',
- "Release Date: {$date}"
+ "Release Date: {$date}",
);
// Commits
diff --git a/admin/starter/tests/unit/HealthTest.php b/admin/starter/tests/unit/HealthTest.php
index f6a5a80480..b3e480f4b0 100644
--- a/admin/starter/tests/unit/HealthTest.php
+++ b/admin/starter/tests/unit/HealthTest.php
@@ -32,7 +32,7 @@ final class HealthTest extends CIUnitTestCase
$config = new App();
$this->assertTrue(
$validation->check($config->baseURL, 'valid_url'),
- 'baseURL "' . $config->baseURL . '" in .env is not valid URL'
+ 'baseURL "' . $config->baseURL . '" in .env is not valid URL',
);
}
@@ -43,7 +43,7 @@ final class HealthTest extends CIUnitTestCase
// BaseURL in app/Config/App.php is a valid URL?
$this->assertTrue(
$validation->check($reader->baseURL, 'valid_url'),
- 'baseURL "' . $reader->baseURL . '" in app/Config/App.php is not valid URL'
+ 'baseURL "' . $reader->baseURL . '" in app/Config/App.php is not valid URL',
);
}
}
diff --git a/preload.php b/preload.php
index 755df5e4a4..0b45312234 100644
--- a/preload.php
+++ b/preload.php
@@ -86,7 +86,7 @@ class preload
$phpFiles = new RegexIterator(
$fullTree,
'/.+((? $file) {
diff --git a/public/index.php b/public/index.php
index 5ec58a7729..eb7f5c9888 100644
--- a/public/index.php
+++ b/public/index.php
@@ -11,7 +11,7 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
$message = sprintf(
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
$minPhpVersion,
- PHP_VERSION
+ PHP_VERSION,
);
header('HTTP/1.1 503 Service Unavailable.', true, 503);
diff --git a/rector.php b/rector.php
index 486685959c..e5c21c814a 100644
--- a/rector.php
+++ b/rector.php
@@ -62,7 +62,7 @@ return RectorConfig::configure()
->withCache(
// Github action cache or local
is_dir('/tmp') ? '/tmp/rector' : null,
- FileCacheStorage::class
+ FileCacheStorage::class,
)
// paths to refactor; solid alternative to CLI arguments
->withPaths([
diff --git a/spark b/spark
index 992d044c9e..856dc3f8a2 100755
--- a/spark
+++ b/spark
@@ -40,7 +40,7 @@ if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
$message = sprintf(
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
$minPhpVersion,
- PHP_VERSION
+ PHP_VERSION,
);
exit($message);
diff --git a/system/API/ResponseTrait.php b/system/API/ResponseTrait.php
index 01ce42860b..dbfa83dc88 100644
--- a/system/API/ResponseTrait.php
+++ b/system/API/ResponseTrait.php
@@ -319,7 +319,7 @@ trait ResponseTrait
$mime = $this->request->negotiate(
'media',
$format->getConfig()->supportedResponseFormats,
- false
+ false,
);
}
diff --git a/system/Autoloader/Autoloader.php b/system/Autoloader/Autoloader.php
index b338027c9c..50e6eaed23 100644
--- a/system/Autoloader/Autoloader.php
+++ b/system/Autoloader/Autoloader.php
@@ -347,7 +347,7 @@ class Autoloader
throw new InvalidArgumentException(
'The file path contains special characters "' . $chars
- . '" that are not allowed: "' . $filename . '"'
+ . '" that are not allowed: "' . $filename . '"',
);
}
if ($result === false) {
@@ -386,7 +386,7 @@ class Autoloader
throw new RuntimeException(
'Your Composer version is too old.'
. ' Please update Composer (run `composer self-update`) to v2.0.14 or later'
- . ' and remove your vendor/ directory, and run `composer update`.'
+ . ' and remove your vendor/ directory, and run `composer update`.',
);
}
// This method requires Composer 2.0.14 or later.
diff --git a/system/Autoloader/FileLocator.php b/system/Autoloader/FileLocator.php
index 8e2564e009..844ac7fc4c 100644
--- a/system/Autoloader/FileLocator.php
+++ b/system/Autoloader/FileLocator.php
@@ -295,9 +295,9 @@ class FileLocator implements FileLocatorInterface
str_replace(
'/',
'\\',
- mb_substr($path, mb_strlen($namespace['path']))
+ mb_substr($path, mb_strlen($namespace['path'])),
),
- '\\'
+ '\\',
);
// Remove the file extension (.php)
$className = mb_substr($className, 0, -4);
diff --git a/system/BaseModel.php b/system/BaseModel.php
index 05c5459d8c..a10acef72e 100644
--- a/system/BaseModel.php
+++ b/system/BaseModel.php
@@ -379,7 +379,7 @@ abstract class BaseModel
$this->converter = new DataConverter(
$this->casts,
$this->castHandlers,
- $this->db
+ $this->db,
);
}
}
@@ -1081,7 +1081,7 @@ abstract class BaseModel
if ($updateIndex === null) {
throw new InvalidArgumentException(
'The index ("' . $index . '") for updateBatch() is missing in the data: '
- . json_encode($row)
+ . json_encode($row),
);
}
diff --git a/system/Boot.php b/system/Boot.php
index 4b2d20ca95..502692249b 100644
--- a/system/Boot.php
+++ b/system/Boot.php
@@ -288,7 +288,7 @@ class Boot
$message = sprintf(
'The framework needs the following extension(s) installed and loaded: %s.',
- implode(', ', $missingExtensions)
+ implode(', ', $missingExtensions),
);
header('HTTP/1.1 503 Service Unavailable.', true, 503);
diff --git a/system/CLI/CLI.php b/system/CLI/CLI.php
index 0f1fe5dbce..b8b90d77ba 100644
--- a/system/CLI/CLI.php
+++ b/system/CLI/CLI.php
@@ -610,11 +610,11 @@ class CLI
$nonColoredText = preg_replace(
$pattern,
'<<__colored_string__>>',
- $text
+ $text,
);
$nonColoredChunks = preg_split(
'/<<__colored_string__>>/u',
- $nonColoredText
+ $nonColoredText,
);
foreach ($nonColoredChunks as $i => $chunk) {
diff --git a/system/CLI/Console.php b/system/CLI/Console.php
index 725193d424..5cb8b57a0a 100644
--- a/system/CLI/Console.php
+++ b/system/CLI/Console.php
@@ -63,7 +63,7 @@ class Console
'CodeIgniter v%s Command Line Tool - Server Time: %s UTC%s',
CodeIgniter::CI_VERSION,
date('Y-m-d H:i:s'),
- date('P')
+ date('P'),
), 'green');
CLI::newLine();
}
diff --git a/system/CLI/GeneratorTrait.php b/system/CLI/GeneratorTrait.php
index 6a061a36b8..1024fa6952 100644
--- a/system/CLI/GeneratorTrait.php
+++ b/system/CLI/GeneratorTrait.php
@@ -171,7 +171,7 @@ trait GeneratorTrait
CLI::prompt(
'Are you sure you want to continue?',
['y', 'n'],
- 'required'
+ 'required',
) === 'n'
) {
CLI::newLine();
@@ -193,7 +193,7 @@ trait GeneratorTrait
CLI::error(
lang('CLI.generator.fileExist', [clean_path($target)]),
'light_gray',
- 'red'
+ 'red',
);
CLI::newLine();
@@ -216,7 +216,7 @@ trait GeneratorTrait
CLI::error(
lang('CLI.generator.fileError', [clean_path($target)]),
'light_gray',
- 'red'
+ 'red',
);
CLI::newLine();
@@ -227,7 +227,7 @@ trait GeneratorTrait
if ($this->getOption('force') && $isFile) {
CLI::write(
lang('CLI.generator.fileOverwrite', [clean_path($target)]),
- 'yellow'
+ 'yellow',
);
CLI::newLine();
@@ -236,7 +236,7 @@ trait GeneratorTrait
CLI::write(
lang('CLI.generator.fileCreate', [clean_path($target)]),
- 'green'
+ 'green',
);
CLI::newLine();
}
@@ -326,10 +326,10 @@ trait GeneratorTrait
'\\',
array_map(
pascalize(...),
- explode('\\', str_replace('/', '\\', trim($class)))
- )
+ explode('\\', str_replace('/', '\\', trim($class))),
+ ),
),
- '\\/'
+ '\\/',
);
}
@@ -351,7 +351,7 @@ trait GeneratorTrait
return view(
"CodeIgniter\\Commands\\Generators\\Views\\{$this->template}",
$data,
- ['debug' => false]
+ ['debug' => false],
);
}
}
@@ -370,15 +370,15 @@ trait GeneratorTrait
string $class,
array $search = [],
array $replace = [],
- array $data = []
+ array $data = [],
): string {
// Retrieves the namespace part from the fully qualified class name.
$namespace = trim(
implode(
'\\',
- array_slice(explode('\\', $class), 0, -1)
+ array_slice(explode('\\', $class), 0, -1),
),
- '\\'
+ '\\',
);
$search[] = '<@php';
$search[] = '{namespace}';
@@ -404,7 +404,7 @@ trait GeneratorTrait
&& preg_match(
'/(?P(?:^use [^;]+;$\n?)+)/m',
$template,
- $match
+ $match,
)
) {
$imports = explode("\n", trim($match['imports']));
@@ -432,7 +432,7 @@ trait GeneratorTrait
CLI::error(
lang('CLI.namespaceNotDefined', [$namespace]),
'light_gray',
- 'red'
+ 'red',
);
CLI::newLine();
@@ -446,7 +446,7 @@ trait GeneratorTrait
. str_replace(
'\\',
DIRECTORY_SEPARATOR,
- trim(str_replace($namespace . '\\', '', $class), '\\')
+ trim(str_replace($namespace . '\\', '', $class), '\\'),
) . '.php';
return implode(
@@ -454,8 +454,8 @@ trait GeneratorTrait
array_slice(
explode(DIRECTORY_SEPARATOR, $file),
0,
- -1
- )
+ -1,
+ ),
) . DIRECTORY_SEPARATOR . $this->basename($file);
}
@@ -470,9 +470,9 @@ trait GeneratorTrait
str_replace(
'/',
'\\',
- $this->getOption('namespace') ?? APP_NAMESPACE
+ $this->getOption('namespace') ?? APP_NAMESPACE,
),
- '\\'
+ '\\',
);
}
diff --git a/system/Cache/Handlers/MemcachedHandler.php b/system/Cache/Handlers/MemcachedHandler.php
index e104800407..f3bc00f40b 100644
--- a/system/Cache/Handlers/MemcachedHandler.php
+++ b/system/Cache/Handlers/MemcachedHandler.php
@@ -85,7 +85,7 @@ class MemcachedHandler extends BaseHandler
$this->memcached->addServer(
$this->config['host'],
$this->config['port'],
- $this->config['weight']
+ $this->config['weight'],
);
// attempt to get status of servers
@@ -103,7 +103,7 @@ class MemcachedHandler extends BaseHandler
// Check if we can connect to the server
$canConnect = $this->memcached->connect(
$this->config['host'],
- $this->config['port']
+ $this->config['port'],
);
// If we can't connect, throw a CriticalError exception
@@ -116,7 +116,7 @@ class MemcachedHandler extends BaseHandler
$this->config['host'],
$this->config['port'],
true,
- $this->config['weight']
+ $this->config['weight'],
);
} else {
throw new CriticalError('Cache: Not support Memcache(d) extension.');
diff --git a/system/Cache/Handlers/PredisHandler.php b/system/Cache/Handlers/PredisHandler.php
index fc0185033d..bdf5afe0f2 100644
--- a/system/Cache/Handlers/PredisHandler.php
+++ b/system/Cache/Handlers/PredisHandler.php
@@ -82,7 +82,7 @@ class PredisHandler extends BaseHandler
$data = array_combine(
['__ci_type', '__ci_value'],
- $this->redis->hmget($key, ['__ci_type', '__ci_value'])
+ $this->redis->hmget($key, ['__ci_type', '__ci_value']),
);
if (! isset($data['__ci_type'], $data['__ci_value']) || $data['__ci_value'] === false) {
diff --git a/system/Cache/ResponseCache.php b/system/Cache/ResponseCache.php
index 388931813c..448e7b83df 100644
--- a/system/Cache/ResponseCache.php
+++ b/system/Cache/ResponseCache.php
@@ -112,7 +112,7 @@ final class ResponseCache
return $this->cache->save(
$this->generateCacheKey($request),
serialize(['headers' => $headers, 'output' => $response->getBody()]),
- $this->ttl
+ $this->ttl,
);
}
diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php
index e92a6a10ae..716d3701d1 100644
--- a/system/CodeIgniter.php
+++ b/system/CodeIgniter.php
@@ -325,7 +325,7 @@ class CodeIgniter
if ($this->context === null) {
throw new LogicException(
'Context must be set before run() is called. If you are upgrading from 4.1.x, '
- . 'you need to merge `public/index.php` and `spark` file from `vendor/codeigniter4/framework`.'
+ . 'you need to merge `public/index.php` and `spark` file from `vendor/codeigniter4/framework`.',
);
}
@@ -799,7 +799,7 @@ class CodeIgniter
return str_replace(
['{elapsed_time}', '{memory_usage}'],
[(string) $this->totalTime, number_format(memory_get_peak_usage() / 1024 / 1024, 3)],
- $output
+ $output,
);
}
@@ -979,7 +979,7 @@ class CodeIgniter
// Throws new PageNotFoundException and remove exception message on production.
throw PageNotFoundException::forPageNotFound(
- (ENVIRONMENT !== 'production' || ! $this->isWeb()) ? $e->getMessage() : null
+ (ENVIRONMENT !== 'production' || ! $this->isWeb()) ? $e->getMessage() : null,
);
}
@@ -1064,7 +1064,7 @@ class CodeIgniter
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
));
}
}
diff --git a/system/Commands/Database/ShowTableInfo.php b/system/Commands/Database/ShowTableInfo.php
index 147b6eb614..2367bbff4d 100644
--- a/system/Commands/Database/ShowTableInfo.php
+++ b/system/Commands/Database/ShowTableInfo.php
@@ -144,7 +144,7 @@ class ShowTableInfo extends BaseCommand
$tableNameNo = CLI::promptByKey(
['Here is the list of your database tables:', 'Which table do you want to see?'],
$tables,
- 'required'
+ 'required',
);
CLI::newLine();
@@ -174,7 +174,7 @@ class ShowTableInfo extends BaseCommand
]];
CLI::table(
$data,
- ['hostname', 'database', 'username', 'DBDriver', 'DBPrefix', 'port']
+ ['hostname', 'database', 'username', 'DBDriver', 'DBPrefix', 'port'],
);
}
@@ -272,7 +272,7 @@ class ShowTableInfo extends BaseCommand
string $tableName,
int $limitRows,
int $limitFieldValue,
- ?string $sortField = null
+ ?string $sortField = null,
): array {
$this->tbody = [];
@@ -290,7 +290,7 @@ class ShowTableInfo extends BaseCommand
static fn ($item): string => mb_strlen((string) $item) > $limitFieldValue
? mb_substr((string) $item, 0, $limitFieldValue) . '...'
: (string) $item,
- $row
+ $row,
);
$this->tbody[] = $row;
}
diff --git a/system/Commands/Encryption/GenerateKey.php b/system/Commands/Encryption/GenerateKey.php
index 21a582a067..a3fdbd4393 100644
--- a/system/Commands/Encryption/GenerateKey.php
+++ b/system/Commands/Encryption/GenerateKey.php
@@ -182,7 +182,7 @@ class GenerateKey extends BaseCommand
$newFileContents = preg_replace(
'/^[#\s]*encryption.key[=\s]*(?:hex2bin\:[a-f0-9]{64}|base64\:(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?)$/m',
$replacementKey,
- $oldFileContents
+ $oldFileContents,
);
}
diff --git a/system/Commands/Generators/CellGenerator.php b/system/Commands/Generators/CellGenerator.php
index 57d79ac890..04c5bd8adf 100644
--- a/system/Commands/Generators/CellGenerator.php
+++ b/system/Commands/Generators/CellGenerator.php
@@ -96,7 +96,7 @@ class CellGenerator extends BaseCommand
$viewName = preg_replace(
'/([a-z][a-z0-9_\/\\\\]+)(_cell)$/i',
'$1',
- $viewName
+ $viewName,
) ?? $viewName;
$namespace = substr($className, 0, strrpos($className, '\\') + 1);
diff --git a/system/Commands/Generators/CommandGenerator.php b/system/Commands/Generators/CommandGenerator.php
index 8c2ebcfb5d..a0872f63c2 100644
--- a/system/Commands/Generators/CommandGenerator.php
+++ b/system/Commands/Generators/CommandGenerator.php
@@ -115,7 +115,7 @@ class CommandGenerator extends BaseCommand
$class,
['{group}', '{command}'],
[$group, $command],
- ['type' => $type]
+ ['type' => $type],
);
}
}
diff --git a/system/Commands/Generators/ControllerGenerator.php b/system/Commands/Generators/ControllerGenerator.php
index c6f54cac28..287f92f87c 100644
--- a/system/Commands/Generators/ControllerGenerator.php
+++ b/system/Commands/Generators/ControllerGenerator.php
@@ -130,7 +130,7 @@ class ControllerGenerator extends BaseCommand
$class,
['{useStatement}', '{extends}'],
[$useStatement, $extends],
- ['type' => $rest]
+ ['type' => $rest],
);
}
}
diff --git a/system/Commands/Generators/TestGenerator.php b/system/Commands/Generators/TestGenerator.php
index 35019c72b8..7ab6859ed9 100644
--- a/system/Commands/Generators/TestGenerator.php
+++ b/system/Commands/Generators/TestGenerator.php
@@ -102,9 +102,9 @@ class TestGenerator extends BaseCommand
str_replace(
'/',
'\\',
- $this->getOption('namespace')
+ $this->getOption('namespace'),
),
- '\\'
+ '\\',
);
}
@@ -143,7 +143,7 @@ class TestGenerator extends BaseCommand
CLI::error(
lang('CLI.namespaceNotDefined', [$namespace]),
'light_gray',
- 'red'
+ 'red',
);
CLI::newLine();
@@ -157,7 +157,7 @@ class TestGenerator extends BaseCommand
. str_replace(
'\\',
DIRECTORY_SEPARATOR,
- trim(str_replace($namespace . '\\', '', $class), '\\')
+ trim(str_replace($namespace . '\\', '', $class), '\\'),
) . '.php';
return implode(
@@ -165,8 +165,8 @@ class TestGenerator extends BaseCommand
array_slice(
explode(DIRECTORY_SEPARATOR, $file),
0,
- -1
- )
+ -1,
+ ),
) . DIRECTORY_SEPARATOR . $this->basename($file);
}
diff --git a/system/Commands/Translation/LocalizationFinder.php b/system/Commands/Translation/LocalizationFinder.php
index e7d4eff696..3307dab8a4 100644
--- a/system/Commands/Translation/LocalizationFinder.php
+++ b/system/Commands/Translation/LocalizationFinder.php
@@ -70,7 +70,7 @@ class LocalizationFinder extends BaseCommand
if (! in_array($optionLocale, config(App::class)->supportedLocales, true)) {
CLI::error(
'Error: "' . $optionLocale . '" is not supported. Supported locales: '
- . implode(', ', config(App::class)->supportedLocales)
+ . implode(', ', config(App::class)->supportedLocales),
);
return EXIT_USER_INPUT;
@@ -116,7 +116,7 @@ class LocalizationFinder extends BaseCommand
[
'foundLanguageKeys' => $foundLanguageKeys,
'badLanguageKeys' => $badLanguageKeys,
- 'countFiles' => $countFiles
+ 'countFiles' => $countFiles,
] = $this->findLanguageKeysInFiles($files);
ksort($foundLanguageKeys);
diff --git a/system/Commands/Utilities/ConfigCheck.php b/system/Commands/Utilities/ConfigCheck.php
index 7d6dc332ca..fa84cb287c 100644
--- a/system/Commands/Utilities/ConfigCheck.php
+++ b/system/Commands/Utilities/ConfigCheck.php
@@ -109,7 +109,7 @@ final class ConfigCheck extends BaseCommand
CLI::write($this->getKintD($config));
} else {
CLI::write(
- CLI::color($this->getVarDump($config), 'cyan')
+ CLI::color($this->getVarDump($config), 'cyan'),
);
}
@@ -150,7 +150,7 @@ final class ConfigCheck extends BaseCommand
return preg_replace(
'!.*system/Commands/Utilities/ConfigCheck.php.*\n!u',
'',
- $output
+ $output,
);
}
}
diff --git a/system/Commands/Utilities/Environment.php b/system/Commands/Utilities/Environment.php
index 17a08d21d2..103591209d 100644
--- a/system/Commands/Utilities/Environment.php
+++ b/system/Commands/Utilities/Environment.php
@@ -151,7 +151,7 @@ final class Environment extends BaseCommand
return file_put_contents(
$envFile,
- preg_replace($pattern, "\nCI_ENVIRONMENT = {$newEnv}", file_get_contents($envFile), -1, $count)
+ preg_replace($pattern, "\nCI_ENVIRONMENT = {$newEnv}", file_get_contents($envFile), -1, $count),
) !== false && $count > 0;
}
}
diff --git a/system/Commands/Utilities/FilterCheck.php b/system/Commands/Utilities/FilterCheck.php
index 56fcdb00b9..a7a8803bd7 100644
--- a/system/Commands/Utilities/FilterCheck.php
+++ b/system/Commands/Utilities/FilterCheck.php
@@ -100,7 +100,7 @@ class FilterCheck extends BaseCommand
CLI::color(
'"' . strtoupper($method) . ' ' . $route . '"',
'black',
- 'light_gray'
+ 'light_gray',
),
);
diff --git a/system/Commands/Utilities/Optimize.php b/system/Commands/Utilities/Optimize.php
index fa7612d524..2c147de6c3 100644
--- a/system/Commands/Utilities/Optimize.php
+++ b/system/Commands/Utilities/Optimize.php
@@ -110,13 +110,13 @@ final class Optimize extends BaseCommand
[
'public bool $configCacheEnabled = false;' => 'public bool $configCacheEnabled = true;',
'public bool $locatorCacheEnabled = false;' => 'public bool $locatorCacheEnabled = true;',
- ]
+ ],
);
if ($result) {
CLI::write(
'Config Caching and FileLocator Caching are enabled in "app/Config/Optimize.php".',
- 'green'
+ 'green',
);
return;
diff --git a/system/Commands/Utilities/Routes.php b/system/Commands/Utilities/Routes.php
index d7a6c0b557..2a6122cab0 100644
--- a/system/Commands/Utilities/Routes.php
+++ b/system/Commands/Utilities/Routes.php
@@ -133,7 +133,7 @@ class Routes extends BaseCommand
$collection->getDefaultController(),
$collection->getDefaultMethod(),
$methods,
- $collection->getRegisteredControllers('*')
+ $collection->getRegisteredControllers('*'),
);
$autoRoutes = $autoRouteCollector->get();
@@ -149,7 +149,7 @@ class Routes extends BaseCommand
$collection->getDefaultMethod(),
$methods,
$collection->getRegisteredControllers('*'),
- $uri
+ $uri,
);
$autoRoutes = [...$autoRoutes, ...$autoRouteCollector->get()];
@@ -159,7 +159,7 @@ class Routes extends BaseCommand
$autoRouteCollector = new AutoRouteCollector(
$collection->getDefaultNamespace(),
$collection->getDefaultController(),
- $collection->getDefaultMethod()
+ $collection->getDefaultMethod(),
);
$autoRoutes = $autoRouteCollector->get();
diff --git a/system/Commands/Utilities/Routes/AutoRouteCollector.php b/system/Commands/Utilities/Routes/AutoRouteCollector.php
index 73009b9c9e..3b91d365ac 100644
--- a/system/Commands/Utilities/Routes/AutoRouteCollector.php
+++ b/system/Commands/Utilities/Routes/AutoRouteCollector.php
@@ -41,7 +41,7 @@ final class AutoRouteCollector
$output = $reader->read(
$class,
$this->defaultController,
- $this->defaultMethod
+ $this->defaultMethod,
);
foreach ($output as $item) {
diff --git a/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php b/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php
index f6a4f37185..f4a5204fb4 100644
--- a/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php
+++ b/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php
@@ -36,7 +36,7 @@ final class AutoRouteCollector
private readonly string $defaultMethod,
private readonly array $httpMethods,
private readonly array $protectedControllers,
- private readonly string $prefix = ''
+ private readonly string $prefix = '',
) {
}
@@ -59,7 +59,7 @@ final class AutoRouteCollector
$routes = $reader->read(
$class,
$this->defaultController,
- $this->defaultMethod
+ $this->defaultMethod,
);
if ($routes === []) {
diff --git a/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php b/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php
index 2755a389ff..a0a98afc82 100644
--- a/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php
+++ b/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php
@@ -33,7 +33,7 @@ final class ControllerMethodReader
*/
public function __construct(
private readonly string $namespace,
- private readonly array $httpMethods
+ private readonly array $httpMethods,
) {
$config = config(Routing::class);
$this->translateURIDashes = $config->translateURIDashes;
@@ -78,7 +78,7 @@ final class ControllerMethodReader
$classname,
$methodName,
$httpVerb,
- $method
+ $method,
);
if ($routeForDefaultController !== []) {
@@ -193,7 +193,7 @@ final class ControllerMethodReader
{
if ($this->translateUriToCamelCase) {
$string = strtolower(
- preg_replace('/([a-z\d])([A-Z])/', '$1-$2', $string)
+ preg_replace('/([a-z\d])([A-Z])/', '$1-$2', $string),
);
} elseif ($this->translateURIDashes) {
$string = str_replace('_', '-', $string);
@@ -214,7 +214,7 @@ final class ControllerMethodReader
string $classname,
string $methodName,
string $httpVerb,
- ReflectionMethod $method
+ ReflectionMethod $method,
): array {
$output = [];
diff --git a/system/Commands/Utilities/Routes/ControllerFinder.php b/system/Commands/Utilities/Routes/ControllerFinder.php
index 71de1681b5..400e30e82d 100644
--- a/system/Commands/Utilities/Routes/ControllerFinder.php
+++ b/system/Commands/Utilities/Routes/ControllerFinder.php
@@ -28,7 +28,7 @@ final class ControllerFinder
* @param string $namespace namespace to search
*/
public function __construct(
- private readonly string $namespace
+ private readonly string $namespace,
) {
$this->locator = service('locator');
}
diff --git a/system/Commands/Utilities/Routes/ControllerMethodReader.php b/system/Commands/Utilities/Routes/ControllerMethodReader.php
index b40a832b4f..cd47085932 100644
--- a/system/Commands/Utilities/Routes/ControllerMethodReader.php
+++ b/system/Commands/Utilities/Routes/ControllerMethodReader.php
@@ -57,7 +57,7 @@ final class ControllerMethodReader
$defaultController,
$uriByClass,
$classname,
- $methodName
+ $methodName,
);
$output = [...$output, ...$routeWithoutController];
@@ -89,7 +89,7 @@ final class ControllerMethodReader
$defaultController,
$uriByClass,
$classname,
- $methodName
+ $methodName,
);
$output = [...$output, ...$routeWithoutController];
@@ -153,7 +153,7 @@ final class ControllerMethodReader
string $defaultController,
string $uriByClass,
string $classname,
- string $methodName
+ string $methodName,
): array {
if ($classShortname !== $defaultController) {
return [];
diff --git a/system/Commands/Utilities/Routes/FilterCollector.php b/system/Commands/Utilities/Routes/FilterCollector.php
index b646dcb250..51b36662f4 100644
--- a/system/Commands/Utilities/Routes/FilterCollector.php
+++ b/system/Commands/Utilities/Routes/FilterCollector.php
@@ -32,7 +32,7 @@ final class FilterCollector
*
* If set to true, route filters are not found.
*/
- private readonly bool $resetRoutes = false
+ private readonly bool $resetRoutes = false,
) {
}
@@ -50,7 +50,7 @@ final class FilterCollector
@trigger_error(
'Passing lowercase HTTP method "' . $method . '" is deprecated.'
. ' Use uppercase HTTP method like "' . strtoupper($method) . '".',
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
}
diff --git a/system/Commands/Utilities/Routes/SampleURIGenerator.php b/system/Commands/Utilities/Routes/SampleURIGenerator.php
index 45eb2f9320..a0e5f09bc2 100644
--- a/system/Commands/Utilities/Routes/SampleURIGenerator.php
+++ b/system/Commands/Utilities/Routes/SampleURIGenerator.php
@@ -57,7 +57,7 @@ final class SampleURIGenerator
$sampleUri = str_replace(
'{locale}',
config(App::class)->defaultLocale,
- $routeKey
+ $routeKey,
);
}
diff --git a/system/Common.php b/system/Common.php
index d5880acf03..863ff3cdba 100644
--- a/system/Common.php
+++ b/system/Common.php
@@ -146,7 +146,7 @@ if (! function_exists('command')) {
// @codeCoverageIgnoreStart
throw new InvalidArgumentException(sprintf(
'Unable to parse input near "... %s ...".',
- substr($command, $cursor, 10)
+ substr($command, $cursor, 10),
));
// @codeCoverageIgnoreEnd
}
@@ -470,7 +470,7 @@ if (! function_exists('force_https')) {
function force_https(
int $duration = 31_536_000,
?RequestInterface $request = null,
- ?ResponseInterface $response = null
+ ?ResponseInterface $response = null,
): void {
$request ??= service('request');
@@ -1065,7 +1065,7 @@ if (! function_exists('slash_item')) {
'Cannot convert "%s::$%s" of type "%s" to type "string".',
App::class,
$item,
- gettype($configItem)
+ gettype($configItem),
));
}
diff --git a/system/ComposerScripts.php b/system/ComposerScripts.php
index 661247dab5..993483c577 100644
--- a/system/ComposerScripts.php
+++ b/system/ComposerScripts.php
@@ -102,7 +102,7 @@ final class ComposerScripts
/** @var SplFileInfo $file */
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(rtrim($directory, '\\/'), FilesystemIterator::SKIP_DOTS),
- RecursiveIteratorIterator::CHILD_FIRST
+ RecursiveIteratorIterator::CHILD_FIRST,
) as $file) {
$path = $file->getPathname();
@@ -146,7 +146,7 @@ final class ComposerScripts
/** @var SplFileInfo $file */
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($originDir, FilesystemIterator::SKIP_DOTS),
- RecursiveIteratorIterator::SELF_FIRST
+ RecursiveIteratorIterator::SELF_FIRST,
) as $file) {
$origin = $file->getPathname();
$target = $targetDir . substr($origin, $dirLen);
diff --git a/system/Config/DotEnv.php b/system/Config/DotEnv.php
index d4a7d9e873..7e95d1352f 100644
--- a/system/Config/DotEnv.php
+++ b/system/Config/DotEnv.php
@@ -164,7 +164,7 @@ class DotEnv
%1$s # and the closing quote
.*$ # and discard any string after the closing quote
/mx',
- $quote
+ $quote,
);
$value = preg_replace($regexPattern, '$1', $value);
@@ -206,7 +206,7 @@ class DotEnv
return $nestedVariable;
},
- $value
+ $value,
);
}
diff --git a/system/Config/Factories.php b/system/Config/Factories.php
index b845d5825f..fd7d6a3239 100644
--- a/system/Config/Factories.php
+++ b/system/Config/Factories.php
@@ -106,7 +106,7 @@ final class Factories
}
throw new InvalidArgumentException(
- 'Already defined in Factories: ' . $component . ' ' . $alias . ' -> ' . self::$aliases[$component][$alias]
+ 'Already defined in Factories: ' . $component . ' ' . $alias . ' -> ' . self::$aliases[$component][$alias],
);
}
@@ -448,7 +448,7 @@ final class Factories
self::$options[$component],
self::$aliases[$component],
self::$instances[$component],
- self::$updated[$component]
+ self::$updated[$component],
);
return;
diff --git a/system/Config/Services.php b/system/Config/Services.php
index 06e8daa9ce..f5c5a2db4a 100644
--- a/system/Config/Services.php
+++ b/system/Config/Services.php
@@ -213,7 +213,7 @@ class Services extends BaseService
$config,
new URI($options['baseURI'] ?? null),
$response,
- $options
+ $options,
);
}
@@ -267,7 +267,7 @@ class Services extends BaseService
*/
public static function exceptions(
?ExceptionsConfig $config = null,
- bool $getShared = true
+ bool $getShared = true,
) {
if ($getShared) {
return static::getSharedInstance('exceptions', $config);
@@ -569,7 +569,7 @@ class Services extends BaseService
$config,
AppServices::get('uri'),
'php://input',
- new UserAgent()
+ new UserAgent(),
);
}
@@ -689,7 +689,7 @@ class Services extends BaseService
if (! class_exists($driverName) || ! is_a($driverName, SessionBaseHandler::class, true)) {
throw new InvalidArgumentException(sprintf(
'Invalid session handler "%s" provided.',
- $driverName
+ $driverName,
));
}
@@ -721,7 +721,7 @@ class Services extends BaseService
public static function siteurifactory(
?App $config = null,
?Superglobals $superglobals = null,
- bool $getShared = true
+ bool $getShared = true,
) {
if ($getShared) {
return static::getSharedInstance('siteurifactory', $config, $superglobals);
@@ -741,7 +741,7 @@ class Services extends BaseService
public static function superglobals(
?array $server = null,
?array $get = null,
- bool $getShared = true
+ bool $getShared = true,
) {
if ($getShared) {
return static::getSharedInstance('superglobals', $server, $get);
diff --git a/system/DataCaster/Cast/ArrayCast.php b/system/DataCaster/Cast/ArrayCast.php
index 4bb0f4c740..1deddea6fc 100644
--- a/system/DataCaster/Cast/ArrayCast.php
+++ b/system/DataCaster/Cast/ArrayCast.php
@@ -24,7 +24,7 @@ class ArrayCast extends BaseCast implements CastInterface
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): array {
if (! is_string($value)) {
self::invalidTypeValueError($value);
@@ -40,7 +40,7 @@ class ArrayCast extends BaseCast implements CastInterface
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): string {
return serialize($value);
}
diff --git a/system/DataCaster/Cast/BaseCast.php b/system/DataCaster/Cast/BaseCast.php
index c3df0efee1..afe80982e3 100644
--- a/system/DataCaster/Cast/BaseCast.php
+++ b/system/DataCaster/Cast/BaseCast.php
@@ -20,7 +20,7 @@ abstract class BaseCast implements CastInterface
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): mixed {
return $value;
}
@@ -28,7 +28,7 @@ abstract class BaseCast implements CastInterface
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): mixed {
return $value;
}
diff --git a/system/DataCaster/Cast/BooleanCast.php b/system/DataCaster/Cast/BooleanCast.php
index e4a3fde093..6554081e15 100644
--- a/system/DataCaster/Cast/BooleanCast.php
+++ b/system/DataCaster/Cast/BooleanCast.php
@@ -24,7 +24,7 @@ class BooleanCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): bool {
// For PostgreSQL
if ($value === 't') {
diff --git a/system/DataCaster/Cast/CSVCast.php b/system/DataCaster/Cast/CSVCast.php
index 42dd3709a1..d77c64c87b 100644
--- a/system/DataCaster/Cast/CSVCast.php
+++ b/system/DataCaster/Cast/CSVCast.php
@@ -24,7 +24,7 @@ class CSVCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): array {
if (! is_string($value)) {
self::invalidTypeValueError($value);
@@ -36,7 +36,7 @@ class CSVCast extends BaseCast
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): string {
if (! is_array($value)) {
self::invalidTypeValueError($value);
diff --git a/system/DataCaster/Cast/CastInterface.php b/system/DataCaster/Cast/CastInterface.php
index ff93dc2860..f90f2b227e 100644
--- a/system/DataCaster/Cast/CastInterface.php
+++ b/system/DataCaster/Cast/CastInterface.php
@@ -27,7 +27,7 @@ interface CastInterface
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): mixed;
/**
@@ -42,6 +42,6 @@ interface CastInterface
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): mixed;
}
diff --git a/system/DataCaster/Cast/DatetimeCast.php b/system/DataCaster/Cast/DatetimeCast.php
index 83e66d0221..2953debfbf 100644
--- a/system/DataCaster/Cast/DatetimeCast.php
+++ b/system/DataCaster/Cast/DatetimeCast.php
@@ -28,7 +28,7 @@ class DatetimeCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): Time {
if (! is_string($value)) {
self::invalidTypeValueError($value);
@@ -56,7 +56,7 @@ class DatetimeCast extends BaseCast
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): string {
if (! $value instanceof Time) {
self::invalidTypeValueError($value);
diff --git a/system/DataCaster/Cast/FloatCast.php b/system/DataCaster/Cast/FloatCast.php
index 7ced2e2653..d217382626 100644
--- a/system/DataCaster/Cast/FloatCast.php
+++ b/system/DataCaster/Cast/FloatCast.php
@@ -24,7 +24,7 @@ class FloatCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): float {
if (! is_float($value) && ! is_string($value)) {
self::invalidTypeValueError($value);
diff --git a/system/DataCaster/Cast/IntBoolCast.php b/system/DataCaster/Cast/IntBoolCast.php
index 56977c842f..5aa1f2b2eb 100644
--- a/system/DataCaster/Cast/IntBoolCast.php
+++ b/system/DataCaster/Cast/IntBoolCast.php
@@ -24,7 +24,7 @@ final class IntBoolCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): bool {
if (! is_int($value) && ! is_string($value)) {
self::invalidTypeValueError($value);
@@ -36,7 +36,7 @@ final class IntBoolCast extends BaseCast
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): int {
if (! is_bool($value)) {
self::invalidTypeValueError($value);
diff --git a/system/DataCaster/Cast/IntegerCast.php b/system/DataCaster/Cast/IntegerCast.php
index e16683b1fb..f65baf8315 100644
--- a/system/DataCaster/Cast/IntegerCast.php
+++ b/system/DataCaster/Cast/IntegerCast.php
@@ -24,7 +24,7 @@ class IntegerCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): int {
if (! is_string($value) && ! is_int($value)) {
self::invalidTypeValueError($value);
diff --git a/system/DataCaster/Cast/JsonCast.php b/system/DataCaster/Cast/JsonCast.php
index 316070aaed..5ca10b385b 100644
--- a/system/DataCaster/Cast/JsonCast.php
+++ b/system/DataCaster/Cast/JsonCast.php
@@ -28,7 +28,7 @@ class JsonCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): array|stdClass {
if (! is_string($value)) {
self::invalidTypeValueError($value);
@@ -50,7 +50,7 @@ class JsonCast extends BaseCast
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): string {
try {
$output = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR);
diff --git a/system/DataCaster/Cast/TimestampCast.php b/system/DataCaster/Cast/TimestampCast.php
index 52a4d88f9e..e33938d3e2 100644
--- a/system/DataCaster/Cast/TimestampCast.php
+++ b/system/DataCaster/Cast/TimestampCast.php
@@ -26,7 +26,7 @@ class TimestampCast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): Time {
if (! is_int($value) && ! is_string($value)) {
self::invalidTypeValueError($value);
@@ -38,7 +38,7 @@ class TimestampCast extends BaseCast
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): int {
if (! $value instanceof Time) {
self::invalidTypeValueError($value);
diff --git a/system/DataCaster/Cast/URICast.php b/system/DataCaster/Cast/URICast.php
index 63f4d2271a..f9e2f561a2 100644
--- a/system/DataCaster/Cast/URICast.php
+++ b/system/DataCaster/Cast/URICast.php
@@ -26,7 +26,7 @@ class URICast extends BaseCast
public static function get(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): URI {
if (! is_string($value)) {
self::invalidTypeValueError($value);
@@ -38,7 +38,7 @@ class URICast extends BaseCast
public static function set(
mixed $value,
array $params = [],
- ?object $helper = null
+ ?object $helper = null,
): string {
if (! $value instanceof URI) {
self::invalidTypeValueError($value);
diff --git a/system/DataCaster/DataCaster.php b/system/DataCaster/DataCaster.php
index 5a6786a033..47eac2ff7b 100644
--- a/system/DataCaster/DataCaster.php
+++ b/system/DataCaster/DataCaster.php
@@ -68,7 +68,7 @@ final class DataCaster
?array $castHandlers = null,
?array $types = null,
private readonly ?object $helper = null,
- private readonly bool $strict = true
+ private readonly bool $strict = true,
) {
$this->castHandlers = array_merge($this->castHandlers, $castHandlers);
@@ -83,7 +83,7 @@ final class DataCaster
&& ! is_subclass_of($handler, EntityCastInterface::class)
) {
throw new InvalidArgumentException(
- 'Invalid class type. It must implement CastInterface. class: ' . $handler
+ 'Invalid class type. It must implement CastInterface. class: ' . $handler,
);
}
}
@@ -169,7 +169,7 @@ final class DataCaster
if (! isset($handlers[$type])) {
throw new InvalidArgumentException(
- 'No such handler for "' . $field . '". Invalid type: ' . $type
+ 'No such handler for "' . $field . '". Invalid type: ' . $type,
);
}
diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php
index 36a5f23f7a..010ac17b19 100644
--- a/system/Database/BaseBuilder.php
+++ b/system/Database/BaseBuilder.php
@@ -807,7 +807,7 @@ class BaseBuilder
'/\s*(!?=|<>|IS(?:\s+NOT)?)\s*$/i',
$k,
$match,
- PREG_OFFSET_CAPTURE
+ PREG_OFFSET_CAPTURE,
)
) {
$k = substr($k, 0, $match[0][1]);
@@ -2022,8 +2022,8 @@ class BaseBuilder
' = ' . $value :
' = VALUES(' . $value . ')'),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
);
$this->QBOptions['sql'] = $sql;
@@ -2291,10 +2291,10 @@ class BaseBuilder
$this->removeAlias($this->QBFrom[0]),
true,
null,
- false
+ false,
),
array_keys($this->QBSet),
- array_values($this->QBSet)
+ array_values($this->QBSet),
);
if ($reset) {
@@ -2328,10 +2328,10 @@ class BaseBuilder
$this->removeAlias($this->QBFrom[0]),
true,
$escape,
- false
+ false,
),
array_keys($this->QBSet),
- array_values($this->QBSet)
+ array_values($this->QBSet),
);
if (! $this->testMode) {
@@ -2653,8 +2653,8 @@ class BaseBuilder
' = ' . $value :
' = ' . $alias . '.' . $value),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
) . "\n";
$sql .= "FROM (\n{:_table_:}";
@@ -2678,8 +2678,8 @@ class BaseBuilder
)
),
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
);
$this->QBOptions['sql'] = $sql;
@@ -2694,10 +2694,10 @@ class BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . "\n";
}
@@ -2924,8 +2924,8 @@ class BaseBuilder
)
),
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
);
// convert binds in where
@@ -2949,10 +2949,10 @@ class BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . "\n";
}
@@ -3160,7 +3160,7 @@ class BaseBuilder
'/((?:^|\s+)AND\s+|(?:^|\s+)OR\s+)/i',
$qbkey['condition'],
-1,
- PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
+ PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY,
);
foreach ($conditions as &$condition) {
@@ -3170,7 +3170,7 @@ class BaseBuilder
|| preg_match(
'/^(\(?)(.*)(' . preg_quote($op, '/') . ')\s*(.*(?|!|=|\sIS NULL|\sIS NOT NULL|\sEXISTS|\sBETWEEN|\sLIKE|\sIN\s*\(|\s)/i',
- trim($str)
+ trim($str),
) === 1;
}
@@ -3470,7 +3470,7 @@ class BaseBuilder
return preg_match_all(
'/' . implode('|', $this->pregOperators) . '/i',
$str,
- $match
+ $match,
) >= 1 ? ($list ? $match[0] : $match[0][0]) : false;
}
@@ -3501,7 +3501,7 @@ class BaseBuilder
return preg_match_all(
'/' . implode('|', $pregOperators) . '/i',
$whereKey,
- $match
+ $match,
) >= 1 ? $match[0] : false;
}
diff --git a/system/Database/BaseConnection.php b/system/Database/BaseConnection.php
index e38c682adb..b7107d19a3 100644
--- a/system/Database/BaseConnection.php
+++ b/system/Database/BaseConnection.php
@@ -424,7 +424,7 @@ abstract class BaseConnection implements ConnectionInterface
$connectionErrors[] = sprintf(
'Main connection [%s]: %s',
$this->DBDriver,
- $e->getMessage()
+ $e->getMessage(),
);
log_message('error', 'Error connecting to the database: ' . $e);
}
@@ -450,7 +450,7 @@ abstract class BaseConnection implements ConnectionInterface
'Failover #%d [%s]: %s',
++$index,
$this->DBDriver,
- $e->getMessage()
+ $e->getMessage(),
);
log_message('error', 'Error connecting to the database: ' . $e);
}
@@ -467,7 +467,7 @@ abstract class BaseConnection implements ConnectionInterface
throw new DatabaseException(sprintf(
'Unable to connect to the database.%s%s',
PHP_EOL,
- implode(PHP_EOL, $connectionErrors)
+ implode(PHP_EOL, $connectionErrors),
));
}
}
@@ -688,7 +688,7 @@ abstract class BaseConnection implements ConnectionInterface
throw new DatabaseException(
$exception->getMessage(),
$exception->getCode(),
- $exception
+ $exception,
);
}
@@ -1220,7 +1220,7 @@ abstract class BaseConnection implements ConnectionInterface
. str_replace(
$this->escapeChar,
$this->escapeChar . $this->escapeChar,
- $item
+ $item,
)
. $this->escapeChar;
}
@@ -1277,7 +1277,7 @@ abstract class BaseConnection implements ConnectionInterface
return preg_replace(
'/' . $this->pregEscapeChar[0] . '?([^' . $this->pregEscapeChar[1] . '\.]+)' . $this->pregEscapeChar[1] . '?\./i',
$this->pregEscapeChar[2] . '$1' . $this->pregEscapeChar[3] . '.',
- $item
+ $item,
);
}
}
@@ -1286,7 +1286,7 @@ abstract class BaseConnection implements ConnectionInterface
return preg_replace(
'/' . $this->pregEscapeChar[0] . '?([^' . $this->pregEscapeChar[1] . '\.]+)' . $this->pregEscapeChar[1] . '?(\.)?/i',
$this->pregEscapeChar[2] . '$1' . $this->pregEscapeChar[3] . '$2',
- $item
+ $item,
);
}
@@ -1386,7 +1386,7 @@ abstract class BaseConnection implements ConnectionInterface
$this->likeEscapeChar . '%',
$this->likeEscapeChar . '_',
],
- $str
+ $str,
);
}
@@ -1522,7 +1522,7 @@ abstract class BaseConnection implements ConnectionInterface
$key = array_search(
strtolower($tableName),
array_map(strtolower(...), $this->dataCache['table_names']),
- true
+ true,
);
// table doesn't exist but still in cache - lets reset cache, it can be rebuilt later
diff --git a/system/Database/BaseUtils.php b/system/Database/BaseUtils.php
index 27b369c5cb..26957ffe01 100644
--- a/system/Database/BaseUtils.php
+++ b/system/Database/BaseUtils.php
@@ -217,7 +217,7 @@ abstract class BaseUtils
$line[] = $enclosure . str_replace(
$enclosure,
$enclosure . $enclosure,
- (string) $item
+ (string) $item,
) . $enclosure;
}
diff --git a/system/Database/Forge.php b/system/Database/Forge.php
index 974c45848d..83cf1b88d9 100644
--- a/system/Database/Forge.php
+++ b/system/Database/Forge.php
@@ -234,8 +234,8 @@ class Forge
$ifNotExists ? $this->createDatabaseIfStr : $this->createDatabaseStr,
$this->db->escapeIdentifier($dbName),
$this->db->charset,
- $this->db->DBCollat
- )
+ $this->db->DBCollat,
+ ),
)) {
// @codeCoverageIgnoreStart
if ($this->db->DBDebug) {
@@ -294,7 +294,7 @@ class Forge
}
if (! $this->db->query(
- sprintf($this->dropDatabaseStr, $this->db->escapeIdentifier($dbName))
+ sprintf($this->dropDatabaseStr, $this->db->escapeIdentifier($dbName)),
)) {
if ($this->db->DBDebug) {
throw new DatabaseException('Unable to drop the specified database.');
@@ -307,7 +307,7 @@ class Forge
$key = array_search(
strtolower($dbName),
array_map(strtolower(...), $this->db->dataCache['db_names']),
- true
+ true,
);
if ($key !== false) {
unset($this->db->dataCache['db_names'][$key]);
@@ -425,7 +425,7 @@ class Forge
$tableField = '',
string $onUpdate = '',
string $onDelete = '',
- string $fkName = ''
+ string $fkName = '',
): Forge {
$fieldName = (array) $fieldName;
$tableField = (array) $tableField;
@@ -525,7 +525,7 @@ class Forge
$sql = sprintf(
(string) $this->dropConstraintStr,
$this->db->escapeIdentifiers($this->db->DBPrefix . $table),
- $this->db->escapeIdentifiers($foreignName)
+ $this->db->escapeIdentifiers($foreignName),
);
if ($sql === '') {
@@ -618,7 +618,7 @@ class Forge
'CREATE TABLE',
$this->db->escapeIdentifiers($table),
$processedFields,
- $this->_createTableAttributes($attributes)
+ $this->_createTableAttributes($attributes),
);
}
@@ -668,7 +668,7 @@ class Forge
$key = array_search(
strtolower($this->db->DBPrefix . $tableName),
array_map(strtolower(...), $this->db->dataCache['table_names']),
- true
+ true,
);
if ($key !== false) {
@@ -723,14 +723,14 @@ class Forge
$result = $this->db->query(sprintf(
$this->renameTableStr,
$this->db->escapeIdentifiers($this->db->DBPrefix . $tableName),
- $this->db->escapeIdentifiers($this->db->DBPrefix . $newTableName)
+ $this->db->escapeIdentifiers($this->db->DBPrefix . $newTableName),
));
if ($result && ! empty($this->db->dataCache['table_names'])) {
$key = array_search(
strtolower($this->db->DBPrefix . $tableName),
array_map(strtolower(...), $this->db->dataCache['table_names']),
- true
+ true,
);
if ($key !== false) {
@@ -1112,7 +1112,7 @@ class Forge
$this->fields = array_combine(
array_map(static fn ($columnName) => $columnName->name, $fieldData),
- array_fill(0, count($fieldData), [])
+ array_fill(0, count($fieldData), []),
);
}
diff --git a/system/Database/MigrationRunner.php b/system/Database/MigrationRunner.php
index 13919c7853..0411e1593a 100644
--- a/system/Database/MigrationRunner.php
+++ b/system/Database/MigrationRunner.php
@@ -605,7 +605,7 @@ class MigrationRunner
CLI::color(lang('Migrations.added'), 'yellow'),
$migration->namespace,
$migration->version,
- $migration->class
+ $migration->class,
);
}
}
@@ -625,7 +625,7 @@ class MigrationRunner
CLI::color(lang('Migrations.removed'), 'yellow'),
$history->namespace,
$history->version,
- $history->class
+ $history->class,
);
}
}
diff --git a/system/Database/MySQLi/Builder.php b/system/Database/MySQLi/Builder.php
index 8c1de9d9f9..b8d0fa545d 100644
--- a/system/Database/MySQLi/Builder.php
+++ b/system/Database/MySQLi/Builder.php
@@ -106,8 +106,8 @@ class Builder extends BaseBuilder
)
),
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
) . "\n";
$sql .= "SET\n";
@@ -119,8 +119,8 @@ class Builder extends BaseBuilder
' = ' . $value :
' = ' . $alias . '.' . $value),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
);
$this->QBOptions['sql'] = $sql;
@@ -135,10 +135,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . "\n";
}
diff --git a/system/Database/MySQLi/Connection.php b/system/Database/MySQLi/Connection.php
index f98f51fb3e..fa542e5708 100644
--- a/system/Database/MySQLi/Connection.php
+++ b/system/Database/MySQLi/Connection.php
@@ -116,7 +116,7 @@ class Connection extends BaseConnection
if ($this->strictOn) {
$this->mysqli->options(
MYSQLI_INIT_COMMAND,
- "SET SESSION sql_mode = CONCAT(@@sql_mode, ',', 'STRICT_ALL_TABLES')"
+ "SET SESSION sql_mode = CONCAT(@@sql_mode, ',', 'STRICT_ALL_TABLES')",
);
} else {
$this->mysqli->options(
@@ -128,7 +128,7 @@ class Connection extends BaseConnection
'STRICT_ALL_TABLES', ''),
'STRICT_TRANS_TABLES,', ''),
',STRICT_TRANS_TABLES', ''),
- 'STRICT_TRANS_TABLES', '')"
+ 'STRICT_TRANS_TABLES', '')",
);
}
}
@@ -175,7 +175,7 @@ class Connection extends BaseConnection
$ssl['cert'] ?? null,
$ssl['ca'] ?? null,
$ssl['capath'] ?? null,
- $ssl['cipher'] ?? null
+ $ssl['cipher'] ?? null,
);
}
@@ -190,7 +190,7 @@ class Connection extends BaseConnection
$this->database,
$port,
$socket,
- $clientFlags
+ $clientFlags,
)) {
// Prior to version 5.7.3, MySQL silently downgrades to an unencrypted connection if SSL setup fails
if (($clientFlags & MYSQLI_CLIENT_SSL) !== 0 && version_compare($this->mysqli->client_info, 'mysqlnd 5.7.3', '<=')
@@ -381,7 +381,7 @@ class Connection extends BaseConnection
return str_replace(
[$this->likeEscapeChar, '%', '_'],
['\\' . $this->likeEscapeChar, '\\%', '\\_'],
- $str
+ $str,
);
}
diff --git a/system/Database/MySQLi/Forge.php b/system/Database/MySQLi/Forge.php
index c47ff4ded3..fe207f5267 100644
--- a/system/Database/MySQLi/Forge.php
+++ b/system/Database/MySQLi/Forge.php
@@ -258,7 +258,7 @@ class Forge extends BaseForge
{
$sql = sprintf(
'ALTER TABLE %s DROP PRIMARY KEY',
- $this->db->escapeIdentifiers($this->db->DBPrefix . $table)
+ $this->db->escapeIdentifiers($this->db->DBPrefix . $table),
);
return $this->db->query($sql);
diff --git a/system/Database/OCI8/Builder.php b/system/Database/OCI8/Builder.php
index 5a65ffe9b7..5b586761e2 100644
--- a/system/Database/OCI8/Builder.php
+++ b/system/Database/OCI8/Builder.php
@@ -92,10 +92,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . " FROM DUAL\n";
}
@@ -287,8 +287,8 @@ class Builder extends BaseBuilder
)
),
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
) . ")\n";
$sql .= "WHEN MATCHED THEN UPDATE\n";
@@ -302,8 +302,8 @@ class Builder extends BaseBuilder
' = ' . $value :
' = ' . $alias . '.' . $value),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
);
$this->QBOptions['sql'] = $sql;
@@ -318,10 +318,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)) . ' FROM DUAL',
- $values
- )
+ $values,
+ ),
) . "\n";
}
@@ -392,8 +392,8 @@ class Builder extends BaseBuilder
)
),
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
) . ")\n";
$sql .= "WHEN MATCHED THEN UPDATE SET\n";
@@ -405,8 +405,8 @@ class Builder extends BaseBuilder
" = {$value}" :
" = {$alias}.{$value}"),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
);
$sql .= "\nWHEN NOT MATCHED THEN INSERT (" . implode(', ', $keys) . ")\nVALUES ";
@@ -427,10 +427,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . " FROM DUAL\n";
}
@@ -477,8 +477,8 @@ class Builder extends BaseBuilder
)
),
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
);
// convert binds in where
@@ -491,7 +491,7 @@ class Builder extends BaseBuilder
$sql .= ' ' . str_replace(
'WHERE ',
'AND ',
- $this->compileWhereHaving('QBWhere')
+ $this->compileWhereHaving('QBWhere'),
) . ')';
$this->QBOptions['sql'] = $sql;
@@ -506,10 +506,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . " FROM DUAL\n";
}
diff --git a/system/Database/OCI8/Connection.php b/system/Database/OCI8/Connection.php
index c59d588cce..0ad7b66815 100644
--- a/system/Database/OCI8/Connection.php
+++ b/system/Database/OCI8/Connection.php
@@ -523,7 +523,7 @@ class Connection extends BaseConnection
$sql = sprintf(
'BEGIN %s (' . substr(str_repeat(',%s', count($params)), 1) . '); END;',
$procedureName,
- ...array_map(static fn ($row) => $row['name'], $params)
+ ...array_map(static fn ($row) => $row['name'], $params),
);
$this->resetStmtId = false;
@@ -554,7 +554,7 @@ class Connection extends BaseConnection
$param['name'],
$param['value'],
$param['length'] ?? -1,
- $param['type'] ?? SQLT_CHR
+ $param['type'] ?? SQLT_CHR,
);
}
}
diff --git a/system/Database/OCI8/Forge.php b/system/Database/OCI8/Forge.php
index 7d81cff8b5..4b09372d77 100644
--- a/system/Database/OCI8/Forge.php
+++ b/system/Database/OCI8/Forge.php
@@ -112,7 +112,7 @@ class Forge extends BaseForge
$fields = array_map(
fn ($field) => $this->db->escapeIdentifiers(trim($field)),
- is_string($columnNamesToDrop) ? explode(',', $columnNamesToDrop) : $columnNamesToDrop
+ is_string($columnNamesToDrop) ? explode(',', $columnNamesToDrop) : $columnNamesToDrop,
);
return $sql . ' DROP (' . implode(',', $fields) . ') CASCADE CONSTRAINT INVALIDATE';
diff --git a/system/Database/Postgre/Builder.php b/system/Database/Postgre/Builder.php
index 21fa222c75..bf6e9416dc 100644
--- a/system/Database/Postgre/Builder.php
+++ b/system/Database/Postgre/Builder.php
@@ -357,8 +357,8 @@ class Builder extends BaseBuilder
' = ' . $value :
' = ' . $that->cast($alias . '.' . $value, $that->getFieldType($table, $key))),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
) . "\n";
$sql .= "FROM (\n{:_table_:}";
@@ -381,8 +381,8 @@ class Builder extends BaseBuilder
. $that->cast($alias . '.' . $value, $that->getFieldType($table, $value));
},
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
);
$this->QBOptions['sql'] = $sql;
@@ -397,10 +397,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . "\n";
}
@@ -528,8 +528,8 @@ class Builder extends BaseBuilder
" = {$value}" :
" = {$alias}.{$value}"),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
);
$this->QBOptions['sql'] = $sql;
@@ -584,15 +584,15 @@ class Builder extends BaseBuilder
return $table . '.' . $key . ' = '
. $that->cast(
$alias . '.' . $value,
- $that->getFieldType($table, $key)
+ $that->getFieldType($table, $key),
);
}
return $table . '.' . $value . ' = ' . $alias . '.' . $value;
},
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
);
// convert binds in where
@@ -605,7 +605,7 @@ class Builder extends BaseBuilder
$sql .= ' ' . str_replace(
'WHERE ',
'AND ',
- $this->compileWhereHaving('QBWhere')
+ $this->compileWhereHaving('QBWhere'),
);
$this->QBOptions['sql'] = $sql;
@@ -620,10 +620,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . "\n";
}
diff --git a/system/Database/SQLSRV/Builder.php b/system/Database/SQLSRV/Builder.php
index 1aeaf0a4e6..ec4d411956 100644
--- a/system/Database/SQLSRV/Builder.php
+++ b/system/Database/SQLSRV/Builder.php
@@ -764,8 +764,8 @@ class Builder extends BaseBuilder
)
),
array_keys($constraints),
- $constraints
- )
+ $constraints,
+ ),
) . ")\n";
$sql .= "WHEN MATCHED THEN UPDATE SET\n";
@@ -777,8 +777,8 @@ class Builder extends BaseBuilder
' = ' . $value :
" = {$alias}.{$value}"),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
);
$sql .= "\nWHEN NOT MATCHED THEN INSERT (" . implode(', ', $keys) . ")\nVALUES ";
@@ -792,8 +792,8 @@ class Builder extends BaseBuilder
. 'isnull(IDENT_CURRENT(\'' . $fullTableName . '\')+IDENT_INCR(\''
. $fullTableName . "'),1)) ELSE {$alias}.{$columnName} END"
: "{$alias}.{$columnName}",
- $keys
- )
+ $keys,
+ ),
) . ');'
);
diff --git a/system/Database/SQLSRV/Forge.php b/system/Database/SQLSRV/Forge.php
index 18d792a6ee..f187b9981f 100644
--- a/system/Database/SQLSRV/Forge.php
+++ b/system/Database/SQLSRV/Forge.php
@@ -134,12 +134,12 @@ class Forge extends BaseForge
$sql = sprintf(
$this->createDatabaseIfStr,
$dbName,
- $this->db->escapeIdentifier($dbName)
+ $this->db->escapeIdentifier($dbName),
);
} else {
$sql = sprintf(
$this->createDatabaseStr,
- $this->db->escapeIdentifier($dbName)
+ $this->db->escapeIdentifier($dbName),
);
}
@@ -381,8 +381,8 @@ class Forge extends BaseForge
$maxLength = max(
array_map(
static fn ($value): int => strlen($value),
- $attributes['CONSTRAINT']
- )
+ $attributes['CONSTRAINT'],
+ ),
);
$attributes['TYPE'] = 'VARCHAR';
diff --git a/system/Database/SQLite3/Builder.php b/system/Database/SQLite3/Builder.php
index 744b64448f..64091cf8a2 100644
--- a/system/Database/SQLite3/Builder.php
+++ b/system/Database/SQLite3/Builder.php
@@ -196,8 +196,8 @@ class Builder extends BaseBuilder
" = {$value}" :
" = {$alias}.{$value}"),
array_keys($updateFields),
- $updateFields
- )
+ $updateFields,
+ ),
);
$this->QBOptions['sql'] = $sql;
@@ -268,10 +268,10 @@ class Builder extends BaseBuilder
static fn ($value): string => 'SELECT ' . implode(', ', array_map(
static fn ($key, $index): string => $index . ' ' . $key,
$keys,
- $value
+ $value,
)),
- $values
- )
+ $values,
+ ),
) . "\n";
}
diff --git a/system/Database/SQLite3/Table.php b/system/Database/SQLite3/Table.php
index 61d4aee753..095d96a2d3 100644
--- a/system/Database/SQLite3/Table.php
+++ b/system/Database/SQLite3/Table.php
@@ -308,7 +308,7 @@ class Table
$this->keys = array_filter(
$this->keys,
- static fn ($index): bool => count(array_intersect($index['fields'], $fieldNames)) === count($index['fields'])
+ static fn ($index): bool => count(array_intersect($index['fields'], $fieldNames)) === count($index['fields']),
);
// Unique/Index keys
@@ -334,7 +334,7 @@ class Table
$this->forge->addForeignKey(
$foreignKey->column_name,
trim($foreignKey->foreign_table_name, $this->db->DBPrefix),
- $foreignKey->foreign_column_name
+ $foreignKey->foreign_column_name,
);
}
@@ -358,15 +358,15 @@ class Table
$exFields = implode(
', ',
- array_map(fn ($item) => $this->db->protectIdentifiers($item), $exFields)
+ array_map(fn ($item) => $this->db->protectIdentifiers($item), $exFields),
);
$newFields = implode(
', ',
- array_map(fn ($item) => $this->db->protectIdentifiers($item), $newFields)
+ array_map(fn ($item) => $this->db->protectIdentifiers($item), $newFields),
);
$this->db->query(
- "INSERT INTO {$this->prefixedTableName}({$newFields}) SELECT {$exFields} FROM {$this->db->DBPrefix}temp_{$this->tableName}"
+ "INSERT INTO {$this->prefixedTableName}({$newFields}) SELECT {$exFields} FROM {$this->db->DBPrefix}temp_{$this->tableName}",
);
}
diff --git a/system/Debug/BaseExceptionHandler.php b/system/Debug/BaseExceptionHandler.php
index 4305265d2d..3966b2ee1b 100644
--- a/system/Debug/BaseExceptionHandler.php
+++ b/system/Debug/BaseExceptionHandler.php
@@ -61,7 +61,7 @@ abstract class BaseExceptionHandler
RequestInterface $request,
ResponseInterface $response,
int $statusCode,
- int $exitCode
+ int $exitCode,
);
/**
@@ -221,7 +221,7 @@ abstract class BaseExceptionHandler
"{$format} %s\n%s",
$n + $start + 1,
strip_tags($row),
- implode('', $tags[0])
+ implode('', $tags[0]),
);
} else {
$out .= sprintf('' . $format . ' %s', $n + $start + 1, $row) . "\n";
diff --git a/system/Debug/ExceptionHandler.php b/system/Debug/ExceptionHandler.php
index d6f97b76a3..8283e1ff53 100644
--- a/system/Debug/ExceptionHandler.php
+++ b/system/Debug/ExceptionHandler.php
@@ -47,7 +47,7 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa
RequestInterface $request,
ResponseInterface $response,
int $statusCode,
- int $exitCode
+ int $exitCode,
): void {
// ResponseTrait needs these properties.
$this->request = $request;
@@ -68,10 +68,10 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa
'HTTP/%s %s %s',
$request->getProtocolVersion(),
$response->getStatusCode(),
- $response->getReasonPhrase()
+ $response->getReasonPhrase(),
),
true,
- $statusCode
+ $statusCode,
);
}
@@ -129,7 +129,7 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa
protected function determineView(
Throwable $exception,
string $templatePath,
- int $statusCode = 500
+ int $statusCode = 500,
): string {
// Production environments should have a custom exception file.
$view = 'production.php';
@@ -138,7 +138,7 @@ final class ExceptionHandler extends BaseExceptionHandler implements ExceptionHa
in_array(
strtolower(ini_get('display_errors')),
['1', 'true', 'on', 'yes'],
- true
+ true,
)
) {
$view = 'error_exception.php';
diff --git a/system/Debug/ExceptionHandlerInterface.php b/system/Debug/ExceptionHandlerInterface.php
index d0379e2abd..05915c638f 100644
--- a/system/Debug/ExceptionHandlerInterface.php
+++ b/system/Debug/ExceptionHandlerInterface.php
@@ -27,6 +27,6 @@ interface ExceptionHandlerInterface
RequestInterface $request,
ResponseInterface $response,
int $statusCode,
- int $exitCode
+ int $exitCode,
): void;
}
diff --git a/system/Debug/Exceptions.php b/system/Debug/Exceptions.php
index aa353732c1..3293d75929 100644
--- a/system/Debug/Exceptions.php
+++ b/system/Debug/Exceptions.php
@@ -164,7 +164,7 @@ class Exceptions
$this->request,
$this->response,
$statusCode,
- $exitCode
+ $exitCode,
);
return;
@@ -270,7 +270,7 @@ class Exceptions
in_array(
strtolower(ini_get('display_errors')),
['1', 'true', 'on', 'yes'],
- true
+ true,
)
) {
$view = 'error_exception.php';
@@ -462,7 +462,7 @@ class Exceptions
'errFile' => clean_path($file ?? ''),
'errLine' => $line ?? 0,
'trace' => self::renderBacktrace($trace),
- ]
+ ],
);
return true;
@@ -567,7 +567,7 @@ class Exceptions
"{$format} %s\n%s",
$n + $start + 1,
strip_tags($row),
- implode('', $tags[0])
+ implode('', $tags[0]),
);
} else {
$out .= sprintf('' . $format . ' %s', $n + $start + 1, $row) . "\n";
@@ -611,7 +611,7 @@ class Exceptions
$frame['class'],
$frame['type'],
$frame['function'],
- $args
+ $args,
);
}
diff --git a/system/Debug/Toolbar.php b/system/Debug/Toolbar.php
index b939e208fd..9a884b60f5 100644
--- a/system/Debug/Toolbar.php
+++ b/system/Debug/Toolbar.php
@@ -58,7 +58,7 @@ class Toolbar
log_message(
'critical',
'Toolbar collector does not exist (' . $collector . ').'
- . ' Please check $collectors in the app/Config/Toolbar.php file.'
+ . ' Please check $collectors in the app/Config/Toolbar.php file.',
);
continue;
@@ -391,7 +391,7 @@ class Toolbar
$stats['startTime'],
$stats['totalTime'],
$request,
- $response
+ $response,
);
helper('filesystem');
@@ -439,8 +439,8 @@ class Toolbar
'//',
'' . $script,
$response->getBody(),
- 1
- )
+ 1,
+ ),
);
return;
@@ -516,7 +516,7 @@ class Toolbar
$history = new History();
$history->setFiles(
$debugbarTime[0],
- $this->config->maxHistory
+ $this->config->maxHistory,
);
$data['collectors'][] = $history->getAsArray();
diff --git a/system/Debug/Toolbar/Collectors/Database.php b/system/Debug/Toolbar/Collectors/Database.php
index 32f7f07091..df876422aa 100644
--- a/system/Debug/Toolbar/Collectors/Database.php
+++ b/system/Debug/Toolbar/Collectors/Database.php
@@ -228,7 +228,7 @@ class Database extends BaseCollector
$uniqueCount,
$uniqueCount > 1 ? 'of them' : '',
$connectionCount,
- $connectionCount > 1 ? 's' : ''
+ $connectionCount > 1 ? 's' : '',
);
}
diff --git a/system/Debug/Toolbar/Collectors/Routes.php b/system/Debug/Toolbar/Collectors/Routes.php
index 561399fbf3..47c808e7ac 100644
--- a/system/Debug/Toolbar/Collectors/Routes.php
+++ b/system/Debug/Toolbar/Collectors/Routes.php
@@ -109,7 +109,7 @@ class Routes extends BaseCollector
' | default: '
. var_export(
$param->isDefaultValueAvailable() ? $param->getDefaultValue() : null,
- true
+ true,
),
];
}
diff --git a/system/Email/Email.php b/system/Email/Email.php
index c52c362308..17b24c9de5 100644
--- a/system/Email/Email.php
+++ b/system/Email/Email.php
@@ -1659,7 +1659,7 @@ class Email
$this->finalBody = preg_replace_callback(
'/\{unwrap\}(.*?)\{\/unwrap\}/si',
$this->removeNLCallback(...),
- $this->finalBody
+ $this->finalBody,
);
}
@@ -1900,7 +1900,7 @@ class Email
$this->SMTPPort,
$errno,
$errstr,
- $this->SMTPTimeout
+ $this->SMTPTimeout,
);
if (! is_resource($this->SMTPConnect)) {
@@ -1921,7 +1921,7 @@ class Email
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
| STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
| STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
- | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT
+ | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT,
);
if ($crypto !== true) {
diff --git a/system/Entity/Entity.php b/system/Entity/Entity.php
index ff2fba1f70..0e54c722e3 100644
--- a/system/Entity/Entity.php
+++ b/system/Entity/Entity.php
@@ -138,7 +138,7 @@ class Entity implements JsonSerializable
array_merge($this->defaultCastHandlers, $this->castHandlers),
null,
null,
- false
+ false,
);
$this->syncOriginal();
@@ -185,7 +185,7 @@ class Entity implements JsonSerializable
if (is_array($this->datamap)) {
$keys = array_unique(
- [...array_diff($keys, $this->datamap), ...array_keys($this->datamap)]
+ [...array_diff($keys, $this->datamap), ...array_keys($this->datamap)],
);
}
diff --git a/system/Events/Events.php b/system/Events/Events.php
index 25149729a0..97f4e81d03 100644
--- a/system/Events/Events.php
+++ b/system/Events/Events.php
@@ -212,7 +212,7 @@ class Events
if ($check === $listener) {
unset(
static::$listeners[$eventName][1][$index],
- static::$listeners[$eventName][2][$index]
+ static::$listeners[$eventName][2][$index],
);
return true;
diff --git a/system/Exceptions/FrameworkException.php b/system/Exceptions/FrameworkException.php
index 1fe47be49a..7ea9e6d7d5 100644
--- a/system/Exceptions/FrameworkException.php
+++ b/system/Exceptions/FrameworkException.php
@@ -68,7 +68,7 @@ class FrameworkException extends RuntimeException implements ExceptionInterface
// @codeCoverageIgnoreStart
$message = sprintf(
'The framework needs the following extension(s) installed and loaded: %s.',
- $extension
+ $extension,
);
// @codeCoverageIgnoreEnd
} else {
diff --git a/system/Files/FileCollection.php b/system/Files/FileCollection.php
index 179bbc1d49..369cea9ddd 100644
--- a/system/Files/FileCollection.php
+++ b/system/Files/FileCollection.php
@@ -103,7 +103,7 @@ class FileCollection implements Countable, IteratorAggregate
$pattern = str_replace(
['#', '.', '*', '?'],
['\#', '\.', '.*', '.'],
- $pattern
+ $pattern,
);
$pattern = "#\\A{$pattern}\\z#";
}
diff --git a/system/Filters/Filters.php b/system/Filters/Filters.php
index f6dbdf0878..28f712f661 100644
--- a/system/Filters/Filters.php
+++ b/system/Filters/Filters.php
@@ -202,7 +202,7 @@ class Filters
$result = $class->before(
$this->request,
- $this->argumentsClass[$className] ?? null
+ $this->argumentsClass[$className] ?? null,
);
if ($result instanceof RequestInterface) {
@@ -241,7 +241,7 @@ class Filters
$result = $class->after(
$this->request,
$this->response,
- $this->argumentsClass[$className] ?? null
+ $this->argumentsClass[$className] ?? null,
);
if ($result instanceof ResponseInterface) {
@@ -648,7 +648,7 @@ class Filters
@trigger_error(
'Setting lowercase HTTP method key "' . strtolower($method) . '" is deprecated.'
. ' Use uppercase HTTP method like "' . strtoupper($method) . '".',
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
$found = true;
@@ -744,7 +744,7 @@ class Filters
if ($check && array_key_exists($name, $this->arguments)) {
throw new ConfigException(
'"' . $name . '" already has arguments: '
- . (($this->arguments[$name] === null) ? 'null' : implode(',', $this->arguments[$name]))
+ . (($this->arguments[$name] === null) ? 'null' : implode(',', $this->arguments[$name])),
);
}
diff --git a/system/Filters/PerformanceMetrics.php b/system/Filters/PerformanceMetrics.php
index f2371c7a8d..51b3fa9f57 100644
--- a/system/Filters/PerformanceMetrics.php
+++ b/system/Filters/PerformanceMetrics.php
@@ -53,7 +53,7 @@ class PerformanceMetrics implements FilterInterface
(string) $benchmark->getElapsedTime('total_execution'),
number_format(memory_get_peak_usage() / 1024 / 1024, 3),
],
- $body
+ $body,
);
$response->setBody($output);
diff --git a/system/HTTP/CURLRequest.php b/system/HTTP/CURLRequest.php
index 90157e4e05..9ce664f808 100644
--- a/system/HTTP/CURLRequest.php
+++ b/system/HTTP/CURLRequest.php
@@ -342,7 +342,7 @@ class CURLRequest extends OutgoingRequest
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
diff --git a/system/HTTP/Cors.php b/system/HTTP/Cors.php
index f7619c9f83..2f151a7383 100644
--- a/system/HTTP/Cors.php
+++ b/system/HTTP/Cors.php
@@ -107,7 +107,7 @@ class Cors
if (in_array('*', $this->config[$name], true) && $count > 1) {
throw new ConfigException(
"If wildcard is specified, you must set `'{$name}' => ['*']`."
- . ' But using wildcard is not recommended.'
+ . ' But using wildcard is not recommended.',
);
}
}
@@ -121,7 +121,7 @@ class Cors
throw new ConfigException(
'When responding to a credentialed request, '
. 'the server must not specify the "*" wildcard for the '
- . $header . ' response-header value.'
+ . $header . ' response-header value.',
);
}
}
@@ -176,7 +176,7 @@ class Cors
$response->setHeader(
'Access-Control-Allow-Headers',
- implode(', ', $this->config['allowedHeaders'])
+ implode(', ', $this->config['allowedHeaders']),
);
}
@@ -187,7 +187,7 @@ class Cors
$response->setHeader(
'Access-Control-Allow-Methods',
- implode(', ', $this->config['allowedMethods'])
+ implode(', ', $this->config['allowedMethods']),
);
}
@@ -223,7 +223,7 @@ class Cors
if ($this->config['exposedHeaders'] !== []) {
$response->setHeader(
'Access-Control-Expose-Headers',
- implode(', ', $this->config['exposedHeaders'])
+ implode(', ', $this->config['exposedHeaders']),
);
}
}
diff --git a/system/HTTP/Exceptions/RedirectException.php b/system/HTTP/Exceptions/RedirectException.php
index 3047bf9603..5ebec8e1f7 100644
--- a/system/HTTP/Exceptions/RedirectException.php
+++ b/system/HTTP/Exceptions/RedirectException.php
@@ -45,7 +45,7 @@ class RedirectException extends Exception implements ResponsableInterface, HTTPE
throw new InvalidArgumentException(
'RedirectException::__construct() first argument must be a string or ResponseInterface',
0,
- $this
+ $this,
);
}
@@ -55,7 +55,7 @@ class RedirectException extends Exception implements ResponsableInterface, HTTPE
if ($this->response->getHeaderLine('Location') === '' && $this->response->getHeaderLine('Refresh') === '') {
throw new LogicException(
- 'The Response object passed to RedirectException does not contain a redirect address.'
+ 'The Response object passed to RedirectException does not contain a redirect address.',
);
}
@@ -76,7 +76,7 @@ class RedirectException extends Exception implements ResponsableInterface, HTTPE
service('logger')->info(
'REDIRECTED ROUTE at '
- . ($this->response->getHeaderLine('Location') ?: substr($this->response->getHeaderLine('Refresh'), 6))
+ . ($this->response->getHeaderLine('Location') ?: substr($this->response->getHeaderLine('Refresh'), 6)),
);
return $this->response;
diff --git a/system/HTTP/Files/FileCollection.php b/system/HTTP/Files/FileCollection.php
index add2c3c03f..120652e8bd 100644
--- a/system/HTTP/Files/FileCollection.php
+++ b/system/HTTP/Files/FileCollection.php
@@ -189,7 +189,7 @@ class FileCollection
$array['type'] ?? null,
($array['size'] ?? null) === null ? null : (int) $array['size'],
$array['error'] ?? null,
- $array['full_path'] ?? null
+ $array['full_path'] ?? null,
);
}
@@ -219,7 +219,7 @@ class FileCollection
$stack = [&$pointer];
$iterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator($value),
- RecursiveIteratorIterator::SELF_FIRST
+ RecursiveIteratorIterator::SELF_FIRST,
);
foreach ($iterator as $key => $val) {
diff --git a/system/HTTP/Message.php b/system/HTTP/Message.php
index 71c4429f28..6b2a5e8ba2 100644
--- a/system/HTTP/Message.php
+++ b/system/HTTP/Message.php
@@ -119,7 +119,7 @@ class Message implements MessageInterface
if ($this->hasMultipleHeaders($name)) {
throw new InvalidArgumentException(
'The header "' . $name . '" already has multiple headers.'
- . ' You cannot use getHeaderLine().'
+ . ' You cannot use getHeaderLine().',
);
}
diff --git a/system/HTTP/MessageTrait.php b/system/HTTP/MessageTrait.php
index 2f6e57a90c..9ae7737a8e 100644
--- a/system/HTTP/MessageTrait.php
+++ b/system/HTTP/MessageTrait.php
@@ -182,7 +182,7 @@ trait MessageTrait
if ($this->hasMultipleHeaders($name)) {
throw new InvalidArgumentException(
'The header "' . $name . '" already has multiple headers.'
- . ' You cannot change them. If you really need to change, remove the header first.'
+ . ' You cannot change them. If you really need to change, remove the header first.',
);
}
}
diff --git a/system/HTTP/Negotiate.php b/system/HTTP/Negotiate.php
index 33938c8f07..ff4d299876 100644
--- a/system/HTTP/Negotiate.php
+++ b/system/HTTP/Negotiate.php
@@ -90,7 +90,7 @@ class Negotiate
$supported,
$this->request->getHeaderLine('accept-charset'),
false,
- true
+ true,
);
// If no charset is shown as a match, ignore the directive
@@ -154,7 +154,7 @@ class Negotiate
?string $header = null,
bool $enforceTypes = false,
bool $strictMatch = false,
- bool $matchLocales = false
+ bool $matchLocales = false,
): string {
if ($supported === []) {
throw HTTPException::forEmptySupportedNegotiations();
@@ -212,7 +212,7 @@ class Negotiate
if (preg_match(
'/^(?P.+?)=(?P"|\')?(?P.*?)(?:\k)?$/',
$pair,
- $param
+ $param,
)) {
$parameters[trim($param['name'])] = trim($param['value']);
}
diff --git a/system/HTTP/OutgoingRequest.php b/system/HTTP/OutgoingRequest.php
index e62f072415..eba5babdf6 100644
--- a/system/HTTP/OutgoingRequest.php
+++ b/system/HTTP/OutgoingRequest.php
@@ -43,7 +43,7 @@ class OutgoingRequest extends Message implements OutgoingRequestInterface
?URI $uri = null,
array $headers = [],
$body = null,
- string $version = '1.1'
+ string $version = '1.1',
) {
$this->method = $method;
$this->uri = $uri;
diff --git a/system/HTTP/RequestTrait.php b/system/HTTP/RequestTrait.php
index dfa4b663db..39f4269ef1 100644
--- a/system/HTTP/RequestTrait.php
+++ b/system/HTTP/RequestTrait.php
@@ -72,7 +72,7 @@ trait RequestTrait
if (! empty($proxyIPs) && (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs)))) {
throw new ConfigException(
- 'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'
+ 'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.',
);
}
diff --git a/system/HTTP/ResponseInterface.php b/system/HTTP/ResponseInterface.php
index 382a2847c5..58f11a0f90 100644
--- a/system/HTTP/ResponseInterface.php
+++ b/system/HTTP/ResponseInterface.php
@@ -341,7 +341,7 @@ interface ResponseInterface extends MessageInterface
$prefix = '',
$secure = false,
$httponly = false,
- $samesite = null
+ $samesite = null,
);
/**
diff --git a/system/HTTP/ResponseTrait.php b/system/HTTP/ResponseTrait.php
index eaf60f2b38..b23e40a904 100644
--- a/system/HTTP/ResponseTrait.php
+++ b/system/HTTP/ResponseTrait.php
@@ -407,14 +407,14 @@ trait ResponseTrait
header(
$name . ': ' . $value->getValueLine(),
false,
- $this->getStatusCode()
+ $this->getStatusCode(),
);
} else {
foreach ($value as $header) {
header(
$name . ': ' . $header->getValueLine(),
false,
- $this->getStatusCode()
+ $this->getStatusCode(),
);
}
}
@@ -512,7 +512,7 @@ trait ResponseTrait
$prefix = '',
$secure = null,
$httponly = null,
- $samesite = null
+ $samesite = null,
) {
if ($name instanceof Cookie) {
$this->cookieStore = $this->cookieStore->put($name);
diff --git a/system/HTTP/SiteURI.php b/system/HTTP/SiteURI.php
index 2be70a7773..63181b89fe 100644
--- a/system/HTTP/SiteURI.php
+++ b/system/HTTP/SiteURI.php
@@ -95,7 +95,7 @@ class SiteURI extends URI
App $configApp,
string $relativePath = '',
?string $host = null,
- ?string $scheme = null
+ ?string $scheme = null,
) {
$this->indexPage = $configApp->indexPage;
@@ -142,7 +142,7 @@ class SiteURI extends URI
private function determineBaseURL(
App $configApp,
?string $host,
- ?string $scheme
+ ?string $scheme,
): URI {
$baseURL = $this->normalizeBaseURL($configApp);
@@ -199,7 +199,7 @@ class SiteURI extends URI
// Validate baseURL
if (filter_var($baseURL, FILTER_VALIDATE_URL) === false) {
throw new ConfigException(
- 'Config\App::$baseURL "' . $baseURL . '" is not a valid URL.'
+ 'Config\App::$baseURL "' . $baseURL . '" is not a valid URL.',
);
}
@@ -266,7 +266,7 @@ class SiteURI extends URI
$this->getAuthority(),
$this->getPath(),
$this->getQuery(),
- $this->getFragment()
+ $this->getFragment(),
);
}
diff --git a/system/HTTP/URI.php b/system/HTTP/URI.php
index 2b386797fe..c9d634d384 100644
--- a/system/HTTP/URI.php
+++ b/system/HTTP/URI.php
@@ -163,7 +163,7 @@ class URI implements Stringable
?string $authority = null,
?string $path = null,
?string $query = null,
- ?string $fragment = null
+ ?string $fragment = null,
): string {
$uri = '';
if ($scheme !== null && $scheme !== '') {
@@ -638,7 +638,7 @@ class URI implements Stringable
$this->getAuthority(),
$path, // Absolute URIs should use a "/" for an empty path
$this->getQuery(),
- $this->getFragment()
+ $this->getFragment(),
);
}
@@ -1022,7 +1022,7 @@ class URI implements Stringable
$path = preg_replace_callback(
'/(?:[^' . static::CHAR_UNRESERVED . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/',
static fn (array $matches): string => rawurlencode($matches[0]),
- $path
+ $path,
);
return $path;
@@ -1170,7 +1170,7 @@ class URI implements Stringable
$params = array_map(static fn (string $chunk): ?string => preg_replace_callback(
'/^(?[^&=]+?)(?:\[[^&=]*\])?=(?[^&=]+)/',
static fn (array $match): string => str_replace($match['key'], bin2hex($match['key']), $match[0]),
- urldecode($chunk)
+ urldecode($chunk),
), $query);
$params = implode('&', $params);
diff --git a/system/Helpers/Array/ArrayHelper.php b/system/Helpers/Array/ArrayHelper.php
index fc5bc46295..1b812e6a51 100644
--- a/system/Helpers/Array/ArrayHelper.php
+++ b/system/Helpers/Array/ArrayHelper.php
@@ -54,12 +54,12 @@ final class ArrayHelper
'/(? str_replace('\.', '.', $key),
- $segments
+ $segments,
);
}
@@ -130,7 +130,7 @@ final class ArrayHelper
{
if (str_ends_with($index, '*') || str_contains($index, '*.*')) {
throw new InvalidArgumentException(
- 'You must set key right after "*". Invalid index: "' . $index . '"'
+ 'You must set key right after "*". Invalid index: "' . $index . '"',
);
}
@@ -210,7 +210,7 @@ final class ArrayHelper
array $result,
array $row,
array $indexes,
- bool $includeEmpty
+ bool $includeEmpty,
): array {
if (($index = array_shift($indexes)) === null) {
$result[] = $row;
diff --git a/system/Helpers/cookie_helper.php b/system/Helpers/cookie_helper.php
index 27007104e6..18239fe2eb 100644
--- a/system/Helpers/cookie_helper.php
+++ b/system/Helpers/cookie_helper.php
@@ -46,7 +46,7 @@ if (! function_exists('set_cookie')) {
string $prefix = '',
?bool $secure = null,
?bool $httpOnly = null,
- ?string $sameSite = null
+ ?string $sameSite = null,
): void {
$response = service('response');
$response->setCookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httpOnly, $sameSite);
diff --git a/system/Helpers/date_helper.php b/system/Helpers/date_helper.php
index c0b4d5ebe1..c16da65928 100644
--- a/system/Helpers/date_helper.php
+++ b/system/Helpers/date_helper.php
@@ -43,7 +43,7 @@ if (! function_exists('now')) {
$year,
$hour,
$minute,
- $second
+ $second,
);
return mktime($hour, $minute, $second, $month, $day, $year);
diff --git a/system/Helpers/filesystem_helper.php b/system/Helpers/filesystem_helper.php
index 6acf6f38f8..9c0196b475 100644
--- a/system/Helpers/filesystem_helper.php
+++ b/system/Helpers/filesystem_helper.php
@@ -87,7 +87,7 @@ if (! function_exists('directory_mirror')) {
*/
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($originDir, FilesystemIterator::SKIP_DOTS),
- RecursiveIteratorIterator::SELF_FIRST
+ RecursiveIteratorIterator::SELF_FIRST,
) as $file) {
$origin = $file->getPathname();
$target = $targetDir . substr($origin, $dirLen);
@@ -159,7 +159,7 @@ if (! function_exists('delete_files')) {
try {
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
- RecursiveIteratorIterator::CHILD_FIRST
+ RecursiveIteratorIterator::CHILD_FIRST,
) as $object) {
$filename = $object->getFilename();
if (! $hidden && $filename[0] === '.') {
@@ -202,7 +202,7 @@ if (! function_exists('get_filenames')) {
string $sourceDir,
?bool $includePath = false,
bool $hidden = false,
- bool $includeDir = true
+ bool $includeDir = true,
): array {
$files = [];
@@ -212,7 +212,7 @@ if (! function_exists('get_filenames')) {
try {
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($sourceDir, RecursiveDirectoryIterator::SKIP_DOTS | FilesystemIterator::FOLLOW_SYMLINKS),
- RecursiveIteratorIterator::SELF_FIRST
+ RecursiveIteratorIterator::SELF_FIRST,
) as $name => $object) {
$basename = pathinfo($name, PATHINFO_BASENAME);
if (! $hidden && $basename[0] === '.') {
diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php
index 679008c973..ae4505c265 100644
--- a/system/Helpers/form_helper.php
+++ b/system/Helpers/form_helper.php
@@ -741,7 +741,7 @@ if (! function_exists('validation_show_error')) {
$errors = array_filter(validation_errors(), static fn ($key): bool => preg_match(
'/^' . str_replace(['\.\*', '\*\.'], ['\..+', '.+\.'], preg_quote($field, '/')) . '$/',
- $key
+ $key,
) === 1, ARRAY_FILTER_USE_KEY);
if ($errors === []) {
diff --git a/system/Helpers/html_helper.php b/system/Helpers/html_helper.php
index 3eb55a6d51..9dcf82536e 100644
--- a/system/Helpers/html_helper.php
+++ b/system/Helpers/html_helper.php
@@ -238,7 +238,7 @@ if (! function_exists('link_tag')) {
string $title = '',
string $media = '',
bool $indexPage = false,
- string $hreflang = ''
+ string $hreflang = '',
): string {
$attributes = [];
// extract fields if needed
diff --git a/system/Helpers/inflector_helper.php b/system/Helpers/inflector_helper.php
index abc565652e..fb4ef6cb39 100644
--- a/system/Helpers/inflector_helper.php
+++ b/system/Helpers/inflector_helper.php
@@ -278,7 +278,7 @@ if (! function_exists('is_pluralizable')) {
'wisdom',
'work',
],
- true
+ true,
);
return ! $uncountables;
diff --git a/system/Helpers/security_helper.php b/system/Helpers/security_helper.php
index af6257e5e3..d42ac0dda7 100644
--- a/system/Helpers/security_helper.php
+++ b/system/Helpers/security_helper.php
@@ -35,7 +35,7 @@ if (! function_exists('strip_image_tags')) {
'#
`]+)).*?\>#i',
],
'\\2',
- $str
+ $str,
);
}
}
diff --git a/system/Helpers/text_helper.php b/system/Helpers/text_helper.php
index 8733049c88..6e9db74730 100644
--- a/system/Helpers/text_helper.php
+++ b/system/Helpers/text_helper.php
@@ -152,7 +152,7 @@ if (! function_exists('entities_to_ascii')) {
return str_replace(
['&', '<', '>', '"', ''', '-'],
['&', '<', '>', '"', "'", '-'],
- $str
+ $str,
);
}
@@ -193,7 +193,7 @@ if (! function_exists('word_censor')) {
$str = preg_replace(
"/({$delim})(" . $badword . ")({$delim})/i",
"\\1{$replacement}\\3",
- $str
+ $str,
);
} elseif (preg_match_all("/{$delim}(" . $badword . "){$delim}/i", $str, $matches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) >= 1) {
$matches = $matches[1];
@@ -205,7 +205,7 @@ if (! function_exists('word_censor')) {
$str,
str_repeat('#', $length),
$matches[$i][1],
- $length
+ $length,
);
}
}
@@ -235,7 +235,7 @@ if (! function_exists('highlight_code')) {
$str = str_replace(
['<', '>', '', '?>', '<%', '%>', '\\', ''],
['<', '>', 'phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'],
- $str
+ $str,
);
// The highlight_string function requires that the text be surrounded
@@ -254,7 +254,7 @@ if (! function_exists('highlight_code')) {
"$1\n\n",
'',
],
- $str
+ $str,
);
// Replace our markers back to PHP tags.
@@ -275,7 +275,7 @@ if (! function_exists('highlight_code')) {
'\\',
'</script>',
],
- $str
+ $str,
);
}
}
@@ -581,7 +581,7 @@ if (! function_exists('random_string')) {
case 'crypto':
if ($len % 2 !== 0) {
throw new InvalidArgumentException(
- 'You must set an even number to the second parameter when you use `crypto`.'
+ 'You must set an even number to the second parameter when you use `crypto`.',
);
}
@@ -611,7 +611,7 @@ if (! function_exists('_from_random')) {
{
if ($length <= 0) {
throw new InvalidArgumentException(
- sprintf('A strictly positive length is expected, "%d" given.', $length)
+ sprintf('A strictly positive length is expected, "%d" given.', $length),
);
}
@@ -619,7 +619,7 @@ if (! function_exists('_from_random')) {
$bits = (int) ceil(log($poolSize, 2.0));
if ($bits <= 0 || $bits > 56) {
throw new InvalidArgumentException(
- 'The length of the alphabet must in the [2^1, 2^56] range.'
+ 'The length of the alphabet must in the [2^1, 2^56] range.',
);
}
diff --git a/system/Helpers/url_helper.php b/system/Helpers/url_helper.php
index b6df3edc3c..4d49447bf3 100644
--- a/system/Helpers/url_helper.php
+++ b/system/Helpers/url_helper.php
@@ -359,7 +359,7 @@ if (! function_exists('auto_link')) {
'#([a-z][a-z0-9+\-.]*://|www\.)[a-z0-9]+(-+[a-z0-9]+)*(\.[a-z0-9]+(-+[a-z0-9]+)*)+(/([^\s()<>;]+\w)?/?)?#i',
$str,
$matches,
- PREG_OFFSET_CAPTURE | PREG_SET_ORDER
+ PREG_OFFSET_CAPTURE | PREG_SET_ORDER,
) >= 1
) {
// Set our target HTML if using popup links.
@@ -386,7 +386,7 @@ if (! function_exists('auto_link')) {
'#([\w\.\-\+]+@[a-z0-9\-]+\.[a-z0-9\-\.]+[^[:punct:]\s])#i',
$str,
$matches,
- PREG_OFFSET_CAPTURE
+ PREG_OFFSET_CAPTURE,
) >= 1
) {
foreach (array_reverse($matches[0]) as $match) {
diff --git a/system/Honeypot/Honeypot.php b/system/Honeypot/Honeypot.php
index 2e79daadb0..1b09da4d1a 100644
--- a/system/Honeypot/Honeypot.php
+++ b/system/Honeypot/Honeypot.php
@@ -85,7 +85,7 @@ class Honeypot
$this->config->container = str_ireplace(
'>{template}',
' id="' . $this->config->containerId . '">{template}',
- $this->config->container
+ $this->config->container,
);
}
diff --git a/system/I18n/TimeTrait.php b/system/I18n/TimeTrait.php
index 354b7542e7..bcdc863149 100644
--- a/system/I18n/TimeTrait.php
+++ b/system/I18n/TimeTrait.php
@@ -222,7 +222,7 @@ trait TimeTrait
?int $minutes = null,
?int $seconds = null,
$timezone = null,
- ?string $locale = null
+ ?string $locale = null,
) {
$year ??= date('Y');
$month ??= date('m');
@@ -665,7 +665,7 @@ trait TimeTrait
(int) $minute,
(int) $second,
$this->getTimezoneName(),
- $this->locale
+ $this->locale,
);
}
diff --git a/system/Images/Handlers/GDHandler.php b/system/Images/Handlers/GDHandler.php
index 062a69d892..12ea4e1a72 100644
--- a/system/Images/Handlers/GDHandler.php
+++ b/system/Images/Handlers/GDHandler.php
@@ -322,7 +322,7 @@ class GDHandler extends BaseHandler
// if valid image type, make corresponding image resource
$this->resource = $this->getImageResource(
$this->image()->getPathname(),
- $this->image()->imageType
+ $this->image()->imageType,
);
}
}
diff --git a/system/Language/Language.php b/system/Language/Language.php
index cbea4a5332..9847553127 100644
--- a/system/Language/Language.php
+++ b/system/Language/Language.php
@@ -206,11 +206,11 @@ class Language
$argsString = implode(
', ',
- array_map(static fn ($element): string => '"' . $element . '"', $args)
+ array_map(static fn ($element): string => '"' . $element . '"', $args),
);
$argsUrlEncoded = implode(
', ',
- array_map(static fn ($element): string => '"' . rawurlencode($element) . '"', $args)
+ array_map(static fn ($element): string => '"' . rawurlencode($element) . '"', $args),
);
log_message(
@@ -218,7 +218,7 @@ class Language
'Language.invalidMessageFormat: $message: "' . $message
. '", $args: ' . $argsString
. ' (urlencoded: ' . $argsUrlEncoded . '),'
- . ' MessageFormatter Error: ' . $fmtError
+ . ' MessageFormatter Error: ' . $fmtError,
);
return $message . "\n【Warning】Also, invalid string(s) was passed to the Language class. See log file for details.";
diff --git a/system/Log/Handlers/ChromeLoggerHandler.php b/system/Log/Handlers/ChromeLoggerHandler.php
index 37c7c0ffed..eedea60a15 100644
--- a/system/Log/Handlers/ChromeLoggerHandler.php
+++ b/system/Log/Handlers/ChromeLoggerHandler.php
@@ -160,7 +160,7 @@ class ChromeLoggerHandler extends BaseHandler
}
$data = base64_encode(
- mb_convert_encoding(json_encode($this->json), 'UTF-8', mb_list_encodings())
+ mb_convert_encoding(json_encode($this->json), 'UTF-8', mb_list_encodings()),
);
$response->setHeader($this->header, $data);
diff --git a/system/Model.php b/system/Model.php
index 98e3be0b1f..8734ceec95 100644
--- a/system/Model.php
+++ b/system/Model.php
@@ -373,17 +373,17 @@ class Model extends BaseModel
$allFields = $this->db->protectIdentifiers(
array_map(
static fn ($row) => $row->name,
- $this->db->getFieldData($this->table)
+ $this->db->getFieldData($this->table),
),
false,
- true
+ true,
);
$sql = sprintf(
'INSERT INTO %s (%s) VALUES (%s)',
$table,
implode(',', $allFields),
- substr(str_repeat(',DEFAULT', count($allFields)), 1)
+ substr(str_repeat(',DEFAULT', count($allFields)), 1),
);
} else {
$sql = 'INSERT INTO ' . $table . ' DEFAULT VALUES';
@@ -454,7 +454,7 @@ class Model extends BaseModel
if ($builder->getCompiledQBWhere() === []) {
throw new DatabaseException(
- 'Updates are not allowed unless they contain a "where" or "like" clause.'
+ 'Updates are not allowed unless they contain a "where" or "like" clause.',
);
}
@@ -503,7 +503,7 @@ class Model extends BaseModel
if ($this->useSoftDeletes && ! $purge) {
if ($builder->getCompiledQBWhere() === []) {
throw new DatabaseException(
- 'Deletes are not allowed unless they contain a "where" or "like" clause.'
+ 'Deletes are not allowed unless they contain a "where" or "like" clause.',
);
}
diff --git a/system/Pager/Pager.php b/system/Pager/Pager.php
index 3bdc85388c..6d0f54d14a 100644
--- a/system/Pager/Pager.php
+++ b/system/Pager/Pager.php
@@ -295,7 +295,7 @@ class Pager implements PagerInterface
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
diff --git a/system/Pager/PagerRenderer.php b/system/Pager/PagerRenderer.php
index 64c4c40c53..7257f2becf 100644
--- a/system/Pager/PagerRenderer.php
+++ b/system/Pager/PagerRenderer.php
@@ -148,7 +148,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
@@ -186,7 +186,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
@@ -208,7 +208,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
@@ -230,7 +230,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
@@ -252,7 +252,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
@@ -278,7 +278,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
),
'title' => $i,
'active' => ($i === $this->current),
@@ -341,7 +341,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
@@ -379,7 +379,7 @@ class PagerRenderer
$uri->getAuthority(),
$uri->getPath(),
$uri->getQuery(),
- $uri->getFragment()
+ $uri->getFragment(),
);
}
diff --git a/system/Router/AutoRouter.php b/system/Router/AutoRouter.php
index cad9ecbc17..3a81f3a7bc 100644
--- a/system/Router/AutoRouter.php
+++ b/system/Router/AutoRouter.php
@@ -51,7 +51,7 @@ final class AutoRouter implements AutoRouterInterface
* Whether dashes in URI's should be converted
* to underscores when determining method names.
*/
- private bool $translateURIDashes
+ private bool $translateURIDashes,
) {
}
@@ -118,19 +118,19 @@ final class AutoRouter implements AutoRouterInterface
// Like $routes->cli('hello/(:segment)', 'Home::$1')
if (str_contains($handler, '::$')) {
throw new PageNotFoundException(
- 'Cannot access CLI Route: ' . $uri
+ 'Cannot access CLI Route: ' . $uri,
);
}
if (str_starts_with($handler, $controller . '::' . $methodName)) {
throw new PageNotFoundException(
- 'Cannot access CLI Route: ' . $uri
+ 'Cannot access CLI Route: ' . $uri,
);
}
if ($handler === $controller) {
throw new PageNotFoundException(
- 'Cannot access CLI Route: ' . $uri
+ 'Cannot access CLI Route: ' . $uri,
);
}
}
@@ -153,9 +153,9 @@ final class AutoRouter implements AutoRouterInterface
str_replace(
'/',
'\\',
- $this->defaultNamespace . $this->directory . $controllerName
+ $this->defaultNamespace . $this->directory . $controllerName,
),
- '\\'
+ '\\',
);
}
@@ -199,7 +199,7 @@ final class AutoRouter implements AutoRouterInterface
while ($c-- > 0) {
$segmentConvert = ucfirst(
- $this->translateURIDashes ? str_replace('-', '_', $segments[0]) : $segments[0]
+ $this->translateURIDashes ? str_replace('-', '_', $segments[0]) : $segments[0],
);
// as soon as we encounter any segment that is not PSR-4 compliant, stop searching
if (! $this->isValidSegment($segmentConvert)) {
diff --git a/system/Router/AutoRouterImproved.php b/system/Router/AutoRouterImproved.php
index 6160c0555d..c14c8fe97e 100644
--- a/system/Router/AutoRouterImproved.php
+++ b/system/Router/AutoRouterImproved.php
@@ -121,7 +121,7 @@ final class AutoRouterImproved implements AutoRouterInterface
* Whether dashes in URI's should be converted
* to underscores when determining method names.
*/
- private readonly bool $translateURIDashes
+ private readonly bool $translateURIDashes,
) {
$this->namespace = rtrim($namespace, '\\');
@@ -210,7 +210,7 @@ final class AutoRouterImproved implements AutoRouterInterface
$namespaces = array_map(
fn ($segment): string => $this->translateURI($segment),
- $segments
+ $segments,
);
$controller = '\\' . $this->namespace
@@ -288,7 +288,7 @@ final class AutoRouterImproved implements AutoRouterInterface
strtolower($baseControllerName) === strtolower($this->defaultController)
) {
throw new PageNotFoundException(
- 'Cannot access the default controller "' . $this->controller . '" with the controller name URI path.'
+ 'Cannot access the default controller "' . $this->controller . '" with the controller name URI path.',
);
}
} elseif ($this->searchLastDefaultController()) {
@@ -329,14 +329,14 @@ final class AutoRouterImproved implements AutoRouterInterface
// Prevent access to default controller's method
if (strtolower($baseControllerName) === strtolower($this->defaultController)) {
throw new PageNotFoundException(
- 'Cannot access the default controller "' . $this->controller . '::' . $this->method . '"'
+ 'Cannot access the default controller "' . $this->controller . '::' . $this->method . '"',
);
}
// Prevent access to default method path
if (strtolower($this->method) === strtolower($defaultMethod)) {
throw new PageNotFoundException(
- 'Cannot access the default method "' . $this->method . '" with the method name URI path.'
+ 'Cannot access the default method "' . $this->method . '" with the method name URI path.',
);
}
} elseif (method_exists($this->controller, $defaultMethod)) {
@@ -400,7 +400,7 @@ final class AutoRouterImproved implements AutoRouterInterface
$dir = str_replace(
'\\',
'/',
- ltrim(substr($namespaces, strlen($this->namespace)), '\\')
+ ltrim(substr($namespaces, strlen($this->namespace)), '\\'),
);
if ($dir !== '') {
@@ -417,7 +417,7 @@ final class AutoRouterImproved implements AutoRouterInterface
if ($routeLowerCase === $controller) {
throw new PageNotFoundException(
- 'Cannot access the controller in Defined Routes. Controller: ' . $controllerInRoutes
+ 'Cannot access the controller in Defined Routes. Controller: ' . $controllerInRoutes,
);
}
}
@@ -446,7 +446,7 @@ final class AutoRouterImproved implements AutoRouterInterface
throw new PageNotFoundException(
'The param count in the URI are greater than the controller method params.'
. ' Handler:' . $this->controller . '::' . $this->method
- . ', URI:' . $this->uri
+ . ', URI:' . $this->uri,
);
}
}
@@ -459,7 +459,7 @@ final class AutoRouterImproved implements AutoRouterInterface
throw new PageNotFoundException(
'AutoRouterImproved does not support `_remap()` method.'
- . ' Controller:' . $this->controller
+ . ' Controller:' . $this->controller,
);
} catch (ReflectionException) {
// Do nothing.
@@ -482,7 +482,7 @@ final class AutoRouterImproved implements AutoRouterInterface
. ' when $translateURIDashes is enabled.'
. ' Please use the dash.'
. ' Handler:' . $this->controller . '::' . $this->method
- . ', URI:' . $this->uri
+ . ', URI:' . $this->uri,
);
}
}
@@ -502,7 +502,7 @@ final class AutoRouterImproved implements AutoRouterInterface
if (! in_array(ltrim($classname, '\\'), get_declared_classes(), true)) {
throw new PageNotFoundException(
- '"' . $classname . '" is not found.'
+ '"' . $classname . '" is not found.',
);
}
}
@@ -531,7 +531,7 @@ final class AutoRouterImproved implements AutoRouterInterface
&& ! in_array($method, get_class_methods($this->controller), true)
) {
throw new PageNotFoundException(
- '"' . $this->controller . '::' . $method . '()" is not found.'
+ '"' . $this->controller . '::' . $method . '()" is not found.',
);
}
}
@@ -558,7 +558,7 @@ final class AutoRouterImproved implements AutoRouterInterface
. ' containing uppercase letters ("' . $segment . '")'
. ' when $translateUriToCamelCase is enabled.'
. ' Please use the dash.'
- . ' URI:' . $this->uri
+ . ' URI:' . $this->uri,
);
}
@@ -568,7 +568,7 @@ final class AutoRouterImproved implements AutoRouterInterface
. ' containing double dash ("' . $segment . '")'
. ' when $translateUriToCamelCase is enabled.'
. ' Please use the single dash.'
- . ' URI:' . $this->uri
+ . ' URI:' . $this->uri,
);
}
@@ -576,8 +576,8 @@ final class AutoRouterImproved implements AutoRouterInterface
' ',
'',
ucwords(
- preg_replace('/[\-]+/', ' ', $segment)
- )
+ preg_replace('/[\-]+/', ' ', $segment),
+ ),
);
}
diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php
index faee291a82..400ef6773b 100644
--- a/system/Router/RouteCollection.php
+++ b/system/Router/RouteCollection.php
@@ -634,7 +634,7 @@ class RouteCollection implements RouteCollectionInterface
@trigger_error(
'Passing lowercase HTTP method "' . $verb . '" is deprecated.'
. ' Use uppercase HTTP method like "' . strtoupper($verb) . '".',
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
}
@@ -791,7 +791,7 @@ class RouteCollection implements RouteCollectionInterface
// Merge options other than filters.
$this->currentOptions = array_merge(
$this->currentOptions ?? [],
- $options
+ $options,
);
}
@@ -1026,7 +1026,7 @@ class RouteCollection implements RouteCollectionInterface
@trigger_error(
'Passing lowercase HTTP method "' . $verb . '" is deprecated.'
. ' Use uppercase HTTP method like "' . strtoupper($verb) . '".',
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
}
@@ -1382,7 +1382,7 @@ class RouteCollection implements RouteCollectionInterface
foreach ($placeholders as $index => $placeholder) {
if (! isset($params[$index])) {
throw new InvalidArgumentException(
- 'Missing argument for "' . $placeholder . '" in route "' . $from . '".'
+ 'Missing argument for "' . $placeholder . '" in route "' . $from . '".',
);
}
@@ -1506,7 +1506,7 @@ class RouteCollection implements RouteCollectionInterface
'/\$X/',
static fn ($m): string => '$' . $i,
$to,
- 1
+ 1,
);
}
}
@@ -1773,7 +1773,7 @@ class RouteCollection implements RouteCollectionInterface
@trigger_error(
'Passing lowercase HTTP method "' . $verb . '" is deprecated.'
. ' Use uppercase HTTP method like "' . strtoupper($verb) . '".',
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
}
diff --git a/system/Router/Router.php b/system/Router/Router.php
index 1a2b1393cb..8de447d6cc 100644
--- a/system/Router/Router.php
+++ b/system/Router/Router.php
@@ -167,7 +167,7 @@ class Router implements RouterInterface
$this->collection->getDefaultNamespace(),
$this->collection->getDefaultController(),
$this->collection->getDefaultMethod(),
- $this->translateURIDashes
+ $this->translateURIDashes,
);
} else {
$this->autoRouter = new AutoRouter(
@@ -175,7 +175,7 @@ class Router implements RouterInterface
$this->collection->getDefaultNamespace(),
$this->collection->getDefaultController(),
$this->collection->getDefaultMethod(),
- $this->translateURIDashes
+ $this->translateURIDashes,
);
}
}
@@ -221,7 +221,7 @@ class Router implements RouterInterface
// want this, like in the case of API's.
if (! $this->collection->shouldAutoRoute()) {
throw new PageNotFoundException(
- "Can't find a route for '{$this->collection->getHTTPVerb()}: {$uri}'."
+ "Can't find a route for '{$this->collection->getHTTPVerb()}: {$uri}'.",
);
}
@@ -442,7 +442,7 @@ class Router implements RouterInterface
throw new RedirectException(
preg_replace('#\A' . $routeKey . '\z#u', $redirectTo, $uri),
- $this->collection->getRedirectCode($routeKey)
+ $this->collection->getRedirectCode($routeKey),
);
}
// Store our locale so CodeIgniter object can
@@ -451,7 +451,7 @@ class Router implements RouterInterface
preg_match(
'#^' . str_replace('{locale}', '(?[^/]+)', $matchedKey) . '$#u',
$uri,
- $matched
+ $matched,
);
if ($this->collection->shouldUseSupportedLocalesOnly()
@@ -546,7 +546,7 @@ class Router implements RouterInterface
return $matches[$index] ?? '';
},
- $input
+ $input,
);
}
@@ -736,7 +736,7 @@ class Router implements RouterInterface
&& preg_match('/\A[' . $this->permittedURIChars . ']+\z/iu', $segment) !== 1
) {
throw new BadRequestException(
- 'The URI you submitted has disallowed characters: "' . $segment . '"'
+ 'The URI you submitted has disallowed characters: "' . $segment . '"',
);
}
}
diff --git a/system/Security/Exceptions/SecurityException.php b/system/Security/Exceptions/SecurityException.php
index ed1d768250..09ecc26e6b 100644
--- a/system/Security/Exceptions/SecurityException.php
+++ b/system/Security/Exceptions/SecurityException.php
@@ -50,7 +50,7 @@ class SecurityException extends FrameworkException implements HTTPExceptionInter
{
return new static(
'Invalid UTF-8 characters in ' . $source . ': ' . $string,
- 400
+ 400,
);
}
@@ -66,7 +66,7 @@ class SecurityException extends FrameworkException implements HTTPExceptionInter
{
return new static(
'Invalid Control characters in ' . $source . ': ' . $string,
- 400
+ 400,
);
}
diff --git a/system/Security/Security.php b/system/Security/Security.php
index b6d2660295..5d86dbbe99 100644
--- a/system/Security/Security.php
+++ b/system/Security/Security.php
@@ -530,7 +530,7 @@ class Security implements SecurityInterface
$this->hash,
[
'expires' => $this->config->expires === 0 ? 0 : Time::now()->getTimestamp() + $this->config->expires,
- ]
+ ],
);
$response = service('response');
diff --git a/system/Session/Handlers/BaseHandler.php b/system/Session/Handlers/BaseHandler.php
index 6d7e09e4b6..bc2cdc17af 100644
--- a/system/Session/Handlers/BaseHandler.php
+++ b/system/Session/Handlers/BaseHandler.php
@@ -132,7 +132,7 @@ abstract class BaseHandler implements SessionHandlerInterface
return setcookie(
$this->cookieName,
'',
- ['expires' => 1, 'path' => $this->cookiePath, 'domain' => $this->cookieDomain, 'secure' => $this->cookieSecure, 'httponly' => true]
+ ['expires' => 1, 'path' => $this->cookiePath, 'domain' => $this->cookieDomain, 'secure' => $this->cookieSecure, 'httponly' => true],
);
}
diff --git a/system/Session/Handlers/DatabaseHandler.php b/system/Session/Handlers/DatabaseHandler.php
index d36e9592ce..aeafc48c39 100644
--- a/system/Session/Handlers/DatabaseHandler.php
+++ b/system/Session/Handlers/DatabaseHandler.php
@@ -285,7 +285,7 @@ class DatabaseHandler extends BaseHandler
return $this->db->table($this->table)->where(
'timestamp <',
"now() - INTERVAL {$max_lifetime} second",
- false
+ false,
)->delete() ? 1 : $this->fail();
}
diff --git a/system/Session/Handlers/FileHandler.php b/system/Session/Handlers/FileHandler.php
index 6931ab1c58..5a2e864453 100644
--- a/system/Session/Handlers/FileHandler.php
+++ b/system/Session/Handlers/FileHandler.php
@@ -283,7 +283,7 @@ class FileHandler extends BaseHandler
$pattern = sprintf(
'#\A%s' . $pattern . $this->sessionIDRegex . '\z#',
- preg_quote($this->cookieName, '#')
+ preg_quote($this->cookieName, '#'),
);
$collected = 0;
diff --git a/system/Session/Handlers/MemcachedHandler.php b/system/Session/Handlers/MemcachedHandler.php
index 73133e88d9..744d9556ee 100644
--- a/system/Session/Handlers/MemcachedHandler.php
+++ b/system/Session/Handlers/MemcachedHandler.php
@@ -97,7 +97,7 @@ class MemcachedHandler extends BaseHandler
'#,?([^,:]+)\:(\d{1,5})(?:\:(\d+))?#',
$this->savePath,
$matches,
- PREG_SET_ORDER
+ PREG_SET_ORDER,
) < 1
) {
$this->memcached = null;
@@ -110,7 +110,7 @@ class MemcachedHandler extends BaseHandler
// If Memcached already has this server (or if the port is invalid), skip it
if (in_array($match[1] . ':' . $match[2], $serverList, true)) {
$this->logger->debug(
- 'Session: Memcached server pool already has ' . $match[1] . ':' . $match[2]
+ 'Session: Memcached server pool already has ' . $match[1] . ':' . $match[2],
);
continue;
@@ -118,7 +118,7 @@ class MemcachedHandler extends BaseHandler
if (! $this->memcached->addServer($match[1], (int) $match[2], $match[3] ?? 0)) {
$this->logger->error(
- 'Could not add ' . $match[1] . ':' . $match[2] . ' to Memcached server pool.'
+ 'Could not add ' . $match[1] . ':' . $match[2] . ' to Memcached server pool.',
);
} else {
$serverList[] = $match[1] . ':' . $match[2];
@@ -275,7 +275,7 @@ class MemcachedHandler extends BaseHandler
if (! $this->memcached->set($lockKey, Time::now()->getTimestamp(), 300)) {
$this->logger->error(
- 'Session: Error while trying to obtain lock for ' . $this->keyPrefix . $sessionID
+ 'Session: Error while trying to obtain lock for ' . $this->keyPrefix . $sessionID,
);
return false;
@@ -287,7 +287,7 @@ class MemcachedHandler extends BaseHandler
if ($attempt === 30) {
$this->logger->error(
- 'Session: Unable to obtain lock for ' . $this->keyPrefix . $sessionID . ' after 30 attempts, aborting.'
+ 'Session: Unable to obtain lock for ' . $this->keyPrefix . $sessionID . ' after 30 attempts, aborting.',
);
return false;
@@ -309,7 +309,7 @@ class MemcachedHandler extends BaseHandler
&& $this->memcached->getResultCode() !== Memcached::RES_NOTFOUND
) {
$this->logger->error(
- 'Session: Error while trying to free lock for ' . $this->lockKey
+ 'Session: Error while trying to free lock for ' . $this->lockKey,
);
return false;
diff --git a/system/Session/Handlers/RedisHandler.php b/system/Session/Handlers/RedisHandler.php
index 5e44a2a2be..eeb0604332 100644
--- a/system/Session/Handlers/RedisHandler.php
+++ b/system/Session/Handlers/RedisHandler.php
@@ -180,7 +180,7 @@ class RedisHandler extends BaseHandler
! $redis->connect(
$this->savePath['host'],
$this->savePath['port'],
- $this->savePath['timeout']
+ $this->savePath['timeout'],
)
) {
$this->logger->error('Session: Unable to connect to Redis with the configured settings.');
@@ -188,7 +188,7 @@ class RedisHandler extends BaseHandler
$this->logger->error('Session: Unable to authenticate to Redis instance.');
} elseif (isset($this->savePath['database']) && ! $redis->select($this->savePath['database'])) {
$this->logger->error(
- 'Session: Unable to select Redis database with index ' . $this->savePath['database']
+ 'Session: Unable to select Redis database with index ' . $this->savePath['database'],
);
} else {
$this->redis = $redis;
@@ -318,7 +318,7 @@ class RedisHandler extends BaseHandler
if (isset($this->redis, $this->lockKey)) {
if (($result = $this->redis->del($this->keyPrefix . $id)) !== 1) {
$this->logger->debug(
- 'Session: Redis::del() expected to return 1, got ' . var_export($result, true) . ' instead.'
+ 'Session: Redis::del() expected to return 1, got ' . var_export($result, true) . ' instead.',
);
}
@@ -369,7 +369,7 @@ class RedisHandler extends BaseHandler
(string) Time::now()->getTimestamp(),
// NX -- Only set the key if it does not already exist.
// EX seconds -- Set the specified expire time, in seconds.
- ['nx', 'ex' => 300]
+ ['nx', 'ex' => 300],
);
if (! $result) {
@@ -385,7 +385,7 @@ class RedisHandler extends BaseHandler
if ($attempt === 300) {
$this->logger->error(
'Session: Unable to obtain lock for ' . $this->keyPrefix . $sessionID
- . ' after 300 attempts, aborting.'
+ . ' after 300 attempts, aborting.',
);
return false;
diff --git a/system/Test/CIUnitTestCase.php b/system/Test/CIUnitTestCase.php
index 467e3a61bd..2797e63d81 100644
--- a/system/Test/CIUnitTestCase.php
+++ b/system/Test/CIUnitTestCase.php
@@ -361,7 +361,7 @@ abstract class CIUnitTestCase extends TestCase
$this->assertTrue($result, sprintf(
'Failed asserting that expected message "%s" with level "%s" was logged.',
$expectedMessage ?? '',
- $level
+ $level,
));
return $result;
@@ -377,8 +377,8 @@ abstract class CIUnitTestCase extends TestCase
$message !== '' ? $message : sprintf(
'Failed asserting that logs have a record of message containing "%s" with level "%s".',
$logMessage,
- $level
- )
+ $level,
+ ),
);
}
@@ -417,7 +417,7 @@ abstract class CIUnitTestCase extends TestCase
{
$this->assertNotNull(
$this->getHeaderEmitted($header, $ignoreCase, __METHOD__),
- "Didn't find header for {$header}"
+ "Didn't find header for {$header}",
);
}
@@ -431,7 +431,7 @@ abstract class CIUnitTestCase extends TestCase
{
$this->assertNull(
$this->getHeaderEmitted($header, $ignoreCase, __METHOD__),
- "Found header for {$header}"
+ "Found header for {$header}",
);
}
diff --git a/system/Test/ConfigFromArrayTrait.php b/system/Test/ConfigFromArrayTrait.php
index 3652fa1074..c6beb6e637 100644
--- a/system/Test/ConfigFromArrayTrait.php
+++ b/system/Test/ConfigFromArrayTrait.php
@@ -39,7 +39,7 @@ trait ConfigFromArrayTrait
}
throw new LogicException(
- 'No such property: ' . $classname . '::$' . $key
+ 'No such property: ' . $classname . '::$' . $key,
);
}
diff --git a/system/Test/Constraints/SeeInDatabase.php b/system/Test/Constraints/SeeInDatabase.php
index faf874be9c..d1025bc13d 100644
--- a/system/Test/Constraints/SeeInDatabase.php
+++ b/system/Test/Constraints/SeeInDatabase.php
@@ -68,7 +68,7 @@ class SeeInDatabase extends Constraint
"a row in the table [%s] matches the attributes \n%s\n\n%s",
$table,
$this->toString(false, JSON_PRETTY_PRINT),
- $this->getAdditionalInfo($table)
+ $this->getAdditionalInfo($table),
);
}
@@ -81,7 +81,7 @@ class SeeInDatabase extends Constraint
$similar = $builder->where(
array_key_first($this->data),
- $this->data[array_key_first($this->data)]
+ $this->data[array_key_first($this->data)],
)->limit($this->show)->get()->getResultArray();
if ($similar !== []) {
diff --git a/system/Test/Fabricator.php b/system/Test/Fabricator.php
index 8da0c60fc0..f80ea201b9 100644
--- a/system/Test/Fabricator.php
+++ b/system/Test/Fabricator.php
@@ -437,21 +437,21 @@ class Fabricator
if (isset($this->modifiedFields['unique'][$field])) {
$faker = $faker->unique(
$this->modifiedFields['unique'][$field]['reset'],
- $this->modifiedFields['unique'][$field]['maxRetries']
+ $this->modifiedFields['unique'][$field]['maxRetries'],
);
}
if (isset($this->modifiedFields['optional'][$field])) {
$faker = $faker->optional(
$this->modifiedFields['optional'][$field]['weight'],
- $this->modifiedFields['optional'][$field]['default']
+ $this->modifiedFields['optional'][$field]['default'],
);
}
if (isset($this->modifiedFields['valid'][$field])) {
$faker = $faker->valid(
$this->modifiedFields['valid'][$field]['validator'],
- $this->modifiedFields['valid'][$field]['maxRetries']
+ $this->modifiedFields['valid'][$field]['maxRetries'],
);
}
diff --git a/system/Test/FeatureTestTrait.php b/system/Test/FeatureTestTrait.php
index 13522d8758..eaf49a0a91 100644
--- a/system/Test/FeatureTestTrait.php
+++ b/system/Test/FeatureTestTrait.php
@@ -58,7 +58,7 @@ trait FeatureTestTrait
@trigger_error(
'Passing lowercase HTTP method "' . $route[0] . '" is deprecated.'
. ' Use uppercase HTTP method like "' . strtoupper($route[0]) . '".',
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
}
@@ -168,7 +168,7 @@ trait FeatureTestTrait
@trigger_error(
'Passing lowercase HTTP method "' . $method . '" is deprecated.'
. ' Use uppercase HTTP method like "' . strtoupper($method) . '".',
- E_USER_DEPRECATED
+ E_USER_DEPRECATED,
);
}
@@ -385,7 +385,7 @@ trait FeatureTestTrait
$request->setGlobal($name, $params);
$request->setGlobal(
'request',
- $request->fetchGlobal('post') + $request->fetchGlobal('get')
+ $request->fetchGlobal('post') + $request->fetchGlobal('get'),
);
}
diff --git a/system/Test/Mock/MockInputOutput.php b/system/Test/Mock/MockInputOutput.php
index 750f142a00..87d09832df 100644
--- a/system/Test/Mock/MockInputOutput.php
+++ b/system/Test/Mock/MockInputOutput.php
@@ -74,7 +74,7 @@ final class MockInputOutput extends InputOutput
throw new InvalidArgumentException(
'No such index in output: ' . $index . ', the last index is: '
- . (count($this->outputs) - 1)
+ . (count($this->outputs) - 1),
);
}
@@ -103,7 +103,7 @@ final class MockInputOutput extends InputOutput
{
if ($this->inputs === []) {
throw new LogicException(
- 'No input data. Specifiy input data with `MockInputOutput::setInputs()`.'
+ 'No input data. Specifiy input data with `MockInputOutput::setInputs()`.',
);
}
diff --git a/system/Test/TestResponse.php b/system/Test/TestResponse.php
index f36a9f8ff5..13b1df3aba 100644
--- a/system/Test/TestResponse.php
+++ b/system/Test/TestResponse.php
@@ -153,7 +153,7 @@ class TestResponse
{
Assert::assertTrue(
$this->isOK(),
- "{$this->response->getStatusCode()} is not a successful status code, or Response has an empty body."
+ "{$this->response->getStatusCode()} is not a successful status code, or Response has an empty body.",
);
}
@@ -164,7 +164,7 @@ class TestResponse
{
Assert::assertFalse(
$this->isOK(),
- "{$this->response->getStatusCode()} is an unexpected successful status code, or Response body has content."
+ "{$this->response->getStatusCode()} is an unexpected successful status code, or Response body has content.",
);
}
@@ -287,7 +287,7 @@ class TestResponse
Assert::assertSame(
$value,
$this->response->getHeaderLine($key),
- "The value of '{$key}' header ({$this->response->getHeaderLine($key)}) does not match expected value."
+ "The value of '{$key}' header ({$this->response->getHeaderLine($key)}) does not match expected value.",
);
}
}
@@ -331,7 +331,7 @@ class TestResponse
Assert::assertGreaterThan(
Time::now()->getTimestamp(),
- $this->response->getCookie($key, $prefix)->getExpiresTimestamp()
+ $this->response->getCookie($key, $prefix)->getExpiresTimestamp(),
);
}
@@ -420,7 +420,7 @@ class TestResponse
{
Assert::assertTrue(
$this->domParser->see($search, $element),
- "Text '{$search}' is not seen in response."
+ "Text '{$search}' is not seen in response.",
);
}
@@ -431,7 +431,7 @@ class TestResponse
{
Assert::assertTrue(
$this->domParser->dontSee($search, $element),
- "Text '{$search}' is unexpectedly seen in response."
+ "Text '{$search}' is unexpectedly seen in response.",
);
}
@@ -442,7 +442,7 @@ class TestResponse
{
Assert::assertTrue(
$this->domParser->seeElement($search),
- "Element with selector '{$search}' is not seen in response."
+ "Element with selector '{$search}' is not seen in response.",
);
}
@@ -453,7 +453,7 @@ class TestResponse
{
Assert::assertTrue(
$this->domParser->dontSeeElement($search),
- "Element with selector '{$search}' is unexpectedly seen in response.'"
+ "Element with selector '{$search}' is unexpectedly seen in response.'",
);
}
@@ -464,7 +464,7 @@ class TestResponse
{
Assert::assertTrue(
$this->domParser->seeLink($text, $details),
- "Anchor tag with text '{$text}' is not seen in response."
+ "Anchor tag with text '{$text}' is not seen in response.",
);
}
@@ -475,7 +475,7 @@ class TestResponse
{
Assert::assertTrue(
$this->domParser->seeInField($field, $value),
- "Input named '{$field}' with value '{$value}' is not seen in response."
+ "Input named '{$field}' with value '{$value}' is not seen in response.",
);
}
diff --git a/system/Validation/FormatRules.php b/system/Validation/FormatRules.php
index 7fe16d9d27..502f3ae09c 100644
--- a/system/Validation/FormatRules.php
+++ b/system/Validation/FormatRules.php
@@ -428,7 +428,7 @@ class FormatRules
$scheme = strtolower((string) parse_url($str, PHP_URL_SCHEME));
$validSchemes = explode(
',',
- strtolower($validSchemes ?? 'http,https')
+ strtolower($validSchemes ?? 'http,https'),
);
return in_array($scheme, $validSchemes, true)
diff --git a/system/Validation/Rules.php b/system/Validation/Rules.php
index 7f2f0bd941..e12b8227df 100644
--- a/system/Validation/Rules.php
+++ b/system/Validation/Rules.php
@@ -125,7 +125,7 @@ class Rules
[$field, $whereField, $whereValue] = array_pad(
explode(',', $field),
3,
- null
+ null,
);
// Break the table and field apart
@@ -184,7 +184,7 @@ class Rules
[$field, $ignoreField, $ignoreValue] = array_pad(
explode(',', $field),
3,
- null
+ null,
);
sscanf($field, '%[^.].%[^.]', $table, $field);
@@ -386,7 +386,7 @@ class Rules
?string $otherFields = null,
array $data = [],
?string $error = null,
- ?string $field = null
+ ?string $field = null,
): bool {
if ($otherFields === null || $data === []) {
throw new InvalidArgumentException('You must supply the parameters: otherFields, data.');
@@ -447,7 +447,7 @@ class Rules
?string $param = null,
array $data = [],
?string $error = null,
- ?string $field = null
+ ?string $field = null,
): bool {
if (str_contains($field, '.')) {
return ArrayHelper::dotKeyExists($field, $data);
diff --git a/system/Validation/StrictRules/Rules.php b/system/Validation/StrictRules/Rules.php
index c9b98c4798..2c2a861ca9 100644
--- a/system/Validation/StrictRules/Rules.php
+++ b/system/Validation/StrictRules/Rules.php
@@ -42,7 +42,7 @@ class Rules
string $otherField,
array $data,
?string $error = null,
- ?string $field = null
+ ?string $field = null,
): bool {
if (str_contains($otherField, '.')) {
return $str !== dot_array_search($otherField, $data);
@@ -149,7 +149,7 @@ class Rules
[$field, $whereField, $whereValue] = array_pad(
explode(',', $field),
3,
- null
+ null,
);
// Break the table and field apart
@@ -210,7 +210,7 @@ class Rules
[$field, $ignoreField, $ignoreValue] = array_pad(
explode(',', $field),
3,
- null
+ null,
);
sscanf($field, '%[^.].%[^.]', $table, $field);
@@ -279,7 +279,7 @@ class Rules
string $otherField,
array $data,
?string $error = null,
- ?string $field = null
+ ?string $field = null,
): bool {
if (str_contains($otherField, '.')) {
return $str === dot_array_search($otherField, $data);
@@ -410,7 +410,7 @@ class Rules
?string $otherFields = null,
array $data = [],
?string $error = null,
- ?string $field = null
+ ?string $field = null,
): bool {
return $this->nonStrictRules->required_without($str, $otherFields, $data, $error, $field);
}
@@ -428,7 +428,7 @@ class Rules
?string $param = null,
array $data = [],
?string $error = null,
- ?string $field = null
+ ?string $field = null,
): bool {
if (str_contains($field, '.')) {
return ArrayHelper::dotKeyExists($field, $data);
diff --git a/system/Validation/Validation.php b/system/Validation/Validation.php
index 5b51b403fe..880d3508bb 100644
--- a/system/Validation/Validation.php
+++ b/system/Validation/Validation.php
@@ -177,7 +177,7 @@ class Validation implements ValidationInterface
$values = array_filter(
$flattenedArray,
static fn ($key): bool => preg_match(self::getRegex($field), $key) === 1,
- ARRAY_FILTER_USE_KEY
+ ARRAY_FILTER_USE_KEY,
);
// if keys not found
@@ -208,7 +208,7 @@ class Validation implements ValidationInterface
// Store data that was actually validated.
$this->validated = DotArrayFilter::run(
array_keys($this->rules),
- $this->data
+ $this->data,
);
return true;
@@ -226,7 +226,7 @@ class Validation implements ValidationInterface
. str_replace(
['\.\*', '\*\.'],
['\.[^.]+', '[^.]+\.'],
- preg_quote($field, '/')
+ preg_quote($field, '/'),
)
. '\z/';
}
@@ -248,11 +248,11 @@ class Validation implements ValidationInterface
'check',
null,
$rules,
- $errors
+ $errors,
)->run(
['check' => $value],
null,
- $dbGroup
+ $dbGroup,
);
}
@@ -281,7 +281,7 @@ class Validation implements ValidationInterface
$value,
$rules = null, // @TODO remove `= null`
?array $data = null, // @TODO remove `= null`
- ?string $originalField = null
+ ?string $originalField = null,
): bool {
if ($data === null) {
throw new InvalidArgumentException('You must supply the parameter: data.');
@@ -368,7 +368,7 @@ class Validation implements ValidationInterface
$label,
$param,
(string) $value,
- $originalField
+ $originalField,
);
return false;
@@ -805,7 +805,7 @@ class Validation implements ValidationInterface
throw new LogicException(
'No validation rules for the placeholder: "' . $field
. '". You must set the validation rules for the field.'
- . ' See .'
+ . ' See .',
);
}
@@ -813,7 +813,7 @@ class Validation implements ValidationInterface
foreach ($placeholderRules as $placeholderRule) {
if ($this->retrievePlaceholders($placeholderRule, $data) !== []) {
throw new LogicException(
- 'The placeholder field cannot use placeholder: ' . $field
+ 'The placeholder field cannot use placeholder: ' . $field,
);
}
}
@@ -868,7 +868,7 @@ class Validation implements ValidationInterface
$errors = array_filter(
$this->getErrors(),
static fn ($key): bool => preg_match(self::getRegex($field), $key) === 1,
- ARRAY_FILTER_USE_KEY
+ ARRAY_FILTER_USE_KEY,
);
return $errors === [] ? '' : implode("\n", $errors);
@@ -914,7 +914,7 @@ class Validation implements ValidationInterface
?string $label = null,
?string $param = null,
?string $value = null,
- ?string $originalField = null
+ ?string $originalField = null,
): string {
$param ??= '';
diff --git a/system/View/Cells/Cell.php b/system/View/Cells/Cell.php
index ddf7ef4ccf..26eb1d3220 100644
--- a/system/View/Cells/Cell.php
+++ b/system/View/Cells/Cell.php
@@ -97,13 +97,13 @@ class Cell implements Stringable
$candidateViews = array_filter(
[$view, $possibleView1 ?? '', $possibleView2 ?? ''],
- static fn (string $path): bool => $path !== '' && is_file($path)
+ static fn (string $path): bool => $path !== '' && is_file($path),
);
if ($candidateViews === []) {
throw new LogicException(sprintf(
'Cannot locate the view file for the "%s" cell.',
- static::class
+ static::class,
));
}
diff --git a/system/View/Parser.php b/system/View/Parser.php
index 5990658add..a2393bb4b7 100644
--- a/system/View/Parser.php
+++ b/system/View/Parser.php
@@ -86,7 +86,7 @@ class Parser extends View
?string $viewPath = null,
$loader = null,
?bool $debug = null,
- ?LoggerInterface $logger = null
+ ?LoggerInterface $logger = null,
) {
// Ensure user plugins override core plugins.
$this->plugins = $config->plugins;
@@ -329,7 +329,7 @@ class Parser extends View
$this->leftDelimiter . '\s*/' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '#us',
$template,
$matches,
- PREG_SET_ORDER
+ PREG_SET_ORDER,
);
/*
@@ -484,12 +484,12 @@ class Parser extends View
$template = preg_replace(
'/' . $leftDelimiter . '\s*else\s*' . $rightDelimiter . '/ums',
'',
- $template
+ $template,
);
$template = preg_replace(
'/' . $leftDelimiter . '\s*endif\s*' . $rightDelimiter . '/ums',
'',
- $template
+ $template,
);
// Parse the PHP itself, or insert an error so they can debug
diff --git a/system/View/View.php b/system/View/View.php
index 7b6bfea0bb..5c5d0feff8 100644
--- a/system/View/View.php
+++ b/system/View/View.php
@@ -147,7 +147,7 @@ class View implements RendererInterface
?string $viewPath = null,
?FileLocatorInterface $loader = null,
?bool $debug = null,
- ?LoggerInterface $logger = null
+ ?LoggerInterface $logger = null,
) {
$this->config = $config;
$this->viewPath = rtrim($viewPath, '\\/ ') . DIRECTORY_SEPARATOR;
@@ -200,7 +200,7 @@ class View implements RendererInterface
$this->logPerformance(
$this->renderVars['start'],
microtime(true),
- $this->renderVars['view']
+ $this->renderVars['view'],
);
return $output;
@@ -213,7 +213,7 @@ class View implements RendererInterface
$this->renderVars['file'] = $this->loader->locateFile(
$this->renderVars['view'],
'Views',
- ($fileExt === '') ? 'php' : $fileExt
+ ($fileExt === '') ? 'php' : $fileExt,
);
}
@@ -257,7 +257,7 @@ class View implements RendererInterface
$this->logPerformance(
$this->renderVars['start'],
microtime(true),
- $this->renderVars['view']
+ $this->renderVars['view'],
);
// Check if DebugToolbar is enabled.
@@ -292,7 +292,7 @@ class View implements RendererInterface
cache()->save(
$this->renderVars['cacheName'],
$output,
- (int) $this->renderVars['options']['cache']
+ (int) $this->renderVars['options']['cache'],
);
}
diff --git a/system/rewrite.php b/system/rewrite.php
index aba4560446..4f9b79ade9 100644
--- a/system/rewrite.php
+++ b/system/rewrite.php
@@ -22,7 +22,7 @@ declare(strict_types=1);
// @codeCoverageIgnoreStart
$uri = urldecode(
- parse_url('https://codeigniter.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? ''
+ parse_url('https://codeigniter.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '',
);
// All request handle by index.php file.
diff --git a/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php b/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php
index 434644bef2..8a7cb5b7d1 100644
--- a/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php
+++ b/tests/_support/Database/Migrations/20160428212500_Create_test_tables.php
@@ -99,7 +99,7 @@ class Migration_Create_test_tables extends Migration
unset(
$dataTypeFields['type_set'],
$dataTypeFields['type_mediumtext'],
- $dataTypeFields['type_double']
+ $dataTypeFields['type_double'],
);
}
diff --git a/tests/_support/Database/Seeds/CITestSeeder.php b/tests/_support/Database/Seeds/CITestSeeder.php
index 45b70a7fdd..9ce0bce4f1 100644
--- a/tests/_support/Database/Seeds/CITestSeeder.php
+++ b/tests/_support/Database/Seeds/CITestSeeder.php
@@ -151,7 +151,7 @@ class CITestSeeder extends Seeder
$data['type_test'][0]['type_real'],
$data['type_test'][0]['type_double'],
$data['type_test'][0]['type_decimal'],
- $data['type_test'][0]['type_blob']
+ $data['type_test'][0]['type_blob'],
);
}
@@ -166,7 +166,7 @@ class CITestSeeder extends Seeder
$data['type_test'][0]['type_set'],
$data['type_test'][0]['type_mediumtext'],
$data['type_test'][0]['type_double'],
- $data['type_test'][0]['type_blob']
+ $data['type_test'][0]['type_blob'],
);
}
diff --git a/tests/system/API/ResponseTraitTest.php b/tests/system/API/ResponseTraitTest.php
index dbdea6a652..9613e23fce 100644
--- a/tests/system/API/ResponseTraitTest.php
+++ b/tests/system/API/ResponseTraitTest.php
@@ -92,7 +92,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$config,
new SiteURI($config, $routePath),
null,
- new UserAgent()
+ new UserAgent(),
);
$this->response = new MockResponse($config);
}
@@ -135,7 +135,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->formatter = null;
$controller = $this->makeController(
'',
- ['Accept' => 'application/json']
+ ['Accept' => 'application/json'],
);
$this->invoke($controller, 'respondCreated', [['id' => 3], 'A Custom Reason']);
@@ -156,7 +156,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->formatter = null;
$controller = $this->makeController(
'',
- ['Accept' => 'application/json']
+ ['Accept' => 'application/json'],
);
$this->invoke($controller, 'respondCreated', ['A Custom Reason']);
@@ -187,7 +187,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->assertSame('A Custom Reason', $this->response->getBody());
$this->assertStringStartsWith(
'text/html',
- $this->response->getHeaderLine('Content-Type')
+ $this->response->getHeaderLine('Content-Type'),
);
}
@@ -279,7 +279,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->assertSame('"something"', $this->response->getBody());
$this->assertStringStartsWith(
'application/json',
- $this->response->getHeaderLine('Content-Type')
+ $this->response->getHeaderLine('Content-Type'),
);
$this->assertSame('Created', $this->response->getReasonPhrase());
}
@@ -460,7 +460,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->invoke(
$controller,
'failValidationErrors',
- [['foo' => 'Nope', 'bar' => 'No way'], 'FAT CHANCE', 'A Custom Reason']
+ [['foo' => 'Nope', 'bar' => 'No way'], 'FAT CHANCE', 'A Custom Reason'],
);
$expected = [
@@ -571,14 +571,14 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->assertSame(
$mimeType,
$this->request->getHeaderLine('Accept'),
- 'Request header...'
+ 'Request header...',
);
$this->response->setContentType($contentType);
$this->assertSame(
$contentType,
$this->response->getHeaderLine('Content-Type'),
- 'Response header pre-response...'
+ 'Response header pre-response...',
);
$_SERVER = $original;
@@ -637,7 +637,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->assertStringStartsWith(
config('Format')->supportedResponseFormats[0],
- $response->getHeaderLine('Content-Type')
+ $response->getHeaderLine('Content-Type'),
);
}
@@ -651,7 +651,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->assertStringStartsWith(
'application/json',
- $this->response->getHeaderLine('Content-Type')
+ $this->response->getHeaderLine('Content-Type'),
);
$this->assertSame($this->formatter->format($data), $this->response->getJSON());
@@ -660,7 +660,7 @@ final class ResponseTraitTest extends CIUnitTestCase
$this->assertStringStartsWith(
'application/xml',
- $this->response->getHeaderLine('Content-Type')
+ $this->response->getHeaderLine('Content-Type'),
);
}
diff --git a/tests/system/AutoReview/ComposerJsonTest.php b/tests/system/AutoReview/ComposerJsonTest.php
index 995ef99f4f..8d4dfefab5 100644
--- a/tests/system/AutoReview/ComposerJsonTest.php
+++ b/tests/system/AutoReview/ComposerJsonTest.php
@@ -62,7 +62,7 @@ final class ComposerJsonTest extends TestCase
$dependency,
$expectedVersion,
$fwRequireDev[$dependency],
- clean_path(dirname(__DIR__, 3) . '/admin/framework/composer.json')
+ clean_path(dirname(__DIR__, 3) . '/admin/framework/composer.json'),
));
}
}
@@ -77,7 +77,7 @@ final class ComposerJsonTest extends TestCase
$this->checkConfig(
$this->devComposer['config'],
$this->frameworkComposer['config'],
- 'framework'
+ 'framework',
);
}
@@ -86,7 +86,7 @@ final class ComposerJsonTest extends TestCase
$this->checkConfig(
$this->devComposer['config'],
$this->starterComposer['config'],
- 'starter'
+ 'starter',
);
}
@@ -101,7 +101,7 @@ final class ComposerJsonTest extends TestCase
$this->assertSame(
$this->devComposer[$section],
$sectionContent,
- sprintf('The %s\'s "%s" section is not updated with the main composer.json', strtolower($component), $section)
+ sprintf('The %s\'s "%s" section is not updated with the main composer.json', strtolower($component), $section),
);
}
@@ -119,7 +119,7 @@ final class ComposerJsonTest extends TestCase
$this->assertSame($expectedValue, $actualValue, sprintf(
'%s\'s value for config property "%s" is not same with the main composer.json\'s config.',
ucfirst($component),
- $key
+ $key,
));
}
}
@@ -132,7 +132,7 @@ final class ComposerJsonTest extends TestCase
$this->fail(sprintf(
'The composer.json at "%s" is not readable or does not exist. Error was "%s".',
clean_path($path),
- $e->getMessage()
+ $e->getMessage(),
));
}
}
diff --git a/tests/system/AutoReview/FrameworkCodeTest.php b/tests/system/AutoReview/FrameworkCodeTest.php
index 7473d26e58..137839b024 100644
--- a/tests/system/AutoReview/FrameworkCodeTest.php
+++ b/tests/system/AutoReview/FrameworkCodeTest.php
@@ -66,7 +66,7 @@ final class FrameworkCodeTest extends TestCase
return $groupAttribute->name();
}, $attributes),
- self::$recognizedGroupAttributeNames
+ self::$recognizedGroupAttributeNames,
);
$this->assertEmpty($unrecognizedGroups, sprintf(
"[%s] Unexpected #[Group] attribute%s:\n%s\nExpected group names to be in \"%s\".",
@@ -74,9 +74,9 @@ final class FrameworkCodeTest extends TestCase
count($unrecognizedGroups) > 1 ? 's' : '',
implode("\n", array_map(
static fn (string $group): string => sprintf(' * #[Group(\'%s\')]', $group),
- $unrecognizedGroups
+ $unrecognizedGroups,
)),
- implode(', ', self::$recognizedGroupAttributeNames)
+ implode(', ', self::$recognizedGroupAttributeNames),
));
}
@@ -100,9 +100,9 @@ final class FrameworkCodeTest extends TestCase
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$directory,
- FilesystemIterator::SKIP_DOTS
+ FilesystemIterator::SKIP_DOTS,
),
- RecursiveIteratorIterator::CHILD_FIRST
+ RecursiveIteratorIterator::CHILD_FIRST,
);
$testClasses = array_map(
@@ -111,32 +111,32 @@ final class FrameworkCodeTest extends TestCase
$file->getPathname(),
'',
0,
- strlen($directory)
+ strlen($directory),
);
$relativePath = substr_replace(
$relativePath,
'',
- strlen($relativePath) - strlen(DIRECTORY_SEPARATOR . $file->getBasename())
+ strlen($relativePath) - strlen(DIRECTORY_SEPARATOR . $file->getBasename()),
);
return sprintf(
'CodeIgniter\\%s%s%s',
strtr($relativePath, DIRECTORY_SEPARATOR, '\\'),
$relativePath === '' ? '' : '\\',
- $file->getBasename('.' . $file->getExtension())
+ $file->getBasename('.' . $file->getExtension()),
);
},
array_filter(
iterator_to_array($iterator, false),
static fn (SplFileInfo $file): bool => $file->isFile()
&& ! str_contains($file->getPathname(), DIRECTORY_SEPARATOR . 'fixtures' . DIRECTORY_SEPARATOR)
- && ! str_contains($file->getPathname(), DIRECTORY_SEPARATOR . 'Views' . DIRECTORY_SEPARATOR)
- )
+ && ! str_contains($file->getPathname(), DIRECTORY_SEPARATOR . 'Views' . DIRECTORY_SEPARATOR),
+ ),
);
$testClasses = array_filter(
$testClasses,
- static fn (string $class): bool => is_subclass_of($class, TestCase::class)
+ static fn (string $class): bool => is_subclass_of($class, TestCase::class),
);
sort($testClasses);
diff --git a/tests/system/Autoloader/AutoloaderTest.php b/tests/system/Autoloader/AutoloaderTest.php
index 19d482890b..0715dd98b5 100644
--- a/tests/system/Autoloader/AutoloaderTest.php
+++ b/tests/system/Autoloader/AutoloaderTest.php
@@ -202,7 +202,7 @@ final class AutoloaderTest extends CIUnitTestCase
$this->assertSame(
__FILE__,
- ($this->classLoader)('App\Controllers\AutoloaderTest')
+ ($this->classLoader)('App\Controllers\AutoloaderTest'),
);
}
@@ -235,7 +235,7 @@ final class AutoloaderTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'The file path contains special characters "${}!#" that are not allowed: "${../path}!#/to/some/file.php_"'
+ 'The file path contains special characters "${}!#" that are not allowed: "${../path}!#/to/some/file.php_"',
);
$test = '${../path}!#/to/some/file.php_';
@@ -247,7 +247,7 @@ final class AutoloaderTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'The characters ".-_" are not allowed in filename edges: "/path/to/some/file.php_"'
+ 'The characters ".-_" are not allowed in filename edges: "/path/to/some/file.php_"',
);
$test = '/path/to/some/file.php_';
diff --git a/tests/system/Autoloader/FileLocatorTest.php b/tests/system/Autoloader/FileLocatorTest.php
index 90580864fc..fc7925724a 100644
--- a/tests/system/Autoloader/FileLocatorTest.php
+++ b/tests/system/Autoloader/FileLocatorTest.php
@@ -218,7 +218,7 @@ class FileLocatorTest extends CIUnitTestCase
SYSTEMPATH . 'Language/en/Validation.php',
APPPATH . 'Language/en/Validation.php',
],
- $foundFiles
+ $foundFiles,
);
}
@@ -243,7 +243,7 @@ class FileLocatorTest extends CIUnitTestCase
$directory = str_replace(
'/',
DIRECTORY_SEPARATOR,
- APPPATH . 'Config/Boot'
+ APPPATH . 'Config/Boot',
);
$this->assertNotContains($directory, $files);
}
@@ -308,7 +308,7 @@ class FileLocatorTest extends CIUnitTestCase
{
$this->assertSame(
self::class,
- $this->locator->getClassname(__FILE__)
+ $this->locator->getClassname(__FILE__),
);
}
@@ -316,7 +316,7 @@ class FileLocatorTest extends CIUnitTestCase
{
$this->assertSame(
'',
- $this->locator->getClassname(SYSTEMPATH . 'bootstrap.php')
+ $this->locator->getClassname(SYSTEMPATH . 'bootstrap.php'),
);
}
@@ -324,7 +324,7 @@ class FileLocatorTest extends CIUnitTestCase
{
$this->assertSame(
'',
- $this->locator->getClassname(SYSTEMPATH)
+ $this->locator->getClassname(SYSTEMPATH),
);
}
}
diff --git a/tests/system/CLI/CLITest.php b/tests/system/CLI/CLITest.php
index 413fd71c85..7ee9279afe 100644
--- a/tests/system/CLI/CLITest.php
+++ b/tests/system/CLI/CLITest.php
@@ -283,7 +283,7 @@ final class CLITest extends CIUnitTestCase
$this->assertSame(
"\033[1;37m\033[42m\033[4mtest\033[0m",
- CLI::color('test', 'white', 'green', 'underline')
+ CLI::color('test', 'white', 'green', 'underline'),
);
}
@@ -291,7 +291,7 @@ final class CLITest extends CIUnitTestCase
{
$this->assertSame(
'',
- CLI::color('', 'white', 'green', 'underline')
+ CLI::color('', 'white', 'green', 'underline'),
);
}
@@ -358,7 +358,7 @@ final class CLITest extends CIUnitTestCase
{
CLI::write(
CLI::color('green', 'green') . ' red ' . CLI::color('green', 'green'),
- 'red'
+ 'red',
);
$expected = "\033[0;32mgreen\033[0m\033[0;31m red \033[0m\033[0;32mgreen\033[0m" . PHP_EOL;
@@ -440,15 +440,15 @@ final class CLITest extends CIUnitTestCase
$this->assertSame('', CLI::wrap(''));
$this->assertSame(
'1234' . PHP_EOL . ' 5678' . PHP_EOL . ' 90' . PHP_EOL . ' abc' . PHP_EOL . ' de' . PHP_EOL . ' fghij' . PHP_EOL . ' 0987654321',
- CLI::wrap('1234 5678 90' . PHP_EOL . 'abc de fghij' . PHP_EOL . '0987654321', 5, 1)
+ CLI::wrap('1234 5678 90' . PHP_EOL . 'abc de fghij' . PHP_EOL . '0987654321', 5, 1),
);
$this->assertSame(
'1234 5678 90' . PHP_EOL . ' abc de fghij' . PHP_EOL . ' 0987654321',
- CLI::wrap('1234 5678 90' . PHP_EOL . 'abc de fghij' . PHP_EOL . '0987654321', 999, 2)
+ CLI::wrap('1234 5678 90' . PHP_EOL . 'abc de fghij' . PHP_EOL . '0987654321', 999, 2),
);
$this->assertSame(
'1234 5678 90' . PHP_EOL . 'abc de fghij' . PHP_EOL . '0987654321',
- CLI::wrap('1234 5678 90' . PHP_EOL . 'abc de fghij' . PHP_EOL . '0987654321')
+ CLI::wrap('1234 5678 90' . PHP_EOL . 'abc de fghij' . PHP_EOL . '0987654321'),
);
}
diff --git a/tests/system/CLI/ConsoleTest.php b/tests/system/CLI/ConsoleTest.php
index c6773a0789..5962f3a9b2 100644
--- a/tests/system/CLI/ConsoleTest.php
+++ b/tests/system/CLI/ConsoleTest.php
@@ -54,8 +54,8 @@ final class ConsoleTest extends CIUnitTestCase
0,
strpos(
$this->getStreamFilterBuffer(),
- sprintf('CodeIgniter v%s Command Line Tool', CodeIgniter::CI_VERSION)
- )
+ sprintf('CodeIgniter v%s Command Line Tool', CodeIgniter::CI_VERSION),
+ ),
);
}
@@ -143,7 +143,7 @@ final class ConsoleTest extends CIUnitTestCase
$this->assertStringContainsString('env []', $this->getStreamFilterBuffer());
$this->assertStringContainsString(
'Retrieves the current environment, or set a new one.',
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
}
diff --git a/tests/system/Cache/ResponseCacheTest.php b/tests/system/Cache/ResponseCacheTest.php
index b0b7385523..7342211141 100644
--- a/tests/system/Cache/ResponseCacheTest.php
+++ b/tests/system/Cache/ResponseCacheTest.php
@@ -46,7 +46,7 @@ final class ResponseCacheTest extends CIUnitTestCase
private function createIncomingRequest(
string $uri = '',
array $query = [],
- ?AppConfig $appConfig = null
+ ?AppConfig $appConfig = null,
): IncomingRequest {
$_POST = $_GET = $_SERVER = $_REQUEST = $_ENV = $_COOKIE = $_SESSION = [];
@@ -65,7 +65,7 @@ final class ResponseCacheTest extends CIUnitTestCase
$appConfig,
$siteUri,
null,
- new UserAgent()
+ new UserAgent(),
);
}
diff --git a/tests/system/CodeIgniterTest.php b/tests/system/CodeIgniterTest.php
index afddc7dbb3..2dec61da4b 100644
--- a/tests/system/CodeIgniterTest.php
+++ b/tests/system/CodeIgniterTest.php
@@ -214,7 +214,7 @@ final class CodeIgniterTest extends CIUnitTestCase
$routes = service('routes');
$routes->add(
'pages/(:segment)',
- static fn ($segment): string => 'You want to see "' . esc($segment) . '" page.'
+ static fn ($segment): string => 'You want to see "' . esc($segment) . '" page.',
);
$router = service('router', $routes, service('incomingrequest'));
Services::injectMock('router', $router);
@@ -293,7 +293,7 @@ final class CodeIgniterTest extends CIUnitTestCase
$routes->add(
'pages/about',
static fn () => service('incomingrequest')->getBody(),
- ['filter' => Customfilter::class]
+ ['filter' => Customfilter::class],
);
$router = service('router', $routes, service('incomingrequest'));
@@ -324,7 +324,7 @@ final class CodeIgniterTest extends CIUnitTestCase
'pages/about',
static fn () => service('incomingrequest')->getBody(),
// Set filter with no argument.
- ['filter' => 'test-customfilter']
+ ['filter' => 'test-customfilter'],
);
$router = service('router', $routes, service('incomingrequest'));
@@ -358,7 +358,7 @@ final class CodeIgniterTest extends CIUnitTestCase
$routes->add(
'pages/about',
static fn () => service('incomingrequest')->getBody(),
- ['filter' => Customfilter::class]
+ ['filter' => Customfilter::class],
);
$router = service('router', $routes, service('incomingrequest'));
Services::injectMock('router', $router);
@@ -843,7 +843,7 @@ final class CodeIgniterTest extends CIUnitTestCase
public function testPageCacheWithCacheQueryString(
$cacheQueryStringValue,
int $expectedPagesInCache,
- array $testingUrls
+ array $testingUrls,
): void {
// Suppress command() output
CITestStreamFilter::registration();
diff --git a/tests/system/Commands/Database/MigrateStatusTest.php b/tests/system/Commands/Database/MigrateStatusTest.php
index 5e54b380fd..b08557790d 100644
--- a/tests/system/Commands/Database/MigrateStatusTest.php
+++ b/tests/system/Commands/Database/MigrateStatusTest.php
@@ -51,7 +51,7 @@ final class MigrateStatusTest extends CIUnitTestCase
$contents = str_replace(
'namespace Tests\Support\MigrationTestMigrations\Database\Migrations;',
'namespace App\Database\Migrations;',
- $contents
+ $contents,
);
file_put_contents($this->migrationFileTo, $contents);
diff --git a/tests/system/Commands/EnvironmentCommandTest.php b/tests/system/Commands/EnvironmentCommandTest.php
index 177becf34f..8bab8db12c 100644
--- a/tests/system/Commands/EnvironmentCommandTest.php
+++ b/tests/system/Commands/EnvironmentCommandTest.php
@@ -64,7 +64,7 @@ final class EnvironmentCommandTest extends CIUnitTestCase
command('env testing');
$this->assertStringContainsString(
'The "testing" environment is reserved for PHPUnit testing.',
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
}
@@ -83,7 +83,7 @@ final class EnvironmentCommandTest extends CIUnitTestCase
$this->assertStringContainsString('Both default shipped', $this->getStreamFilterBuffer());
$this->assertStringContainsString(
'It is impossible to write the new environment type.',
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
}
diff --git a/tests/system/Commands/FilterCheckTest.php b/tests/system/Commands/FilterCheckTest.php
index 0c26dd9bf3..9062f99bd8 100644
--- a/tests/system/Commands/FilterCheckTest.php
+++ b/tests/system/Commands/FilterCheckTest.php
@@ -48,7 +48,7 @@ final class FilterCheckTest extends CIUnitTestCase
$this->assertStringContainsString(
'| GET | / | forcehttps pagecache | pagecache performance toolbar |',
- preg_replace('/\033\[.+?m/u', '', $this->getBuffer())
+ preg_replace('/\033\[.+?m/u', '', $this->getBuffer()),
);
}
@@ -61,8 +61,8 @@ final class FilterCheckTest extends CIUnitTestCase
str_replace(
["\033[0m", "\033[1;31m", "\033[0;30m", "\033[47m"],
'',
- $this->getBuffer()
- )
+ $this->getBuffer(),
+ ),
);
}
}
diff --git a/tests/system/Commands/GenerateKeyTest.php b/tests/system/Commands/GenerateKeyTest.php
index 40df8d1477..01e2b2c750 100644
--- a/tests/system/Commands/GenerateKeyTest.php
+++ b/tests/system/Commands/GenerateKeyTest.php
@@ -137,7 +137,7 @@ final class GenerateKeyTest extends CIUnitTestCase
'encryption.key = ' . $key,
'# encryption.key = ' . $key,
file_get_contents($this->envPath),
- $count
+ $count,
));
$this->assertSame(1, $count, 'Failed commenting out the previously set application key.');
@@ -155,7 +155,7 @@ final class GenerateKeyTest extends CIUnitTestCase
'encryption.key = ' . $key,
'# encryption.key = ' . $key,
file_get_contents($this->envPath),
- $count
+ $count,
));
$this->assertSame(1, $count, 'Failed commenting out the previously set application key.');
diff --git a/tests/system/Commands/MigrationIntegrationTest.php b/tests/system/Commands/MigrationIntegrationTest.php
index 14b66ccb92..12869f9092 100644
--- a/tests/system/Commands/MigrationIntegrationTest.php
+++ b/tests/system/Commands/MigrationIntegrationTest.php
@@ -61,7 +61,7 @@ final class MigrationIntegrationTest extends CIUnitTestCase
command('migrate -n App');
$this->assertStringContainsString(
'(App) 20160428212500_App\Database\Migrations\Migration_Create_test_tables',
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
$this->resetStreamFilterBuffer();
@@ -69,7 +69,7 @@ final class MigrationIntegrationTest extends CIUnitTestCase
command('migrate:rollback -n App');
$this->assertStringContainsString(
'(App) 20160428212500_App\Database\Migrations\Migration_Create_test_tables',
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
}
}
diff --git a/tests/system/Commands/RoutesTest.php b/tests/system/Commands/RoutesTest.php
index 7859156ccf..a94ddbe208 100644
--- a/tests/system/Commands/RoutesTest.php
+++ b/tests/system/Commands/RoutesTest.php
@@ -85,7 +85,7 @@ final class RoutesTest extends CIUnitTestCase
EOL;
$this->assertStringContainsString(
$expected,
- preg_replace('/\033\[.+?m/u', '', $this->getBuffer())
+ preg_replace('/\033\[.+?m/u', '', $this->getBuffer()),
);
}
diff --git a/tests/system/Commands/Utilities/ConfigCheckTest.php b/tests/system/Commands/Utilities/ConfigCheckTest.php
index c69cfa9486..e49a8170ec 100644
--- a/tests/system/Commands/Utilities/ConfigCheckTest.php
+++ b/tests/system/Commands/Utilities/ConfigCheckTest.php
@@ -73,7 +73,7 @@ final class ConfigCheckTest extends CIUnitTestCase
config:check 'CodeIgniter\Shield\Config\Auth'
EOF,
- str_replace("\n\n", "\n", $this->getStreamFilterBuffer())
+ str_replace("\n\n", "\n", $this->getStreamFilterBuffer()),
);
}
@@ -83,7 +83,7 @@ final class ConfigCheckTest extends CIUnitTestCase
$this->assertSame(
"No such Config class: Nonexistent\n",
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
}
@@ -92,14 +92,14 @@ final class ConfigCheckTest extends CIUnitTestCase
/** @var Closure(object): string $command */
$command = $this->getPrivateMethodInvoker(
new ConfigCheck(service('logger'), service('commands')),
- 'getKintD'
+ 'getKintD',
);
command('config:check App');
$this->assertSame(
$command(config('App')) . "\n",
- preg_replace('/\s+Config Caching: \S+/', '', $this->getStreamFilterBuffer())
+ preg_replace('/\s+Config Caching: \S+/', '', $this->getStreamFilterBuffer()),
);
}
@@ -108,12 +108,12 @@ final class ConfigCheckTest extends CIUnitTestCase
/** @var Closure(object): string $command */
$command = $this->getPrivateMethodInvoker(
new ConfigCheck(service('logger'), service('commands')),
- 'getVarDump'
+ 'getVarDump',
);
$clean = static fn (string $input): string => trim(preg_replace(
'/(\033\[[0-9;]+m)|(\035\[[0-9;]+m)/u',
'',
- $input
+ $input,
));
try {
@@ -122,7 +122,7 @@ final class ConfigCheckTest extends CIUnitTestCase
$this->assertSame(
$clean($command(config('App'))),
- $clean(preg_replace('/\s+Config Caching: \S+/', '', $this->getStreamFilterBuffer()))
+ $clean(preg_replace('/\s+Config Caching: \S+/', '', $this->getStreamFilterBuffer())),
);
} finally {
Kint::$enabled_mode = true;
diff --git a/tests/system/Commands/Utilities/NamespacesTest.php b/tests/system/Commands/Utilities/NamespacesTest.php
index ffdfa0ddcf..d2395fda89 100644
--- a/tests/system/Commands/Utilities/NamespacesTest.php
+++ b/tests/system/Commands/Utilities/NamespacesTest.php
@@ -73,15 +73,15 @@ final class NamespacesTest extends CIUnitTestCase
$this->assertStringContainsString(
'|CodeIgniter|ROOTPATH/system|Yes|',
- str_replace(' ', '', $this->getBuffer())
+ str_replace(' ', '', $this->getBuffer()),
);
$this->assertStringContainsString(
'|App|ROOTPATH/app|Yes|',
- str_replace(' ', '', $this->getBuffer())
+ str_replace(' ', '', $this->getBuffer()),
);
$this->assertStringContainsString(
'|Config|APPPATH/Config|Yes|',
- str_replace(' ', '', $this->getBuffer())
+ str_replace(' ', '', $this->getBuffer()),
);
}
}
diff --git a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php
index 936b2b8fe1..33df69e653 100644
--- a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php
+++ b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php
@@ -30,7 +30,7 @@ use Tests\Support\Controllers\Remap;
final class ControllerMethodReaderTest extends CIUnitTestCase
{
private function createControllerMethodReader(
- string $namespace = 'Tests\Support\Controllers'
+ string $namespace = 'Tests\Support\Controllers',
): ControllerMethodReader {
$methods = [
'get',
@@ -79,7 +79,7 @@ final class ControllerMethodReaderTest extends CIUnitTestCase
Factories::injectMock('config', Routing::class, $config);
$reader = $this->createControllerMethodReader(
- 'CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\Controllers'
+ 'CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\Controllers',
);
$routes = $reader->read(Dash_controller::class);
@@ -116,7 +116,7 @@ final class ControllerMethodReaderTest extends CIUnitTestCase
Factories::injectMock('config', Routing::class, $config);
$reader = $this->createControllerMethodReader(
- 'CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\Controllers'
+ 'CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\Controllers',
);
$routes = $reader->read(BlogController::class);
@@ -147,7 +147,7 @@ final class ControllerMethodReaderTest extends CIUnitTestCase
public function testReadDefaultController(): void
{
$reader = $this->createControllerMethodReader(
- 'CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\Controllers'
+ 'CodeIgniter\Commands\Utilities\Routes\AutoRouterImproved\Controllers',
);
$routes = $reader->read(Home::class);
diff --git a/tests/system/Commands/Utilities/Routes/SampleURIGeneratorTest.php b/tests/system/Commands/Utilities/Routes/SampleURIGeneratorTest.php
index 6b5c10e45e..1d67afae1c 100644
--- a/tests/system/Commands/Utilities/Routes/SampleURIGeneratorTest.php
+++ b/tests/system/Commands/Utilities/Routes/SampleURIGeneratorTest.php
@@ -51,7 +51,7 @@ final class SampleURIGeneratorTest extends CIUnitTestCase
$routes = service('routes');
$routes->addPlaceholder(
'uuid',
- '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
+ '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
);
$generator = new SampleURIGenerator();
diff --git a/tests/system/CommonFunctionsTest.php b/tests/system/CommonFunctionsTest.php
index deef63d798..ab13ac06dd 100644
--- a/tests/system/CommonFunctionsTest.php
+++ b/tests/system/CommonFunctionsTest.php
@@ -338,7 +338,7 @@ final class CommonFunctionsTest extends CIUnitTestCase
$this->assertSame(
'/en/path/string/to/13',
- route_to('path-to', 'string', 13, 'en')
+ route_to('path-to', 'string', 13, 'en'),
);
}
@@ -352,7 +352,7 @@ final class CommonFunctionsTest extends CIUnitTestCase
$this->assertSame(
'/en/path/string/to/13',
- route_to('path-to', 'string', 13, 'invalid')
+ route_to('path-to', 'string', 13, 'invalid'),
);
}
@@ -642,7 +642,7 @@ final class CommonFunctionsTest extends CIUnitTestCase
$this->assertInstanceOf(RedirectException::class, $e);
$this->assertSame(
'https://example.com/index.php/',
- $e->getResponse()->header('Location')->getValue()
+ $e->getResponse()->header('Location')->getValue(),
);
$this->assertFalse($e->getResponse()->hasCookie('force'));
$this->assertSame('header', $e->getResponse()->getHeaderLine('Force'));
@@ -668,7 +668,7 @@ final class CommonFunctionsTest extends CIUnitTestCase
$this->assertInstanceOf(RedirectException::class, $e);
$this->assertSame(
'https://example.jp/codeIgniter/index.php/en/home?foo=bar',
- $e->getResponse()->header('Location')->getValue()
+ $e->getResponse()->header('Location')->getValue(),
);
}
}
diff --git a/tests/system/CommonHelperTest.php b/tests/system/CommonHelperTest.php
index 2b614b3165..83546e973b 100644
--- a/tests/system/CommonHelperTest.php
+++ b/tests/system/CommonHelperTest.php
@@ -129,7 +129,7 @@ final class CommonHelperTest extends CIUnitTestCase
foreach ($this->dummyHelpers as $helper) {
$this->assertFileDoesNotExist($helper, sprintf(
'The dummy helper file "%s" should not be existing before it is tested.',
- $helper
+ $helper,
));
}
diff --git a/tests/system/Config/FactoriesTest.php b/tests/system/Config/FactoriesTest.php
index 11a5e77a43..4a73c7805b 100644
--- a/tests/system/Config/FactoriesTest.php
+++ b/tests/system/Config/FactoriesTest.php
@@ -338,18 +338,18 @@ final class FactoriesTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'Already defined in Factories: models CodeIgniter\Shield\Models\UserModel -> Tests\Support\Models\UserModel'
+ 'Already defined in Factories: models CodeIgniter\Shield\Models\UserModel -> Tests\Support\Models\UserModel',
);
Factories::define(
'models',
'CodeIgniter\Shield\Models\UserModel',
- UserModel::class
+ UserModel::class,
);
Factories::define(
'models',
'CodeIgniter\Shield\Models\UserModel',
- EntityModel::class
+ EntityModel::class,
);
}
@@ -358,12 +358,12 @@ final class FactoriesTest extends CIUnitTestCase
Factories::define(
'models',
'CodeIgniter\Shield\Models\UserModel',
- UserModel::class
+ UserModel::class,
);
Factories::define(
'models',
'CodeIgniter\Shield\Models\UserModel',
- UserModel::class
+ UserModel::class,
);
$model = model('CodeIgniter\Shield\Models\UserModel');
@@ -379,7 +379,7 @@ final class FactoriesTest extends CIUnitTestCase
Factories::define(
'models',
'CodeIgniter\Shield\Models\UserModel',
- 'App\Models\UserModel'
+ 'App\Models\UserModel',
);
}
@@ -387,7 +387,7 @@ final class FactoriesTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'Already defined in Factories: models Tests\Support\Models\UserModel -> Tests\Support\Models\UserModel'
+ 'Already defined in Factories: models Tests\Support\Models\UserModel -> Tests\Support\Models\UserModel',
);
model(UserModel::class);
@@ -395,7 +395,7 @@ final class FactoriesTest extends CIUnitTestCase
Factories::define(
'models',
UserModel::class,
- 'App\Models\UserModel'
+ 'App\Models\UserModel',
);
}
@@ -404,7 +404,7 @@ final class FactoriesTest extends CIUnitTestCase
Factories::define(
'models',
UserModel::class,
- EntityModel::class
+ EntityModel::class,
);
$model = model(UserModel::class);
@@ -417,7 +417,7 @@ final class FactoriesTest extends CIUnitTestCase
Factories::define(
'models',
UserModel::class,
- EntityModel::class
+ EntityModel::class,
);
$model = Factories::get('models', UserModel::class);
diff --git a/tests/system/ControllerTest.php b/tests/system/ControllerTest.php
index 55664c42c7..7337057252 100644
--- a/tests/system/ControllerTest.php
+++ b/tests/system/ControllerTest.php
@@ -195,7 +195,7 @@ final class ControllerTest extends CIUnitTestCase
$this->assertFalse($method($data, $rule));
$this->assertSame(
'The password field must be at least 10 characters in length.',
- service('validation')->getError('password')
+ service('validation')->getError('password'),
);
}
@@ -224,11 +224,11 @@ final class ControllerTest extends CIUnitTestCase
$this->assertFalse($method($data, $rules, $errors));
$this->assertSame(
'"username" must be 3 letters or longer.',
- service('validation')->getError('username')
+ service('validation')->getError('username'),
);
$this->assertSame(
'The password field must be at least 10 characters in length.',
- service('validation')->getError('password')
+ service('validation')->getError('password'),
);
}
@@ -262,11 +262,11 @@ final class ControllerTest extends CIUnitTestCase
$this->assertFalse($method($data, $rules));
$this->assertSame(
'"Username" must be 3 letters or longer.',
- service('validation')->getError('username')
+ service('validation')->getError('username'),
);
$this->assertSame(
'The Password field must be at least 10 characters in length.',
- service('validation')->getError('password')
+ service('validation')->getError('password'),
);
}
diff --git a/tests/system/Cookie/CookieTest.php b/tests/system/Cookie/CookieTest.php
index f51ce66896..e3907e8cef 100644
--- a/tests/system/Cookie/CookieTest.php
+++ b/tests/system/Cookie/CookieTest.php
@@ -93,7 +93,7 @@ final class CookieTest extends CIUnitTestCase
'value',
[
'prefix' => $optionPrefix,
- ]
+ ],
);
$this->assertSame($expected, $cookie->getPrefixedName());
@@ -271,19 +271,19 @@ final class CookieTest extends CIUnitTestCase
$this->assertSame(
'cookie=lover; Path=/; HttpOnly; SameSite=Lax',
- $a->toHeaderString()
+ $a->toHeaderString(),
);
$this->assertSame(
"cookie=monster; Expires=Sun, 14-Feb-2021 00:00:00 GMT; Max-Age={$max}; Path=/web; Domain=localhost; HttpOnly; SameSite=Lax",
- (string) $b
+ (string) $b,
);
$this->assertSame(
'cookie=lover; Path=/; Secure; SameSite=Strict',
- (string) $c
+ (string) $c,
);
$this->assertSame(
'cookie=deleted; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0; Path=/; HttpOnly; SameSite=Lax',
- (string) $d
+ (string) $d,
);
Cookie::setDefaults($old);
diff --git a/tests/system/DataConverter/DataConverterTest.php b/tests/system/DataConverter/DataConverterTest.php
index c57e8593af..3bdfa2f51e 100644
--- a/tests/system/DataConverter/DataConverterTest.php
+++ b/tests/system/DataConverter/DataConverterTest.php
@@ -471,7 +471,7 @@ final class DataConverterTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- '[CodeIgniter\DataCaster\Cast\JsonCast] Invalid value type: bool, and its value: true'
+ '[CodeIgniter\DataCaster\Cast\JsonCast] Invalid value type: bool, and its value: true',
);
$types = [
@@ -491,7 +491,7 @@ final class DataConverterTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'Invalid class type. It must implement CastInterface. class: CodeIgniter\DataConverter\DataConverter'
+ 'Invalid class type. It must implement CastInterface. class: CodeIgniter\DataConverter\DataConverter',
);
$types = [
@@ -530,7 +530,7 @@ final class DataConverterTest extends CIUnitTestCase
array $handlers = [],
?object $helper = null,
Closure|string|null $reconstructor = 'reconstruct',
- Closure|string|null $extractor = null
+ Closure|string|null $extractor = null,
): DataConverter {
return new DataConverter($types, $handlers, $helper, $reconstructor, $extractor);
}
diff --git a/tests/system/Database/BaseConnectionTest.php b/tests/system/Database/BaseConnectionTest.php
index b36ec7ea02..ba55129cc7 100644
--- a/tests/system/Database/BaseConnectionTest.php
+++ b/tests/system/Database/BaseConnectionTest.php
@@ -188,7 +188,7 @@ final class BaseConnectionTest extends CIUnitTestCase
bool $protectIdentifiers,
bool $fieldExists,
string $item,
- string $expected
+ string $expected,
): void {
$db = new MockConnection($this->options);
diff --git a/tests/system/Database/BaseQueryTest.php b/tests/system/Database/BaseQueryTest.php
index a87bc64e72..3c48e25266 100644
--- a/tests/system/Database/BaseQueryTest.php
+++ b/tests/system/Database/BaseQueryTest.php
@@ -251,7 +251,7 @@ final class BaseQueryTest extends CIUnitTestCase
$query->setQuery(
"SELECT mytable.id, DATE_FORMAT(mytable.created_at,'%d/%m/%Y %H:%i:%s') AS created_at_uk FROM mytable WHERE mytable.id = ?",
- [1]
+ [1],
);
$expected = "SELECT mytable.id, DATE_FORMAT(mytable.created_at,'%d/%m/%Y %H:%i:%s') AS created_at_uk FROM mytable WHERE mytable.id = 1";
@@ -326,7 +326,7 @@ final class BaseQueryTest extends CIUnitTestCase
$query->setQuery(
'SELECT * FROM posts WHERE content = :content: OR foobar = :foobar:',
- ['content' => 'a placeholder looks like :foobar:', 'foobar' => 'bazqux']
+ ['content' => 'a placeholder looks like :foobar:', 'foobar' => 'bazqux'],
);
$expected = "SELECT * FROM posts WHERE content = 'a placeholder looks like :foobar:' OR foobar = 'bazqux'";
@@ -381,7 +381,7 @@ final class BaseQueryTest extends CIUnitTestCase
$query->setQuery(
'SELECT * FROM product WHERE date_pickup < DateAdd(month, ?, Convert(date, GetDate())',
[-6],
- true
+ true,
);
$expected = 'SELECT * FROM product WHERE date_pickup < DateAdd(month, -6, Convert(date, GetDate())';
@@ -395,7 +395,7 @@ final class BaseQueryTest extends CIUnitTestCase
$query->setQuery(
'SELECT * FROM product WHERE date_pickup < DateAdd(month, :num:, Convert(date, GetDate())',
- ['num' => -6]
+ ['num' => -6],
);
$expected = 'SELECT * FROM product WHERE date_pickup < DateAdd(month, -6, Convert(date, GetDate())';
diff --git a/tests/system/Database/Builder/InsertTest.php b/tests/system/Database/Builder/InsertTest.php
index e021472b72..a0a233440a 100644
--- a/tests/system/Database/Builder/InsertTest.php
+++ b/tests/system/Database/Builder/InsertTest.php
@@ -287,7 +287,7 @@ final class InsertTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'RawSql "expires = DATE_ADD(NOW(), INTERVAL 2 HOUR)" cannot be used here.'
+ 'RawSql "expires = DATE_ADD(NOW(), INTERVAL 2 HOUR)" cannot be used here.',
);
$builder = $this->db->table('auth_bearer');
diff --git a/tests/system/Database/Builder/JoinTest.php b/tests/system/Database/Builder/JoinTest.php
index 377df4816e..04145671e7 100644
--- a/tests/system/Database/Builder/JoinTest.php
+++ b/tests/system/Database/Builder/JoinTest.php
@@ -90,7 +90,7 @@ final class JoinTest extends CIUnitTestCase
$builder->join(
'leases',
'units.unit_id = leases.unit_id AND CURDATE() BETWEEN lease_start_date AND lease_exp_date',
- 'LEFT'
+ 'LEFT',
);
// @TODO Should be `... CURDATE() BETWEEN "lease_start_date" AND "lease_exp_date"`
diff --git a/tests/system/Database/Builder/SelectTest.php b/tests/system/Database/Builder/SelectTest.php
index 7a1027bc62..57aa7eaf37 100644
--- a/tests/system/Database/Builder/SelectTest.php
+++ b/tests/system/Database/Builder/SelectTest.php
@@ -220,7 +220,7 @@ final class SelectTest extends CIUnitTestCase
$builder->select(
'REGEXP_SUBSTR(ral_anno,"[0-9]{1,2}([,.][0-9]{1,3})([,.][0-9]{1,3})") AS ral',
- false
+ false,
);
$expected = <<<'SQL'
@@ -405,7 +405,7 @@ final class SelectTest extends CIUnitTestCase
$sql = $builder->getCompiledSelect();
$this->assertSame(
'SELECT * FROM "users"',
- str_replace("\n", ' ', $sql)
+ str_replace("\n", ' ', $sql),
);
}
}
diff --git a/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce1Test.php b/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce1Test.php
index c3e7447499..d6cb6b503a 100644
--- a/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce1Test.php
+++ b/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce1Test.php
@@ -69,7 +69,7 @@ final class DatabaseTestCaseMigrationOnce1Test extends CIUnitTestCase
{
service('autoloader')->addNamespace(
'Tests\Support\MigrationTestMigrations',
- SUPPORTPATH . 'MigrationTestMigrations'
+ SUPPORTPATH . 'MigrationTestMigrations',
);
}
diff --git a/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce2Test.php b/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce2Test.php
index 7820b83c06..b485093438 100644
--- a/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce2Test.php
+++ b/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce2Test.php
@@ -69,7 +69,7 @@ final class DatabaseTestCaseMigrationOnce2Test extends CIUnitTestCase
{
service('autoloader')->addNamespace(
'Tests\Support\MigrationTestMigrations',
- SUPPORTPATH . 'MigrationTestMigrations'
+ SUPPORTPATH . 'MigrationTestMigrations',
);
}
diff --git a/tests/system/Database/DatabaseTestCaseTest.php b/tests/system/Database/DatabaseTestCaseTest.php
index 76867e852e..b41aba3b76 100644
--- a/tests/system/Database/DatabaseTestCaseTest.php
+++ b/tests/system/Database/DatabaseTestCaseTest.php
@@ -74,7 +74,7 @@ final class DatabaseTestCaseTest extends CIUnitTestCase
{
service('autoloader')->addNamespace(
'Tests\Support\MigrationTestMigrations',
- SUPPORTPATH . 'MigrationTestMigrations'
+ SUPPORTPATH . 'MigrationTestMigrations',
);
}
diff --git a/tests/system/Database/Live/AbstractGetFieldDataTestCase.php b/tests/system/Database/Live/AbstractGetFieldDataTestCase.php
index 0115649929..4749fabd9d 100644
--- a/tests/system/Database/Live/AbstractGetFieldDataTestCase.php
+++ b/tests/system/Database/Live/AbstractGetFieldDataTestCase.php
@@ -138,7 +138,7 @@ abstract class AbstractGetFieldDataTestCase extends CIUnitTestCase
$fields['type_enum'],
$fields['type_set'],
$fields['type_mediumtext'],
- $fields['type_double']
+ $fields['type_double'],
);
}
@@ -146,7 +146,7 @@ abstract class AbstractGetFieldDataTestCase extends CIUnitTestCase
unset(
$fields['type_set'],
$fields['type_mediumtext'],
- $fields['type_double']
+ $fields['type_double'],
);
}
diff --git a/tests/system/Database/Live/DbUtilsTest.php b/tests/system/Database/Live/DbUtilsTest.php
index b7fd569233..e20a32d8be 100644
--- a/tests/system/Database/Live/DbUtilsTest.php
+++ b/tests/system/Database/Live/DbUtilsTest.php
@@ -102,7 +102,7 @@ final class DbUtilsTest extends CIUnitTestCase
if ($this->db->DBDriver === 'OCI8') {
$this->markTestSkipped(
- 'Unsupported feature of the oracle database platform.'
+ 'Unsupported feature of the oracle database platform.',
);
}
@@ -146,7 +146,7 @@ final class DbUtilsTest extends CIUnitTestCase
if ($this->db->DBDriver === 'OCI8') {
$this->markTestSkipped(
- 'Unsupported feature of the oracle database platform.'
+ 'Unsupported feature of the oracle database platform.',
);
}
diff --git a/tests/system/Database/Live/DeleteTest.php b/tests/system/Database/Live/DeleteTest.php
index 421f5c0f43..896ab12c1d 100644
--- a/tests/system/Database/Live/DeleteTest.php
+++ b/tests/system/Database/Live/DeleteTest.php
@@ -134,15 +134,15 @@ final class DeleteTest extends CIUnitTestCase
$this->dontSeeInDatabase(
$table,
- ['type_date' => '2023-12-01', 'type_varchar' => 'test1']
+ ['type_date' => '2023-12-01', 'type_varchar' => 'test1'],
);
$this->dontSeeInDatabase(
$table,
- ['type_date' => '2023-12-02', 'type_varchar' => 'test2']
+ ['type_date' => '2023-12-02', 'type_varchar' => 'test2'],
);
$this->seeInDatabase(
$table,
- ['type_date' => '2023-12-03', 'type_varchar' => 'test3']
+ ['type_date' => '2023-12-03', 'type_varchar' => 'test3'],
);
}
diff --git a/tests/system/Database/Live/ForgeTest.php b/tests/system/Database/Live/ForgeTest.php
index 0ab672e720..d7352480aa 100644
--- a/tests/system/Database/Live/ForgeTest.php
+++ b/tests/system/Database/Live/ForgeTest.php
@@ -1457,7 +1457,7 @@ final class ForgeTest extends CIUnitTestCase
$name = array_search(
$column,
array_column($fields, 'name'),
- true
+ true,
);
if ($name === false) {
@@ -1707,7 +1707,7 @@ final class ForgeTest extends CIUnitTestCase
$indexes = array_filter(
$allIndexes,
static fn ($index): bool => ($index->name === 'db_actions_name')
- && ($index->fields === [0 => 'name'])
+ && ($index->fields === [0 => 'name']),
);
$this->assertCount(1, $indexes);
@@ -1715,14 +1715,14 @@ final class ForgeTest extends CIUnitTestCase
$indexes = array_filter(
$allIndexes,
static fn ($index): bool => ($index->name === 'db_actions_category_name')
- && ($index->fields === [0 => 'category', 1 => 'name'])
+ && ($index->fields === [0 => 'category', 1 => 'name']),
);
$this->assertCount(1, $indexes);
// check that the primary key exists
$indexes = array_filter(
$allIndexes,
- static fn ($index): bool => $index->type === 'PRIMARY'
+ static fn ($index): bool => $index->type === 'PRIMARY',
);
$this->assertCount(1, $indexes);
@@ -1755,7 +1755,7 @@ final class ForgeTest extends CIUnitTestCase
$indexes = array_filter(
$allIndexes,
static fn ($index): bool => ($index->name === 'db_actions_name')
- && ($index->fields === [0 => 'name'])
+ && ($index->fields === [0 => 'name']),
);
$this->assertCount(1, $indexes);
@@ -1780,7 +1780,7 @@ final class ForgeTest extends CIUnitTestCase
// check that the primary key exists
$indexes = array_filter(
$allIndexes,
- static fn ($index): bool => $index->type === 'PRIMARY'
+ static fn ($index): bool => $index->type === 'PRIMARY',
);
$this->assertCount(1, $indexes);
diff --git a/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php b/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php
index 2ff1f103fb..477bebe501 100644
--- a/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php
+++ b/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php
@@ -41,7 +41,7 @@ final class GetFieldDataTestCase extends AbstractGetFieldDataTestCase
$name = array_search(
$column,
array_column($fields, 'name'),
- true
+ true,
);
if ($name === false) {
diff --git a/tests/system/Database/Live/Postgre/ConnectTest.php b/tests/system/Database/Live/Postgre/ConnectTest.php
index 29de0976eb..d616a60b96 100644
--- a/tests/system/Database/Live/Postgre/ConnectTest.php
+++ b/tests/system/Database/Live/Postgre/ConnectTest.php
@@ -40,7 +40,7 @@ final class ConnectTest extends CIUnitTestCase
$this->expectException(DatabaseException::class);
$this->expectExceptionMessage(
'Unable to connect to the database.
-Main connection [Postgre]: ERROR: invalid value for parameter "client_encoding": "utf8mb4"'
+Main connection [Postgre]: ERROR: invalid value for parameter "client_encoding": "utf8mb4"',
);
$config = config('Database');
diff --git a/tests/system/Database/Live/UpdateTest.php b/tests/system/Database/Live/UpdateTest.php
index 565c8f83b9..64a84ad032 100644
--- a/tests/system/Database/Live/UpdateTest.php
+++ b/tests/system/Database/Live/UpdateTest.php
@@ -443,7 +443,7 @@ final class UpdateTest extends CIUnitTestCase
null,
['id', new RawSql($this->db->protectIdentifiers('d')
. '.' . $this->db->protectIdentifiers('country')
- . " LIKE 'U%'")]
+ . " LIKE 'U%'")],
);
$this->seeInDatabase('user', [
diff --git a/tests/system/Database/Migrations/MigrationRunnerTest.php b/tests/system/Database/Migrations/MigrationRunnerTest.php
index 0ecd2ca0b0..61517d9f75 100644
--- a/tests/system/Database/Migrations/MigrationRunnerTest.php
+++ b/tests/system/Database/Migrations/MigrationRunnerTest.php
@@ -61,7 +61,7 @@ final class MigrationRunnerTest extends CIUnitTestCase
{
service('autoloader')->addNamespace(
'Tests\Support\MigrationTestMigrations',
- SUPPORTPATH . 'MigrationTestMigrations'
+ SUPPORTPATH . 'MigrationTestMigrations',
);
}
@@ -89,7 +89,7 @@ final class MigrationRunnerTest extends CIUnitTestCase
) . $dbConfig->tests['database'];
$this->assertSame(
$database,
- $this->getPrivateProperty($db, 'database')
+ $this->getPrivateProperty($db, 'database'),
);
$this->assertSame($dbConfig->tests['DBDriver'], $this->getPrivateProperty($db, 'DBDriver'));
}
@@ -297,7 +297,7 @@ final class MigrationRunnerTest extends CIUnitTestCase
vfsStream::copyFromFileSystem(
TESTPATH . '_support/MigrationTestMigrations/Database/Migrations',
- $this->root
+ $this->root,
);
$this->expectException(ConfigException::class);
diff --git a/tests/system/Debug/ExceptionHandlerTest.php b/tests/system/Debug/ExceptionHandlerTest.php
index ddb1304c3d..619522d3c1 100644
--- a/tests/system/Debug/ExceptionHandlerTest.php
+++ b/tests/system/Debug/ExceptionHandlerTest.php
@@ -151,11 +151,11 @@ final class ExceptionHandlerTest extends CIUnitTestCase
$this->assertStringContainsString(
'ERROR: 404',
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
$this->assertStringContainsString(
'Controller or its method is not found: Foo::bar',
- $this->getStreamFilterBuffer()
+ $this->getStreamFilterBuffer(),
);
$this->resetStreamFilterBuffer();
diff --git a/tests/system/Debug/ExceptionsTest.php b/tests/system/Debug/ExceptionsTest.php
index b8279fb8e1..25601e1f39 100644
--- a/tests/system/Debug/ExceptionsTest.php
+++ b/tests/system/Debug/ExceptionsTest.php
@@ -139,7 +139,7 @@ final class ExceptionsTest extends CIUnitTestCase
foreach ($renderedBacktrace as $trace) {
$this->assertMatchesRegularExpression(
'/^\s*\d* .+(?:\(\d+\))?: \S+(?:(?:\->|::)\S+)?\(.*\)$/',
- $trace
+ $trace,
);
}
}
diff --git a/tests/system/Debug/Toolbar/Collectors/DatabaseTest.php b/tests/system/Debug/Toolbar/Collectors/DatabaseTest.php
index 9c091ee4e5..2033a6e786 100644
--- a/tests/system/Debug/Toolbar/Collectors/DatabaseTest.php
+++ b/tests/system/Debug/Toolbar/Collectors/DatabaseTest.php
@@ -48,7 +48,7 @@ final class DatabaseTest extends CIUnitTestCase
$this->assertArrayHasKey('index', $trace);
$this->assertSame(
sprintf('%s', $i + 1),
- preg_replace(sprintf('/%s/', chr(0xC2) . chr(0xA0)), '', $trace['index'])
+ preg_replace(sprintf('/%s/', chr(0xC2) . chr(0xA0)), '', $trace['index']),
);
// since we merged file & line together
diff --git a/tests/system/Debug/Toolbar/Collectors/HistoryTest.php b/tests/system/Debug/Toolbar/Collectors/HistoryTest.php
index 3a5411a96a..6e72f2726e 100644
--- a/tests/system/Debug/Toolbar/Collectors/HistoryTest.php
+++ b/tests/system/Debug/Toolbar/Collectors/HistoryTest.php
@@ -88,7 +88,7 @@ final class HistoryTest extends CIUnitTestCase
$this->assertSame($request['time'], sprintf('%.6f', $time));
$this->assertSame(
$request['datetime'],
- DateTime::createFromFormat('U.u', $time)->format('Y-m-d H:i:s.u')
+ DateTime::createFromFormat('U.u', $time)->format('Y-m-d H:i:s.u'),
);
$this->assertSame($request['active'], ($time === $activeRowTime));
diff --git a/tests/system/Email/EmailTest.php b/tests/system/Email/EmailTest.php
index 389b657e57..ca26743c3d 100644
--- a/tests/system/Email/EmailTest.php
+++ b/tests/system/Email/EmailTest.php
@@ -182,11 +182,11 @@ final class EmailTest extends CIUnitTestCase
$this->assertStringStartsWith('ci-logo.png@', $cid);
$this->assertStringStartsWith(
'ci-logo.png@',
- $email->archive['attachments'][0]['cid']
+ $email->archive['attachments'][0]['cid'],
);
$this->assertMatchesRegularExpression(
'/
/u',
- $email->archive['body']
+ $email->archive['body'],
);
}
@@ -208,11 +208,11 @@ final class EmailTest extends CIUnitTestCase
$this->assertStringStartsWith('image001.png@', $cid);
$this->assertStringStartsWith(
'image001.png@',
- $email->archive['attachments'][0]['cid']
+ $email->archive['attachments'][0]['cid'],
);
$this->assertMatchesRegularExpression(
'/
/u',
- $email->archive['body']
+ $email->archive['body'],
);
}
}
diff --git a/tests/system/Filters/CorsTest.php b/tests/system/Filters/CorsTest.php
index bbbbefc0b4..5e25af0572 100644
--- a/tests/system/Filters/CorsTest.php
+++ b/tests/system/Filters/CorsTest.php
@@ -89,7 +89,7 @@ final class CorsTest extends CIUnitTestCase
'maxAge' => 0,
'supportsCredentials' => false,
],
- $options
+ $options,
);
return new Cors($passedOptions);
@@ -119,7 +119,7 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
'Access-Control-Allow-Origin',
- 'http://localhost'
+ 'http://localhost',
);
}
@@ -208,7 +208,7 @@ final class CorsTest extends CIUnitTestCase
{
$this->expectException(ConfigException::class);
$this->expectExceptionMessage(
- 'When responding to a credentialed request, the server must not specify the "*" wildcard for the Access-Control-Allow-Headers response-header value.'
+ 'When responding to a credentialed request, the server must not specify the "*" wildcard for the Access-Control-Allow-Headers response-header value.',
);
$this->cors = $this->createCors(['allowedHeaders' => ['*'], 'supportsCredentials' => true]);
@@ -249,7 +249,7 @@ final class CorsTest extends CIUnitTestCase
$this->assertTrue($response->hasHeader('Access-Control-Expose-Headers'));
$this->assertHeader(
'Access-Control-Expose-Headers',
- 'x-exposed-header, x-another-exposed-header'
+ 'x-exposed-header, x-another-exposed-header',
);
}
@@ -257,7 +257,7 @@ final class CorsTest extends CIUnitTestCase
{
$this->expectException(ConfigException::class);
$this->expectExceptionMessage(
- 'When responding to a credentialed request, the server must not specify the "*" wildcard for the Access-Control-Allow-Origin response-header value.'
+ 'When responding to a credentialed request, the server must not specify the "*" wildcard for the Access-Control-Allow-Origin response-header value.',
);
$this->cors = $this->createCors([
@@ -273,7 +273,7 @@ final class CorsTest extends CIUnitTestCase
{
$this->expectException(ConfigException::class);
$this->expectExceptionMessage(
- 'When responding to a credentialed request, the server must not specify the "*" wildcard for the Access-Control-Allow-Origin response-header value.'
+ 'When responding to a credentialed request, the server must not specify the "*" wildcard for the Access-Control-Allow-Origin response-header value.',
);
$this->cors = $this->createCors([
@@ -303,7 +303,7 @@ final class CorsTest extends CIUnitTestCase
{
$this->expectException(ConfigException::class);
$this->expectExceptionMessage(
- "If wildcard is specified, you must set `'allowedOrigins' => ['*']`. But using wildcard is not recommended."
+ "If wildcard is specified, you must set `'allowedOrigins' => ['*']`. But using wildcard is not recommended.",
);
$this->cors = $this->createCors([
diff --git a/tests/system/Filters/FiltersTest.php b/tests/system/Filters/FiltersTest.php
index d4a390c113..3c44cc5c67 100644
--- a/tests/system/Filters/FiltersTest.php
+++ b/tests/system/Filters/FiltersTest.php
@@ -97,7 +97,7 @@ final class FiltersTest extends CIUnitTestCase
$filtersConfig = $this->createConfigFromArray(FiltersConfig::class, $config);
$filters = $this->createFilters(
$filtersConfig,
- new CLIRequest(new MockAppConfig())
+ new CLIRequest(new MockAppConfig()),
);
$expected = [
diff --git a/tests/system/Format/FormatTest.php b/tests/system/Format/FormatTest.php
index 74252c7b56..91fb618209 100644
--- a/tests/system/Format/FormatTest.php
+++ b/tests/system/Format/FormatTest.php
@@ -56,7 +56,7 @@ final class FormatTest extends CIUnitTestCase
{
$this->format->getConfig()->formatters = array_merge(
$this->format->getConfig()->formatters,
- ['text/xml' => 'App\Foo']
+ ['text/xml' => 'App\Foo'],
);
$this->expectException(FormatException::class);
@@ -68,7 +68,7 @@ final class FormatTest extends CIUnitTestCase
{
$this->format->getConfig()->formatters = array_merge(
$this->format->getConfig()->formatters,
- ['text/xml' => URI::class]
+ ['text/xml' => URI::class],
);
$this->expectException(FormatException::class);
diff --git a/tests/system/HTTP/CURLRequestTest.php b/tests/system/HTTP/CURLRequestTest.php
index 7c2d7b1713..3d1543c15e 100644
--- a/tests/system/HTTP/CURLRequestTest.php
+++ b/tests/system/HTTP/CURLRequestTest.php
@@ -914,12 +914,12 @@ accept-ranges: bytes\x0d\x0a\x0d\x0a";
$this->assertCount(3, $setCookieHeaders);
$this->assertSame(
'logged_in=no; Path=/; Domain=github.com; Expires=Mon, 11 Nov 2024 02:27:05 GMT; HttpOnly; Secure; SameSite=Lax',
- $setCookieHeaders[2]->getValue()
+ $setCookieHeaders[2]->getValue(),
);
$this->assertSame(
'_octo=GH1.1.599292127.1699669625; Path=/; Domain=github.com; Expires=Mon, 11 Nov 2024 02:27:05 GMT; Secure; SameSite=Lax',
- $setCookieHeaders[1]->getValueLine()
+ $setCookieHeaders[1]->getValueLine(),
);
}
@@ -1067,7 +1067,7 @@ accept-ranges: bytes\x0d\x0a\x0d\x0a";
$this->assertSame(
http_build_query($params),
- $this->request->curl_options[CURLOPT_POSTFIELDS]
+ $this->request->curl_options[CURLOPT_POSTFIELDS],
);
$params['afile'] = new CURLFile(__FILE__);
@@ -1076,7 +1076,7 @@ accept-ranges: bytes\x0d\x0a\x0d\x0a";
$this->assertSame(
$params,
- $this->request->curl_options[CURLOPT_POSTFIELDS]
+ $this->request->curl_options[CURLOPT_POSTFIELDS],
);
}
@@ -1098,7 +1098,7 @@ accept-ranges: bytes\x0d\x0a\x0d\x0a";
$expected = json_encode($params);
$this->assertSame(
$expected,
- $this->request->curl_options[CURLOPT_POSTFIELDS]
+ $this->request->curl_options[CURLOPT_POSTFIELDS],
);
}
@@ -1116,11 +1116,11 @@ accept-ranges: bytes\x0d\x0a\x0d\x0a";
$expected = json_encode($params);
$this->assertSame(
$expected,
- $this->request->curl_options[CURLOPT_POSTFIELDS]
+ $this->request->curl_options[CURLOPT_POSTFIELDS],
);
$this->assertSame(
'Content-Type: application/json',
- $this->request->curl_options[CURLOPT_HTTPHEADER][0]
+ $this->request->curl_options[CURLOPT_HTTPHEADER][0],
);
}
diff --git a/tests/system/HTTP/ContentSecurityPolicyTest.php b/tests/system/HTTP/ContentSecurityPolicyTest.php
index c1d90554fc..c4e6688ef1 100644
--- a/tests/system/HTTP/ContentSecurityPolicyTest.php
+++ b/tests/system/HTTP/ContentSecurityPolicyTest.php
@@ -441,7 +441,7 @@ final class ContentSecurityPolicyTest extends CIUnitTestCase
$result = $this->work($body);
$nonceStyle = array_filter(
$this->getPrivateProperty($this->csp, 'styleSrc'),
- static fn ($value): bool => str_starts_with($value, 'nonce-')
+ static fn ($value): bool => str_starts_with($value, 'nonce-'),
);
$this->assertStringContainsString('nonce=', $this->response->getBody());
@@ -516,7 +516,7 @@ final class ContentSecurityPolicyTest extends CIUnitTestCase
$result = $this->work($body);
$nonceScript = array_filter(
$this->getPrivateProperty($this->csp, 'scriptSrc'),
- static fn ($value): bool => str_starts_with($value, 'nonce-')
+ static fn ($value): bool => str_starts_with($value, 'nonce-'),
);
$this->assertStringContainsString('nonce=', $this->response->getBody());
diff --git a/tests/system/HTTP/CorsTest.php b/tests/system/HTTP/CorsTest.php
index bdb29567df..1002c557d3 100644
--- a/tests/system/HTTP/CorsTest.php
+++ b/tests/system/HTTP/CorsTest.php
@@ -109,20 +109,20 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'http://localhost:8080'
+ 'http://localhost:8080',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Headers',
- 'X-API-KEY, X-Requested-With, Content-Type, Accept'
+ 'X-API-KEY, X-Requested-With, Content-Type, Accept',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Methods',
- 'PUT'
+ 'PUT',
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Credentials')
+ $response->hasHeader('Access-Control-Allow-Credentials'),
);
}
@@ -144,22 +144,22 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'https://api.example.com'
+ 'https://api.example.com',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Headers',
- 'X-API-KEY, X-Requested-With, Content-Type, Accept'
+ 'X-API-KEY, X-Requested-With, Content-Type, Accept',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Methods',
- 'PUT'
+ 'PUT',
);
$this->assertHeader(
$response,
'Vary',
- 'Origin'
+ 'Origin',
);
}
@@ -182,22 +182,22 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'https://api.example.com'
+ 'https://api.example.com',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Headers',
- 'X-API-KEY, X-Requested-With, Content-Type, Accept'
+ 'X-API-KEY, X-Requested-With, Content-Type, Accept',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Methods',
- 'PUT'
+ 'PUT',
);
$this->assertHeader(
$response,
'Vary',
- 'Accept-Language, Origin'
+ 'Accept-Language, Origin',
);
}
@@ -217,13 +217,13 @@ final class CorsTest extends CIUnitTestCase
$response = $cors->handlePreflightRequest($request, $response);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Origin')
+ $response->hasHeader('Access-Control-Allow-Origin'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Headers')
+ $response->hasHeader('Access-Control-Allow-Headers'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Methods')
+ $response->hasHeader('Access-Control-Allow-Methods'),
);
}
@@ -245,22 +245,22 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'https://api.example.com'
+ 'https://api.example.com',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Headers',
- 'X-API-KEY, X-Requested-With, Content-Type, Accept'
+ 'X-API-KEY, X-Requested-With, Content-Type, Accept',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Methods',
- 'PUT'
+ 'PUT',
);
$this->assertHeader(
$response,
'Vary',
- 'Origin'
+ 'Origin',
);
}
@@ -280,13 +280,13 @@ final class CorsTest extends CIUnitTestCase
$response = $cors->handlePreflightRequest($request, $response);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Origin')
+ $response->hasHeader('Access-Control-Allow-Origin'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Headers')
+ $response->hasHeader('Access-Control-Allow-Headers'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Methods')
+ $response->hasHeader('Access-Control-Allow-Methods'),
);
}
@@ -309,22 +309,22 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'http://localhost:8080'
+ 'http://localhost:8080',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Headers',
- 'X-API-KEY, X-Requested-With, Content-Type, Accept'
+ 'X-API-KEY, X-Requested-With, Content-Type, Accept',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Methods',
- 'PUT'
+ 'PUT',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Credentials',
- 'true'
+ 'true',
);
}
@@ -346,16 +346,16 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'http://localhost:8080'
+ 'http://localhost:8080',
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Headers')
+ $response->hasHeader('Access-Control-Allow-Headers'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Methods')
+ $response->hasHeader('Access-Control-Allow-Methods'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Credentials')
+ $response->hasHeader('Access-Control-Allow-Credentials'),
);
}
@@ -377,7 +377,7 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'http://localhost:8080'
+ 'http://localhost:8080',
);
}
@@ -401,12 +401,12 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'http://localhost:8080'
+ 'http://localhost:8080',
);
$this->assertHeader(
$response,
'Access-Control-Allow-Credentials',
- 'true'
+ 'true',
);
}
@@ -429,12 +429,12 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'http://localhost:8080'
+ 'http://localhost:8080',
);
$this->assertHeader(
$response,
'Access-Control-Expose-Headers',
- 'Content-Length, X-Kuma-Revision'
+ 'Content-Length, X-Kuma-Revision',
);
}
@@ -455,18 +455,18 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'https://api.example.com'
+ 'https://api.example.com',
);
$this->assertHeader(
$response,
'Vary',
- 'Origin'
+ 'Origin',
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Headers')
+ $response->hasHeader('Access-Control-Allow-Headers'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Methods')
+ $response->hasHeader('Access-Control-Allow-Methods'),
);
}
@@ -488,12 +488,12 @@ final class CorsTest extends CIUnitTestCase
$this->assertHeader(
$response,
'Access-Control-Allow-Origin',
- 'https://api.example.com'
+ 'https://api.example.com',
);
$this->assertHeader(
$response,
'Vary',
- 'Accept-Language, Origin'
+ 'Accept-Language, Origin',
);
}
@@ -512,13 +512,13 @@ final class CorsTest extends CIUnitTestCase
$response = $cors->addResponseHeaders($request, $response);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Origin')
+ $response->hasHeader('Access-Control-Allow-Origin'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Headers')
+ $response->hasHeader('Access-Control-Allow-Headers'),
);
$this->assertFalse(
- $response->hasHeader('Access-Control-Allow-Methods')
+ $response->hasHeader('Access-Control-Allow-Methods'),
);
}
}
diff --git a/tests/system/HTTP/IncomingRequestTest.php b/tests/system/HTTP/IncomingRequestTest.php
index fa76e8289d..d3e542b4ac 100644
--- a/tests/system/HTTP/IncomingRequestTest.php
+++ b/tests/system/HTTP/IncomingRequestTest.php
@@ -290,7 +290,7 @@ final class IncomingRequestTest extends CIUnitTestCase
$this->assertSame(
'utf-8',
- $this->request->negotiate('charset', ['iso-8859', 'unicode-1-2'])
+ $this->request->negotiate('charset', ['iso-8859', 'unicode-1-2']),
);
}
@@ -299,7 +299,7 @@ final class IncomingRequestTest extends CIUnitTestCase
$this->request->setHeader('Accept', 'text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c');
$this->assertSame(
'text/html',
- $this->request->negotiate('media', ['text/html', 'text/x-c', 'text/x-dvi', 'text/plain'])
+ $this->request->negotiate('media', ['text/html', 'text/x-c', 'text/x-dvi', 'text/plain']),
);
}
@@ -436,17 +436,17 @@ final class IncomingRequestTest extends CIUnitTestCase
$this->assertSame(
$expected,
- $request->getJsonVar(null, true, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)
+ $request->getJsonVar(null, true, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION),
);
$this->assertSame(
$expected['array'],
- $request->getJsonVar('array', true, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)
+ $request->getJsonVar('array', true, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION),
);
$this->assertSame(
['array' => $expected['array'], 'float' => $expected['float']],
- $request->getJsonVar(['array', 'float'], true, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)
+ $request->getJsonVar(['array', 'float'], true, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION),
);
$result = $request->getJsonVar(['array', 'float'], false, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
@@ -1165,7 +1165,7 @@ final class IncomingRequestTest extends CIUnitTestCase
{
$this->expectException(ConfigException::class);
$this->expectExceptionMessage(
- 'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'
+ 'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.',
);
$config = new App();
diff --git a/tests/system/HTTP/MessageTest.php b/tests/system/HTTP/MessageTest.php
index d16224367a..ac33869396 100644
--- a/tests/system/HTTP/MessageTest.php
+++ b/tests/system/HTTP/MessageTest.php
@@ -311,7 +311,7 @@ final class MessageTest extends CIUnitTestCase
{
$this->message->addHeader(
'Set-Cookie',
- 'logged_in=no; Path=/'
+ 'logged_in=no; Path=/',
);
$header = $this->message->header('Set-Cookie');
@@ -324,11 +324,11 @@ final class MessageTest extends CIUnitTestCase
{
$this->message->addHeader(
'Set-Cookie',
- 'logged_in=no; Path=/'
+ 'logged_in=no; Path=/',
);
$this->message->addHeader(
'Set-Cookie',
- 'sessid=123456; Path=/'
+ 'sessid=123456; Path=/',
);
$headers = $this->message->header('Set-Cookie');
@@ -342,16 +342,16 @@ final class MessageTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'The header "Set-Cookie" already has multiple headers. You cannot change them. If you really need to change, remove the header first.'
+ 'The header "Set-Cookie" already has multiple headers. You cannot change them. If you really need to change, remove the header first.',
);
$this->message->addHeader(
'Set-Cookie',
- 'logged_in=no; Path=/'
+ 'logged_in=no; Path=/',
);
$this->message->addHeader(
'Set-Cookie',
- 'sessid=123456; Path=/'
+ 'sessid=123456; Path=/',
);
$this->message->appendHeader('Set-Cookie', 'HttpOnly');
@@ -361,16 +361,16 @@ final class MessageTest extends CIUnitTestCase
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
- 'The header "Set-Cookie" already has multiple headers. You cannot use getHeaderLine().'
+ 'The header "Set-Cookie" already has multiple headers. You cannot use getHeaderLine().',
);
$this->message->addHeader(
'Set-Cookie',
- 'logged_in=no; Path=/'
+ 'logged_in=no; Path=/',
);
$this->message->addHeader(
'Set-Cookie',
- 'sessid=123456; Path=/'
+ 'sessid=123456; Path=/',
);
$this->message->getHeaderLine('Set-Cookie');
diff --git a/tests/system/HTTP/RedirectExceptionTest.php b/tests/system/HTTP/RedirectExceptionTest.php
index cd90a9aa14..bde10ea8df 100644
--- a/tests/system/HTTP/RedirectExceptionTest.php
+++ b/tests/system/HTTP/RedirectExceptionTest.php
@@ -49,7 +49,7 @@ final class RedirectExceptionTest extends TestCase
service('response')
->redirect('redirect')
->setCookie('cookie', 'value')
- ->setHeader('Redirect-Header', 'value')
+ ->setHeader('Redirect-Header', 'value'),
))->getResponse();
$this->assertSame('redirect', $response->getHeaderLine('location'));
@@ -62,7 +62,7 @@ final class RedirectExceptionTest extends TestCase
{
$this->expectException(LogicException::class);
$this->expectExceptionMessage(
- 'The Response object passed to RedirectException does not contain a redirect address.'
+ 'The Response object passed to RedirectException does not contain a redirect address.',
);
new RedirectException(service('response'));
diff --git a/tests/system/HTTP/RedirectResponseTest.php b/tests/system/HTTP/RedirectResponseTest.php
index 1614244d76..d6203aa935 100644
--- a/tests/system/HTTP/RedirectResponseTest.php
+++ b/tests/system/HTTP/RedirectResponseTest.php
@@ -61,7 +61,7 @@ final class RedirectResponseTest extends CIUnitTestCase
$this->config,
new SiteURI($this->config),
null,
- new UserAgent()
+ new UserAgent(),
);
Services::injectMock('request', $this->request);
}
diff --git a/tests/system/HTTP/ResponseSendTest.php b/tests/system/HTTP/ResponseSendTest.php
index c7ad15195d..db72de5d2f 100644
--- a/tests/system/HTTP/ResponseSendTest.php
+++ b/tests/system/HTTP/ResponseSendTest.php
@@ -173,7 +173,7 @@ final class ResponseSendTest extends CIUnitTestCase
'',
'/',
'',
- true
+ true,
);
// send it
diff --git a/tests/system/HTTP/ResponseTest.php b/tests/system/HTTP/ResponseTest.php
index 3137620029..eeac917c7c 100644
--- a/tests/system/HTTP/ResponseTest.php
+++ b/tests/system/HTTP/ResponseTest.php
@@ -175,7 +175,7 @@ final class ResponseTest extends CIUnitTestCase
$this->assertSame(
'; rel="first",; rel="prev",; rel="next",; rel="last"',
- $response->header('Link')->getValue()
+ $response->header('Link')->getValue(),
);
$pager->store('default', 1, 10, 200);
@@ -183,7 +183,7 @@ final class ResponseTest extends CIUnitTestCase
$this->assertSame(
'; rel="next",; rel="last"',
- $response->header('Link')->getValue()
+ $response->header('Link')->getValue(),
);
$pager->store('default', 20, 10, 200);
@@ -191,7 +191,7 @@ final class ResponseTest extends CIUnitTestCase
$this->assertSame(
'; rel="first",; rel="prev"',
- $response->header('Link')->getValue()
+ $response->header('Link')->getValue(),
);
}
@@ -276,7 +276,7 @@ final class ResponseTest extends CIUnitTestCase
string $protocol,
string $method,
?int $code,
- int $expectedCode
+ int $expectedCode,
): void {
$_SERVER['SERVER_SOFTWARE'] = $server;
$_SERVER['SERVER_PROTOCOL'] = $protocol;
@@ -319,7 +319,7 @@ final class ResponseTest extends CIUnitTestCase
string $protocol,
string $method,
?int $code,
- int $expectedCode
+ int $expectedCode,
): void {
$_SERVER['SERVER_SOFTWARE'] = 'Microsoft-IIS';
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';
diff --git a/tests/system/HTTP/SiteURIFactoryTest.php b/tests/system/HTTP/SiteURIFactoryTest.php
index 62e20639b5..b26fde04b2 100644
--- a/tests/system/HTTP/SiteURIFactoryTest.php
+++ b/tests/system/HTTP/SiteURIFactoryTest.php
@@ -93,7 +93,7 @@ final class SiteURIFactoryTest extends CIUnitTestCase
string $uriString,
string $expectUriString,
string $expectedPath,
- string $expectedRoutePath
+ string $expectedRoutePath,
): void {
$factory = $this->createSiteURIFactory();
@@ -134,7 +134,7 @@ final class SiteURIFactoryTest extends CIUnitTestCase
string $uriString,
string $expectUriString,
string $expectedPath,
- string $expectedRoutePath
+ string $expectedRoutePath,
): void {
$config = new App();
$config->indexPage = '';
diff --git a/tests/system/HTTP/SiteURITest.php b/tests/system/HTTP/SiteURITest.php
index 644aaa795b..bd7e9ca3d3 100644
--- a/tests/system/HTTP/SiteURITest.php
+++ b/tests/system/HTTP/SiteURITest.php
@@ -40,7 +40,7 @@ final class SiteURITest extends CIUnitTestCase
string $expectedQuery,
string $expectedFragment,
array $expectedSegments,
- int $expectedTotalSegments
+ int $expectedTotalSegments,
): void {
$config = new App();
$config->indexPage = $indexPage;
@@ -337,7 +337,7 @@ final class SiteURITest extends CIUnitTestCase
string $expectedQuery,
string $expectedFragment,
array $expectedSegments,
- int $expectedTotalSegments
+ int $expectedTotalSegments,
): void {
$config = new App();
$config->indexPage = $indexPage;
diff --git a/tests/system/HTTP/URITest.php b/tests/system/HTTP/URITest.php
index 517e2d8889..945b132876 100644
--- a/tests/system/HTTP/URITest.php
+++ b/tests/system/HTTP/URITest.php
@@ -953,15 +953,15 @@ final class URITest extends CIUnitTestCase
{
$this->assertSame(
'http://entirely.different.com/subfolder',
- (string) (new URI('entirely.different.com/subfolder'))
+ (string) (new URI('entirely.different.com/subfolder')),
);
$this->assertSame(
'http://localhost/subfolder',
- (string) (new URI('localhost/subfolder'))
+ (string) (new URI('localhost/subfolder')),
);
$this->assertSame(
'http://localtest.me/subfolder',
- (string) (new URI('localtest.me/subfolder'))
+ (string) (new URI('localtest.me/subfolder')),
);
}
@@ -1052,7 +1052,7 @@ final class URITest extends CIUnitTestCase
// going through request
$this->assertSame(
'http://example.com/ci/v4/controller/method',
- (string) $request->getUri()
+ (string) $request->getUri(),
);
$this->assertSame('/ci/v4/controller/method', $request->getUri()->getPath());
$this->assertSame('controller/method', $request->getUri()->getRoutePath());
@@ -1086,18 +1086,18 @@ final class URITest extends CIUnitTestCase
// going through request
$this->assertSame(
'http://example.com/ci/v4/index.php/controller/method',
- (string) $request->getUri()
+ (string) $request->getUri(),
);
$this->assertSame(
'/ci/v4/index.php/controller/method',
- $request->getUri()->getPath()
+ $request->getUri()->getPath(),
);
// standalone
$uri = new URI('http://example.com/ci/v4/index.php/controller/method');
$this->assertSame(
'http://example.com/ci/v4/index.php/controller/method',
- (string) $uri
+ (string) $uri,
);
$this->assertSame('/ci/v4/index.php/controller/method', $uri->getPath());
@@ -1126,7 +1126,7 @@ final class URITest extends CIUnitTestCase
// Detected by request
$this->assertSame(
'https://example.com/ci/v4/controller/method',
- (string) $request->getUri()
+ (string) $request->getUri(),
);
// Standalone
@@ -1135,7 +1135,7 @@ final class URITest extends CIUnitTestCase
$this->assertSame(
trim($uri->getPath(), '/'),
- trim($request->getUri()->getPath(), '/')
+ trim($request->getUri()->getPath(), '/'),
);
}
diff --git a/tests/system/Helpers/DateHelperTest.php b/tests/system/Helpers/DateHelperTest.php
index 4e7acf649a..ec0d3ded0d 100644
--- a/tests/system/Helpers/DateHelperTest.php
+++ b/tests/system/Helpers/DateHelperTest.php
@@ -46,7 +46,7 @@ final class DateHelperTest extends CIUnitTestCase
// Chicago should be two hours ahead of Vancouver
$this->assertSame(
7200,
- now('America/Chicago') - now('America/Vancouver')
+ now('America/Chicago') - now('America/Vancouver'),
);
Time::setTestNow();
@@ -84,7 +84,7 @@ final class DateHelperTest extends CIUnitTestCase
$this->assertSame(
$expected,
- timezone_select('custom-select', 'Asia/Jakarta', $spesificRegion)
+ timezone_select('custom-select', 'Asia/Jakarta', $spesificRegion),
);
}
@@ -105,7 +105,7 @@ final class DateHelperTest extends CIUnitTestCase
$this->assertSame(
$expected,
- timezone_select('custom-select', 'Asia/Jakarta', $spesificRegion, $country)
+ timezone_select('custom-select', 'Asia/Jakarta', $spesificRegion, $country),
);
}
}
diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php
index 9023fd73ac..91d5aa2e8c 100644
--- a/tests/system/Helpers/FormHelperTest.php
+++ b/tests/system/Helpers/FormHelperTest.php
@@ -944,12 +944,12 @@ final class FormHelperTest extends CIUnitTestCase
$this->assertSame(
'',
- set_checkbox('fruit', 'apple', true)
+ set_checkbox('fruit', 'apple', true),
);
$this->assertSame(
'',
- set_checkbox('fruit', 'apple')
+ set_checkbox('fruit', 'apple'),
);
}
diff --git a/tests/system/Helpers/HTMLHelperTest.php b/tests/system/Helpers/HTMLHelperTest.php
index b715925370..b6d0610723 100644
--- a/tests/system/Helpers/HTMLHelperTest.php
+++ b/tests/system/Helpers/HTMLHelperTest.php
@@ -338,7 +338,7 @@ final class HTMLHelperTest extends CIUnitTestCase
$this->assertMatchesRegularExpression(
'!