From 5893ebd308776a26bc361bae9dea25ab6d65418d Mon Sep 17 00:00:00 2001 From: Emmanuel Averty Date: Thu, 5 Jan 2023 09:10:47 +0100 Subject: [PATCH] typos corrected by phpstan --- src/Decorator/FlysystemFile.php | 4 ++-- src/Field/Configurator/ImageConfigurator.php | 2 +- src/Field/ImageField.php | 2 +- src/Form/DataTransformer/StringToFileTransformer.php | 2 +- tests/Form/DataTransformer/StringToFileTransformerTest.php | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Decorator/FlysystemFile.php b/src/Decorator/FlysystemFile.php index 7d80b37f8d..4dc59ec4fb 100644 --- a/src/Decorator/FlysystemFile.php +++ b/src/Decorator/FlysystemFile.php @@ -3,7 +3,7 @@ namespace EasyCorp\Bundle\EasyAdminBundle\Decorator; use League\Flysystem\FilesystemOperator; -use Symfony\Component\HttpFoundation\File\File as File; +use Symfony\Component\HttpFoundation\File\File; class FlysystemFile extends File { @@ -25,4 +25,4 @@ public function getMTime(): int { return $this->filesystemOperator->lastModified($this->getPathname()); } -} \ No newline at end of file +} diff --git a/src/Field/Configurator/ImageConfigurator.php b/src/Field/Configurator/ImageConfigurator.php index 9883ea71ec..0de9b7002b 100644 --- a/src/Field/Configurator/ImageConfigurator.php +++ b/src/Field/Configurator/ImageConfigurator.php @@ -78,7 +78,7 @@ private function getImagesPaths(?array $images, ?string $basePath, ?FilesystemOp private function getImagePath(?string $imagePath, ?string $basePath, ?FilesystemOperator $filesystemOperator): ?string { - if (null !==$filesystemOperator && null !== $imagePath) { + if (null !== $filesystemOperator && null !== $imagePath) { try { return $filesystemOperator->publicUrl($imagePath); } catch (UnableToGeneratePublicUrl $e) { diff --git a/src/Field/ImageField.php b/src/Field/ImageField.php index 74db2084f5..9ff0a80ae5 100644 --- a/src/Field/ImageField.php +++ b/src/Field/ImageField.php @@ -86,7 +86,7 @@ public function setUploadedFileNamePattern($patternOrCallable): self * - move uploaded file to its final destination * - delete the previously uploaded file * - retrieve file public url - * See https://github.com/thephpleague/flysystem-bundle + * See https://github.com/thephpleague/flysystem-bundle. */ public function setFilesystemOperator(FilesystemOperator $filesystemOperator): self { diff --git a/src/Form/DataTransformer/StringToFileTransformer.php b/src/Form/DataTransformer/StringToFileTransformer.php index 021d036d4c..e80cac8048 100644 --- a/src/Form/DataTransformer/StringToFileTransformer.php +++ b/src/Form/DataTransformer/StringToFileTransformer.php @@ -2,11 +2,11 @@ namespace EasyCorp\Bundle\EasyAdminBundle\Form\DataTransformer; +use EasyCorp\Bundle\EasyAdminBundle\Decorator\FlysystemFile; use League\Flysystem\FilesystemOperator; use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\TransformationFailedException; use Symfony\Component\HttpFoundation\File\File; -use EasyCorp\Bundle\EasyAdminBundle\Decorator\FlysystemFile; use Symfony\Component\HttpFoundation\File\UploadedFile; /** diff --git a/tests/Form/DataTransformer/StringToFileTransformerTest.php b/tests/Form/DataTransformer/StringToFileTransformerTest.php index 0ba5886e57..54610b7f68 100644 --- a/tests/Form/DataTransformer/StringToFileTransformerTest.php +++ b/tests/Form/DataTransformer/StringToFileTransformerTest.php @@ -9,11 +9,10 @@ class StringToFileTransformerTest extends TestCase { - public function testTransform(): void { - $uploadFilename = static fn($value) => 'foo'; - $uploadValidate = static fn($filename) => 'foo'; + $uploadFilename = static fn ($value) => 'foo'; + $uploadValidate = static fn ($filename) => 'foo'; $filesystemOperatorMock = $this->createStub(FilesystemOperator::class); $filesystemOperatorMock ->method('fileExists')