From 8c23fed9a8aec75de116fddc44a9051a294bc4fc Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 17 Jan 2024 05:48:48 +0900 Subject: [PATCH] style: fix incorrect case method name --- phpstan-baseline.php | 5 ----- system/Files/File.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index e63572442810..c5fcc2b39491 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -1846,11 +1846,6 @@ 'count' => 1, 'path' => __DIR__ . '/system/Exceptions/PageNotFoundException.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Call to method SplFileInfo\\:\\:getBasename\\(\\) with incorrect case\\: getBaseName$#', - 'count' => 1, - 'path' => __DIR__ . '/system/Files/File.php', -]; $ignoreErrors[] = [ 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', 'count' => 1, diff --git a/system/Files/File.php b/system/Files/File.php index 4e4ee388047e..0113112914ff 100644 --- a/system/Files/File.php +++ b/system/Files/File.php @@ -140,7 +140,7 @@ public function getRandomName(): string public function move(string $targetPath, ?string $name = null, bool $overwrite = false) { $targetPath = rtrim($targetPath, '/') . '/'; - $name ??= $this->getBaseName(); + $name ??= $this->getBasename(); $destination = $overwrite ? $targetPath . $name : $this->getDestination($targetPath . $name); $oldName = $this->getRealPath() ?: $this->__toString();