Skip to content

Commit

Permalink
Merge pull request #1516 from liip/cs
Browse files Browse the repository at this point in the history
fix cs with updated php-cs-fixer
  • Loading branch information
dbu authored May 23, 2023
2 parents 1a1d299 + 418e7a5 commit 58b067f
Show file tree
Hide file tree
Showing 73 changed files with 29 additions and 410 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -21,7 +21,7 @@ jobs:
coverage: none

- name: Update project dependencies
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v2

- name: Add vips
run: composer require rokka/imagine-vips
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
stability: 'dev'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Configure coverage driver
id: coverage
Expand Down Expand Up @@ -94,12 +94,12 @@ jobs:
run: composer remove --dev --no-update symfony/messenger

- name: Update project dependencies
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Cache PHPUnit
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor/bin/.phpunit
key: ${{ runner.os }}-phpunit-${{ matrix.php }}
Expand Down
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
'get_class_to_class_keyword' => false, // not compatible with PHP 7
]);
3 changes: 0 additions & 3 deletions Async/CacheResolved.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ public function getUris(): array
return $this->uris;
}

/**
* {@inheritdoc}
*/
public function jsonSerialize(): array
{
return ['path' => $this->path, 'uris' => $this->uris];
Expand Down
3 changes: 0 additions & 3 deletions Async/ResolveCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ public function isForce(): bool
return $this->force;
}

/**
* {@inheritdoc}
*/
public function jsonSerialize(): array
{
return ['path' => $this->path, 'filters' => $this->filters, 'force' => $this->force];
Expand Down
3 changes: 0 additions & 3 deletions Binary/Loader/AbstractDoctrineLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public function __construct($manager, $class = null)
$this->class = $class;
}

/**
* {@inheritdoc}
*/
public function find($path)
{
$image = $this->manager->find($this->class, $this->mapPathToId($path));
Expand Down
3 changes: 0 additions & 3 deletions Binary/Loader/ChainLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ public function __construct(array $loaders)
});
}

