[Core][CS] Minor refactor

This commit is contained in:
Kevin Kaniaburka 2022-09-19 09:42:34 +02:00
parent b960b052ba
commit 704aeda3bb
No known key found for this signature in database
GPG key ID: 8DB4C54474F3FD72
6 changed files with 16 additions and 14 deletions

View file

@ -1,6 +0,0 @@
flysystem:
storages:
sylius.storage:
adapter: 'local'
options:
directory: '%sylius_core.images_dir%'

View file

@ -16,7 +16,7 @@ namespace Sylius\Component\Core\Filesystem\Adapter;
use League\Flysystem\FilesystemOperator;
use Sylius\Component\Core\Filesystem\Exception\FileNotFoundException;
class FlysystemFilesystemAdapter implements FilesystemAdapterInterface
final class FlysystemFilesystemAdapter implements FilesystemAdapterInterface
{
public function __construct(private FilesystemOperator $filesystem)
{

View file

@ -17,9 +17,9 @@ use Gaufrette\FilesystemInterface;
use Sylius\Component\Core\Filesystem\Exception\FileNotFoundException;
/**
* @deprecated since version 1.12, to be removed in 2.0. Use {@link FilesystemInterface} instead.
* @deprecated since version 1.12, to be removed in 2.0. Use {@link FlysystemFilesystemAdapter} instead.
*/
class GaufretteFilesystemAdapter implements FilesystemAdapterInterface
final class GaufretteFilesystemAdapter implements FilesystemAdapterInterface
{
public function __construct(private FilesystemInterface $filesystem)
{

View file

@ -13,13 +13,10 @@ declare(strict_types=1);
namespace Sylius\Component\Core\Filesystem\Exception;
use Throwable;
final class FileNotFoundException extends \RuntimeException
{
public function __construct(string $fileLocation, ?\Exception $previousException = null)
{
parent::__construct(sprintf('File "%s" could not be found.', $fileLocation), 0, $previousException);
}
}

View file

@ -1,5 +1,16 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace spec\Sylius\Component\Core\Filesystem\Adapter;
use League\Flysystem\FilesystemOperator;
@ -7,7 +18,7 @@ use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Filesystem\Adapter\FilesystemAdapterInterface;
use Sylius\Component\Core\Filesystem\Exception\FileNotFoundException;
class FlysystemFilesystemAdapterSpec extends ObjectBehavior
final class FlysystemFilesystemAdapterSpec extends ObjectBehavior
{
function let(FilesystemOperator $filesystem): void
{

View file

@ -18,7 +18,7 @@ use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Filesystem\Adapter\FilesystemAdapterInterface;
use Sylius\Component\Core\Filesystem\Exception\FileNotFoundException;
class GaufretteFilesystemAdapterSpec extends ObjectBehavior
final class GaufretteFilesystemAdapterSpec extends ObjectBehavior
{
function let(FilesystemInterface $filesystem): void
{