Skip to content

Commit

Permalink
typos corrected by phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-averty committed Jan 5, 2023
1 parent cf3eb12 commit 5893ebd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Decorator/FlysystemFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -25,4 +25,4 @@ public function getMTime(): int
{
return $this->filesystemOperator->lastModified($this->getPathname());
}
}
}
2 changes: 1 addition & 1 deletion src/Field/Configurator/ImageConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Field/ImageField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Form/DataTransformer/StringToFileTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
5 changes: 2 additions & 3 deletions tests/Form/DataTransformer/StringToFileTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5893ebd

Please sign in to comment.