/**
* {@inheritdoc}
*/
public function find($path)
{
$exceptions = [];
Expand Down
3 changes: 0 additions & 3 deletions Binary/Loader/FileSystemLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ public function __construct(
$this->locator = $locator;
}

/**
* {@inheritdoc}
*/
public function find($path)
{
$path = $this->locator->locate($path);
Expand Down
3 changes: 0 additions & 3 deletions Binary/Loader/FlysystemLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ public function __construct(
$this->filesystem = $filesystem;
}

/**
* {@inheritdoc}
*/
public function find($path)
{
if (false === $this->filesystem->has($path)) {
Expand Down
3 changes: 0 additions & 3 deletions Binary/Loader/FlysystemV2Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public function __construct(
$this->filesystem = $filesystem;
}

/**
* {@inheritdoc}
*/
public function find($path)
{
try {
Expand Down
2 changes: 0 additions & 2 deletions Binary/Loader/LoaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ interface LoaderInterface
*
* The path may be a file path on a filesystem, or any unique identifier among the storage engine implemented by this Loader.
*
* @param mixed $path
*
* @return BinaryInterface|string An image binary content
*/
public function find($path);
Expand Down
3 changes: 0 additions & 3 deletions Binary/Loader/StreamLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ public function __construct($wrapperPrefix, $context = null)
$this->context = empty($context) ? null : $context;
}

/**
* {@inheritdoc}
*/
public function find($path)
{
$name = $this->wrapperPrefix.$path;
Expand Down
6 changes: 3 additions & 3 deletions Binary/Locator/FileSystemInsecureLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class FileSystemInsecureLocator extends FileSystemLocator
{
protected function generateAbsolutePath(string $root, string $path): ?string
{
if (false === mb_strpos($path, '..'.DIRECTORY_SEPARATOR) &&
false === mb_strpos($path, DIRECTORY_SEPARATOR.'..') &&
false !== file_exists($absolute = $root.DIRECTORY_SEPARATOR.$path)
if (false === mb_strpos($path, '..'.DIRECTORY_SEPARATOR)
&& false === mb_strpos($path, DIRECTORY_SEPARATOR.'..')
&& false !== file_exists($absolute = $root.DIRECTORY_SEPARATOR.$path)
) {
return $absolute;
}
Expand Down
3 changes: 0 additions & 3 deletions Binary/SimpleMimeTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ public function __construct($mimeTypeGuesser)
$this->mimeTypeGuesser = $mimeTypeGuesser;
}

/**
* {@inheritdoc}
*/
public function guess($binary)
{
if (false === $tmpFile = tempnam(sys_get_temp_dir(), 'liip-imagine-bundle')) {
Expand Down
4 changes: 2 additions & 2 deletions Controller/ImagineController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(
FilterService $filterService,
DataManager $dataManager,
SignerInterface $signer,
?ControllerConfig $controllerConfig = null
ControllerConfig $controllerConfig = null
) {
$this->filterService = $filterService;
$this->dataManager = $dataManager;
Expand Down Expand Up @@ -156,7 +156,7 @@ private function getFiltersBc(Request $request): array
return $runtimeConfig;
}

private function createRedirectResponse(\Closure $url, string $path, string $filter, ?string $hash = null): RedirectResponse
private function createRedirectResponse(\Closure $url, string $path, string $filter, string $hash = null): RedirectResponse
{
try {
return new RedirectResponse($url(), $this->controllerConfig->getRedirectResponseCode());
Expand Down
8 changes: 4 additions & 4 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public function getConfigTreeBuilder(): TreeBuilder
->beforeNormalization()
->ifTrue(function ($v) {
return
empty($v['loaders']) ||
empty($v['loaders']['default']) ||
empty($v['resolvers']) ||
empty($v['resolvers']['default']);
empty($v['loaders'])
|| empty($v['loaders']['default'])
|| empty($v['resolvers'])
|| empty($v['resolvers']['default']);
})
->then(function ($v) {
if (empty($v['loaders'])) {
Expand Down
9 changes: 0 additions & 9 deletions DependencyInjection/Factory/Loader/ChainLoaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

class ChainLoaderFactory extends AbstractLoaderFactory
{
/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $loaderName, array $config): string
{
$definition = $this->getChildLoaderDefinition();
Expand All @@ -28,17 +25,11 @@ public function create(ContainerBuilder $container, $loaderName, array $config):
return $this->setTaggedLoaderDefinition($loaderName, $definition, $container);
}

/**
* {@inheritdoc}
*/
public function getName(): string
{
return 'chain';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(ArrayNodeDefinition $builder): void
{
$builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

class FileSystemLoaderFactory extends AbstractLoaderFactory
{
/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $loaderName, array $config)
{
$locatorDefinition = new ChildDefinition(sprintf('liip_imagine.binary.locator.%s', $config['locator']));
Expand All @@ -41,17 +38,11 @@ public function create(ContainerBuilder $container, $loaderName, array $config)
return $this->setTaggedLoaderDefinition($loaderName, $definition, $container);
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'filesystem';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(ArrayNodeDefinition $builder)
{
$builder
Expand Down
9 changes: 0 additions & 9 deletions DependencyInjection/Factory/Loader/FlysystemLoaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

class FlysystemLoaderFactory extends AbstractLoaderFactory
{
/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $loaderName, array $config)
{
$definition = $this->getChildLoaderDefinition($this->getChildLoaderName());
Expand All @@ -35,17 +32,11 @@ public function create(ContainerBuilder $container, $loaderName, array $config)
return $this->setTaggedLoaderDefinition($loaderName, $definition, $container);
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'flysystem';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(ArrayNodeDefinition $builder)
{
$builder
Expand Down
9 changes: 0 additions & 9 deletions DependencyInjection/Factory/Loader/StreamLoaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

class StreamLoaderFactory extends AbstractLoaderFactory
{
/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $loaderName, array $config)
{
$definition = $this->getChildLoaderDefinition();
Expand All @@ -28,17 +25,11 @@ public function create(ContainerBuilder $container, $loaderName, array $config)
return $this->setTaggedLoaderDefinition($loaderName, $definition, $container);
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'stream';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(ArrayNodeDefinition $builder)
{
$builder
Expand Down
9 changes: 0 additions & 9 deletions DependencyInjection/Factory/Resolver/AwsS3ResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

class AwsS3ResolverFactory extends AbstractResolverFactory
{
/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $resolverName, array $config)
{
$awsS3ClientId = 'liip_imagine.cache.resolver.'.$resolverName.'.client';
Expand Down Expand Up @@ -74,17 +71,11 @@ public function create(ContainerBuilder $container, $resolverName, array $config
return $resolverId;
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'aws_s3';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(ArrayNodeDefinition $builder)
{
$builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

class FlysystemResolverFactory extends AbstractResolverFactory
{
/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $resolverName, array $config)
{
$resolverDefinition = $this->getChildResolverDefinition($this->getChildResolverName());
Expand All @@ -38,17 +35,11 @@ public function create(ContainerBuilder $container, $resolverName, array $config
return $resolverId;
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'flysystem';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(ArrayNodeDefinition $builder)
{
$builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

class WebPathResolverFactory extends AbstractResolverFactory
{
/**
* {@inheritdoc}
*/
public function create(ContainerBuilder $container, $resolverName, array $config)
{
$resolverDefinition = $this->getChildResolverDefinition();
Expand All @@ -35,17 +32,11 @@ public function create(ContainerBuilder $container, $resolverName, array $config
return $resolverId;
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'web_path';
}

/**
* {@inheritdoc}
*/
public function addConfiguration(ArrayNodeDefinition $builder)
{
$builder
Expand Down
Loading

0 comments on commit 58b067f

Please sign in to comment.