From bde4ac0eb455992da0b6b502a5c9d1c2bbd83a40 Mon Sep 17 00:00:00 2001 From: spiralbot Date: Tue, 10 Sep 2024 16:56:46 +0000 Subject: [PATCH] Merge pull request #1141: Apply php8.1 in Rector preset --- src/Command/CommandCommand.php | 2 +- src/Config/ScaffolderConfig.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Command/CommandCommand.php b/src/Command/CommandCommand.php index 3f43b24..228cd5c 100644 --- a/src/Command/CommandCommand.php +++ b/src/Command/CommandCommand.php @@ -39,7 +39,7 @@ public function perform(): int { $declaration = $this->createDeclaration(CommandDeclaration::class, [ 'description' => $this->description, - 'alias' => $this->alias ?? \strtolower(\preg_replace('/(?name)), + 'alias' => $this->alias ?? \strtolower((string) \preg_replace('/(?name)), ]); foreach ($this->arguments as $argument) { diff --git a/src/Config/ScaffolderConfig.php b/src/Config/ScaffolderConfig.php index c92e48f..649a450 100644 --- a/src/Config/ScaffolderConfig.php +++ b/src/Config/ScaffolderConfig.php @@ -76,7 +76,7 @@ public function className(string $element, string $name): string */ public function classNamespace(string $element, string $name = ''): string { - $localNamespace = \trim($this->getOption($element, 'namespace', ''), '\\'); + $localNamespace = \trim((string) $this->getOption($element, 'namespace', ''), '\\'); ['namespace' => $namespace] = $this->parseName($name); if (!empty($namespace)) { @@ -209,7 +209,7 @@ private function baseNamespace(string $element): string return \trim((string)$this->getOption($element, 'baseNamespace', ''), '\\'); } - return \trim($this->config['namespace'], '\\'); + return \trim((string) $this->config['namespace'], '\\'); } private function joinPathChunks(array $chunks, string $joint): string @@ -221,7 +221,7 @@ private function joinPathChunks(array $chunks, string $joint): string $firstChunkIterated = true; $joinedPath = $chunk; } else { - $joinedPath = \rtrim($joinedPath, $joint) . $joint . \ltrim($chunk, $joint); + $joinedPath = \rtrim((string) $joinedPath, $joint) . $joint . \ltrim((string) $chunk, $joint); } }