From ad7e46a4ff3f2924615b18e99691b57e780ab6ac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:57:09 +1100 Subject: [PATCH] Update dependency rector/rector to v0.19.7 (#1165) * Update dependency rector/rector to v0.19.7 * Updated coding standards in tools. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alex Skrypnyk --- .drevops/devtool/composer.lock | 12 ++++++------ .drevops/installer/src/Command/InstallCommand.php | 8 ++++---- .../installer/tests/phpunit/Unit/UnitTestBase.php | 8 ++++++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.drevops/devtool/composer.lock b/.drevops/devtool/composer.lock index 948d8aada..51c2b117e 100644 --- a/.drevops/devtool/composer.lock +++ b/.drevops/devtool/composer.lock @@ -3526,16 +3526,16 @@ }, { "name": "rector/rector", - "version": "0.19.5", + "version": "0.19.7", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "89c895d127b9d248d2af007068a824b5348ef81f" + "reference": "53f16f413e74e92059981801ba82576064b3181a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/89c895d127b9d248d2af007068a824b5348ef81f", - "reference": "89c895d127b9d248d2af007068a824b5348ef81f", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/53f16f413e74e92059981801ba82576064b3181a", + "reference": "53f16f413e74e92059981801ba82576064b3181a", "shasum": "" }, "require": { @@ -3570,7 +3570,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.19.5" + "source": "https://github.com/rectorphp/rector/tree/0.19.7" }, "funding": [ { @@ -3578,7 +3578,7 @@ "type": "github" } ], - "time": "2024-01-29T23:53:47+00:00" + "time": "2024-02-04T23:23:09+00:00" }, { "name": "sebastian/cli-parser", diff --git a/.drevops/installer/src/Command/InstallCommand.php b/.drevops/installer/src/Command/InstallCommand.php index 8f4ca843e..91f9d254c 100644 --- a/.drevops/installer/src/Command/InstallCommand.php +++ b/.drevops/installer/src/Command/InstallCommand.php @@ -2119,7 +2119,7 @@ protected static function parseDotenv($filename = '.env'): false|array { // Replace all # not inside quotes. $contents = preg_replace('/#(?=(?:(?:[^"]*"){2})*[^"]*$)/', ';', $contents); - return parse_ini_string($contents); + return parse_ini_string((string) $contents); } protected static function loadDotenv($filename = '.env', $override_existing = FALSE) { @@ -2197,7 +2197,7 @@ protected function commandExists(string $command) { protected static function toHumanName($value): ?string { $value = preg_replace('/[^a-zA-Z0-9]/', ' ', (string) $value); - $value = trim($value); + $value = trim((string) $value); return preg_replace('/\s{2,}/', ' ', $value); } @@ -2211,11 +2211,11 @@ protected static function toMachineName($value, $preserve_chars = []): string { $value = preg_replace($pattern, '_', (string) $value); - return strtolower($value); + return strtolower((string) $value); } protected static function toCamelCase($value, $capitalise_first = FALSE): string|array { - $value = str_replace(' ', '', ucwords(preg_replace('/[^a-zA-Z0-9]/', ' ', (string) $value))); + $value = str_replace(' ', '', ucwords((string) preg_replace('/[^a-zA-Z0-9]/', ' ', (string) $value))); return $capitalise_first ? $value : lcfirst($value); } diff --git a/.drevops/installer/tests/phpunit/Unit/UnitTestBase.php b/.drevops/installer/tests/phpunit/Unit/UnitTestBase.php index be1b88ca5..4ac64dcba 100644 --- a/.drevops/installer/tests/phpunit/Unit/UnitTestBase.php +++ b/.drevops/installer/tests/phpunit/Unit/UnitTestBase.php @@ -45,10 +45,14 @@ public function cleanupFixtureDir(): void { /** * Create fixture files. + * + * @return string[] + * Created file names. */ - protected function createFixtureFiles($files, $basedir = NULL, $append_rand = TRUE) { + protected function createFixtureFiles($files, $basedir = NULL, $append_rand = TRUE): array { $fs = new Filesystem(); $created = []; + foreach ($files as $file) { $basedir = $basedir ?? dirname((string) $file); $relative_dst = ltrim(str_replace($basedir, '', (string) $file), '/') . ($append_rand ? rand(1000, 9999) : ''); @@ -69,7 +73,7 @@ protected function createFixtureFiles($files, $basedir = NULL, $append_rand = TR * @return string * Fixture directory path. */ - protected function getFixtureDir($name = NULL) { + protected function getFixtureDir($name = NULL): string { $parent = dirname(__FILE__); $path = $parent . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Fixtures'; $path .= $name ? DIRECTORY_SEPARATOR . $name : '';