Skip to content

Commit

Permalink
Merge pull request #1141: Apply php8.1 in Rector preset
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Sep 10, 2024
1 parent c3c5507 commit bde4ac0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Command/CommandCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function perform(): int
{
$declaration = $this->createDeclaration(CommandDeclaration::class, [
'description' => $this->description,
'alias' => $this->alias ?? \strtolower(\preg_replace('/(?<!^)[A-Z]/', ':$0', $this->name)),
'alias' => $this->alias ?? \strtolower((string) \preg_replace('/(?<!^)[A-Z]/', ':$0', $this->name)),
]);

foreach ($this->arguments as $argument) {
Expand Down
6 changes: 3 additions & 3 deletions src/Config/ScaffolderConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
}

Expand Down

0 comments on commit bde4ac0

Please sign in to comment.