From 3d425ffd8c462e1fbf3b553c4bd07bb57556edad Mon Sep 17 00:00:00 2001 From: Sonata CI Date: Mon, 19 Apr 2021 10:02:54 +0100 Subject: [PATCH] DevKit updates for 3.x branch (#1949) * DevKit updates * Applied fixes from FlintCI (#1951) * DevKit updates * DevKit updates * DevKit updates * Remove final annotation for extended classes Co-authored-by: Sullivan SENECHAL Co-authored-by: Vincent Langlet --- .github/workflows/documentation.yaml | 3 -- .github/workflows/lint.yaml | 5 +-- .github/workflows/test.yaml | 3 -- .php_cs.dist | 1 + .symfony.bundle.yaml | 19 +++++++++ phpunit.xml.dist | 3 +- src/Admin/BaseMediaAdmin.php | 3 +- src/Admin/GalleryAdmin.php | 12 ++---- src/Admin/GalleryHasMediaAdmin.php | 6 +-- src/Admin/ODM/MediaAdmin.php | 3 +- src/Admin/ORM/MediaAdmin.php | 3 +- src/Block/MediaBlockService.php | 2 - .../Compiler/AddProviderCompilerPass.php | 3 +- src/DependencyInjection/Configuration.php | 33 ++++++---------- .../SonataMediaExtension.php | 39 +++++++------------ src/Provider/FileProvider.php | 3 -- src/Twig/Node/MediaNode.php | 3 +- src/Twig/Node/PathNode.php | 3 +- src/Twig/Node/ThumbnailNode.php | 3 +- .../ImageUploadDimensionValidatorTest.php | 3 +- tests/Provider/PoolTest.php | 9 ++--- tests/Resizer/CropResizerTest.php | 21 ++++------ 22 files changed, 70 insertions(+), 113 deletions(-) create mode 100644 .symfony.bundle.yaml diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index f03703954..8bb2bffaa 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -11,9 +11,6 @@ on: - master pull_request: -env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - jobs: build: name: Sphinx build diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 0a8715138..fcd727fcc 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,9 +11,6 @@ on: - master pull_request: -env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - jobs: php-cs-fixer: name: PHP-CS-Fixer @@ -25,7 +22,7 @@ jobs: uses: actions/checkout@v2 - name: Run PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga:2.18.1 + uses: docker://oskarstark/php-cs-fixer-ga:2.18.5 with: args: --ansi --verbose --diff --dry-run diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b34933238..2d1f6fb1a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,9 +11,6 @@ on: - master pull_request: -env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - jobs: test: name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }} diff --git a/.php_cs.dist b/.php_cs.dist index 675f179b7..dbcf93f52 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -39,6 +39,7 @@ $rules = [ 'list_syntax' => ['syntax' => 'short'], 'logical_operators' => true, 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], 'no_extra_blank_lines' => true, 'no_php4_constructor' => true, 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], diff --git a/.symfony.bundle.yaml b/.symfony.bundle.yaml new file mode 100644 index 000000000..8b374e69d --- /dev/null +++ b/.symfony.bundle.yaml @@ -0,0 +1,19 @@ +# DO NOT EDIT THIS FILE! +# +# It's auto-generated by sonata-project/dev-kit package. + +branches: + - 3.x + - master + +maintained_branches: + - 3.x + - master + +doc_dir: 'docs/' + +current_branch: 3.x + +dev_branch: master + +# dev_branch_alias: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 59c3b69fd..b3bd4faba 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -28,8 +28,7 @@ It's auto-generated by sonata-project/dev-kit package. - - + diff --git a/src/Admin/BaseMediaAdmin.php b/src/Admin/BaseMediaAdmin.php index 9d90bb161..9d6a13933 100644 --- a/src/Admin/BaseMediaAdmin.php +++ b/src/Admin/BaseMediaAdmin.php @@ -156,8 +156,7 @@ protected function configureListFields(ListMapper $listMapper) ->addIdentifier('name') ->add('description') ->add('enabled') - ->add('size') - ; + ->add('size'); } protected function configureFormFields(FormMapper $formMapper) diff --git a/src/Admin/GalleryAdmin.php b/src/Admin/GalleryAdmin.php index 9af1633b1..326d60ee1 100644 --- a/src/Admin/GalleryAdmin.php +++ b/src/Admin/GalleryAdmin.php @@ -88,8 +88,7 @@ protected function configureFormFields(FormMapper $formMapper) // NEXT_MAJOR: Change Gallery key to `form_group.gallery` and update translations files. ->with('Gallery', ['class' => 'col-md-9'])->end() // NEXT_MAJOR: Change Options key to `form_group.options` and update translations files. - ->with('Options', ['class' => 'col-md-3'])->end() - ; + ->with('Options', ['class' => 'col-md-3'])->end(); $context = $this->getPersistentParameter('context'); @@ -127,8 +126,7 @@ protected function configureFormFields(FormMapper $formMapper) 'link_parameters' => ['context' => $context], 'admin_code' => 'sonata.media.admin.gallery_has_media', ]) - ->end() - ; + ->end(); } protected function configureListFields(ListMapper $listMapper) @@ -137,8 +135,7 @@ protected function configureListFields(ListMapper $listMapper) ->addIdentifier('name') ->add('enabled', 'boolean', ['editable' => true]) ->add('context', 'trans', ['catalogue' => 'SonataMediaBundle']) - ->add('defaultFormat', 'trans', ['catalogue' => 'SonataMediaBundle']) - ; + ->add('defaultFormat', 'trans', ['catalogue' => 'SonataMediaBundle']); } protected function configureDatagridFilters(DatagridMapper $datagridMapper) @@ -148,7 +145,6 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper) ->add('enabled') ->add('context', null, [ 'show_filter' => false, - ]) - ; + ]); } } diff --git a/src/Admin/GalleryHasMediaAdmin.php b/src/Admin/GalleryHasMediaAdmin.php index af32a893a..e3fd59fe5 100644 --- a/src/Admin/GalleryHasMediaAdmin.php +++ b/src/Admin/GalleryHasMediaAdmin.php @@ -45,8 +45,7 @@ protected function configureFormFields(FormMapper $formMapper) 'link_parameters' => $link_parameters, ]) ->add('enabled', null, ['required' => false]) - ->add('position', HiddenType::class) - ; + ->add('position', HiddenType::class); } protected function configureListFields(ListMapper $listMapper) @@ -55,7 +54,6 @@ protected function configureListFields(ListMapper $listMapper) ->add('media') ->add('gallery') ->add('position') - ->add('enabled') - ; + ->add('enabled'); } } diff --git a/src/Admin/ODM/MediaAdmin.php b/src/Admin/ODM/MediaAdmin.php index 23ac7f550..a70648241 100644 --- a/src/Admin/ODM/MediaAdmin.php +++ b/src/Admin/ODM/MediaAdmin.php @@ -27,7 +27,6 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper) ->add('name') ->add('providerReference') ->add('enabled') - ->add('context') - ; + ->add('context'); } } diff --git a/src/Admin/ORM/MediaAdmin.php b/src/Admin/ORM/MediaAdmin.php index 334cfd7b1..78cfe27ea 100644 --- a/src/Admin/ORM/MediaAdmin.php +++ b/src/Admin/ORM/MediaAdmin.php @@ -48,8 +48,7 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper) $datagridMapper ->add('width') ->add('height') - ->add('contentType') - ; + ->add('contentType'); $providers = []; diff --git a/src/Block/MediaBlockService.php b/src/Block/MediaBlockService.php index fb51d2b61..9ca8131d6 100644 --- a/src/Block/MediaBlockService.php +++ b/src/Block/MediaBlockService.php @@ -36,8 +36,6 @@ use Twig\Environment; /** - * @final since sonata-project/media-bundle 3.21.0 - * * @author Thomas Rabaix */ class MediaBlockService extends AbstractBlockService diff --git a/src/DependencyInjection/Compiler/AddProviderCompilerPass.php b/src/DependencyInjection/Compiler/AddProviderCompilerPass.php index abc9e6a16..64e6609f3 100644 --- a/src/DependencyInjection/Compiler/AddProviderCompilerPass.php +++ b/src/DependencyInjection/Compiler/AddProviderCompilerPass.php @@ -80,8 +80,7 @@ public function attachArguments(ContainerBuilder $container, array $settings) ->replaceArgument(1, new Reference($config['filesystem'])) ->replaceArgument(2, new Reference($config['cdn'])) ->replaceArgument(3, new Reference($config['generator'])) - ->replaceArgument(4, new Reference($config['thumbnail'])) - ; + ->replaceArgument(4, new Reference($config['thumbnail'])); if ($config['resizer']) { $definition->addMethodCall('setResizer', [new Reference($config['resizer'])]); diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index fcd125330..361921c80 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -68,8 +68,7 @@ public function getConfigTreeBuilder() ->scalarNode('constraint')->defaultValue(true)->end() ->end() ->end() - ->end() - ; + ->end(); $this->addContextsSection($node); $this->addCdnSection($node); @@ -127,8 +126,7 @@ private function addContextsSection(ArrayNodeDefinition $node): void ->end() ->end() ->end() - ->end() - ; + ->end(); } private function addCdnSection(ArrayNodeDefinition $node): void @@ -178,8 +176,7 @@ private function addCdnSection(ArrayNodeDefinition $node): void ->end() ->end() ->end() - ->end() - ; + ->end(); } private function addFilesystemSection(ArrayNodeDefinition $node): void @@ -333,8 +330,7 @@ private function addFilesystemSection(ArrayNodeDefinition $node): void ->end() ->end() ->end() - ->end() - ; + ->end(); } private function addProvidersSection(ArrayNodeDefinition $node): void @@ -441,8 +437,7 @@ private function addProvidersSection(ArrayNodeDefinition $node): void ->end() ->end() ->end() - ->end() - ; + ->end(); } private function addExtraSection(ArrayNodeDefinition $node): void @@ -458,8 +453,7 @@ private function addExtraSection(ArrayNodeDefinition $node): void ->scalarNode('referrer')->defaultValue('Sonata Media')->end() ->end() ->end() - ->end() - ; + ->end(); } private function addModelSection(ArrayNodeDefinition $node): void @@ -475,8 +469,7 @@ private function addModelSection(ArrayNodeDefinition $node): void ->scalarNode('category')->defaultValue('Application\\Sonata\\ClassificationBundle\\Entity\\Category')->end() ->end() ->end() - ->end() - ; + ->end(); } private function addBuzzSection(ArrayNodeDefinition $node): void @@ -498,8 +491,7 @@ private function addBuzzSection(ArrayNodeDefinition $node): void ->end() ->end() ->end() - ->end() - ; + ->end(); } private function addHttpClientSection(ArrayNodeDefinition $node): void @@ -519,8 +511,7 @@ private function addHttpClientSection(ArrayNodeDefinition $node): void ->end() ->end() ->end() - ->end() - ; + ->end(); } private function addResizerSection(ArrayNodeDefinition $node): void @@ -550,8 +541,7 @@ private function addResizerSection(ArrayNodeDefinition $node): void ->scalarNode('default')->defaultValue('sonata.media.resizer.simple')->end() ->end() ->end() - ->end() - ; + ->end(); } private function addAdapterSection(ArrayNodeDefinition $node): void @@ -564,8 +554,7 @@ private function addAdapterSection(ArrayNodeDefinition $node): void ->scalarNode('default')->defaultValue('sonata.media.adapter.image.gd')->end() ->end() ->end() - ->end() - ; + ->end(); } /** diff --git a/src/DependencyInjection/SonataMediaExtension.php b/src/DependencyInjection/SonataMediaExtension.php index c51d5fcb7..b17fbab0e 100644 --- a/src/DependencyInjection/SonataMediaExtension.php +++ b/src/DependencyInjection/SonataMediaExtension.php @@ -172,13 +172,11 @@ public function configureProviders(ContainerBuilder $container, array $config) $container->getDefinition('sonata.media.provider.image') ->replaceArgument(5, array_map('strtolower', $config['providers']['image']['allowed_extensions'])) ->replaceArgument(6, $config['providers']['image']['allowed_mime_types']) - ->replaceArgument(7, new Reference($config['providers']['image']['adapter'])) - ; + ->replaceArgument(7, new Reference($config['providers']['image']['adapter'])); $container->getDefinition('sonata.media.provider.file') ->replaceArgument(5, $config['providers']['file']['allowed_extensions']) - ->replaceArgument(6, $config['providers']['file']['allowed_mime_types']) - ; + ->replaceArgument(6, $config['providers']['file']['allowed_mime_types']); $container->getDefinition('sonata.media.provider.youtube')->replaceArgument(7, $config['providers']['youtube']['html5']); } @@ -313,8 +311,7 @@ public function configureCdnAdapter(ContainerBuilder $container, array $config) // add the default configuration for the server cdn if ($container->hasDefinition('sonata.media.cdn.server') && isset($config['cdn']['server'])) { $container->getDefinition('sonata.media.cdn.server') - ->replaceArgument(0, $config['cdn']['server']['path']) - ; + ->replaceArgument(0, $config['cdn']['server']['path']); } else { $container->removeDefinition('sonata.media.cdn.server'); } @@ -324,8 +321,7 @@ public function configureCdnAdapter(ContainerBuilder $container, array $config) ->replaceArgument(0, $config['cdn']['panther']['path']) ->replaceArgument(1, $config['cdn']['panther']['username']) ->replaceArgument(2, $config['cdn']['panther']['password']) - ->replaceArgument(3, $config['cdn']['panther']['site_id']) - ; + ->replaceArgument(3, $config['cdn']['panther']['site_id']); } else { $container->removeDefinition('sonata.media.cdn.panther'); } @@ -362,8 +358,7 @@ public function configureCdnAdapter(ContainerBuilder $container, array $config) if ($container->hasDefinition('sonata.media.cdn.fallback') && isset($config['cdn']['fallback'])) { $container->getDefinition('sonata.media.cdn.fallback') ->replaceArgument(0, new Reference($config['cdn']['fallback']['master'])) - ->replaceArgument(1, new Reference($config['cdn']['fallback']['fallback'])) - ; + ->replaceArgument(1, new Reference($config['cdn']['fallback']['fallback'])); } else { $container->removeDefinition('sonata.media.cdn.fallback'); } @@ -378,8 +373,7 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c if ($container->hasDefinition('sonata.media.adapter.filesystem.local') && isset($config['filesystem']['local'])) { $container->getDefinition('sonata.media.adapter.filesystem.local') ->addArgument($config['filesystem']['local']['directory']) - ->addArgument($config['filesystem']['local']['create']) - ; + ->addArgument($config['filesystem']['local']['create']); } else { $container->removeDefinition('sonata.media.adapter.filesystem.local'); } @@ -396,8 +390,7 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c 'passive' => $config['filesystem']['ftp']['passive'], 'create' => $config['filesystem']['ftp']['create'], 'mode' => $config['filesystem']['ftp']['mode'], - ]) - ; + ]); } else { $container->removeDefinition('sonata.media.adapter.filesystem.ftp'); $container->removeDefinition('sonata.media.filesystem.ftp'); @@ -408,8 +401,7 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c $container->getDefinition('sonata.media.adapter.filesystem.s3') ->replaceArgument(0, new Reference('sonata.media.adapter.service.s3')) ->replaceArgument(1, $config['filesystem']['s3']['bucket']) - ->replaceArgument(2, ['create' => $config['filesystem']['s3']['create'], 'region' => $config['filesystem']['s3']['region'], 'directory' => $config['filesystem']['s3']['directory'], 'ACL' => $config['filesystem']['s3']['acl']]) - ; + ->replaceArgument(2, ['create' => $config['filesystem']['s3']['create'], 'region' => $config['filesystem']['s3']['region'], 'directory' => $config['filesystem']['s3']['directory'], 'ACL' => $config['filesystem']['s3']['acl']]); $container->getDefinition('sonata.media.metadata.amazon') ->replaceArgument(0, [ @@ -418,8 +410,7 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c 'encryption' => $config['filesystem']['s3']['encryption'], 'meta' => $config['filesystem']['s3']['meta'], 'cache_control' => $config['filesystem']['s3']['cache_control'], - ]) - ; + ]); $arguments = [ 'region' => $config['filesystem']['s3']['region'], @@ -447,8 +438,7 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c if ($container->hasDefinition('sonata.media.adapter.filesystem.replicate') && isset($config['filesystem']['replicate'])) { $container->getDefinition('sonata.media.adapter.filesystem.replicate') ->replaceArgument(0, new Reference($config['filesystem']['replicate']['master'])) - ->replaceArgument(1, new Reference($config['filesystem']['replicate']['slave'])) - ; + ->replaceArgument(1, new Reference($config['filesystem']['replicate']['slave'])); } else { $container->removeDefinition('sonata.media.adapter.filesystem.replicate'); $container->removeDefinition('sonata.media.filesystem.replicate'); @@ -457,8 +447,7 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c if ($container->hasDefinition('sonata.media.adapter.filesystem.mogilefs') && isset($config['filesystem']['mogilefs'])) { $container->getDefinition('sonata.media.adapter.filesystem.mogilefs') ->replaceArgument(0, $config['filesystem']['mogilefs']['domain']) - ->replaceArgument(1, $config['filesystem']['mogilefs']['hosts']) - ; + ->replaceArgument(1, $config['filesystem']['mogilefs']['hosts']); } else { $container->removeDefinition('sonata.media.adapter.filesystem.mogilefs'); $container->removeDefinition('sonata.media.filesystem.mogilefs'); @@ -475,8 +464,7 @@ public function configureFilesystemAdapter(ContainerBuilder $container, array $c } $container->getDefinition('sonata.media.adapter.filesystem.opencloud.connection') ->replaceArgument(0, $config['filesystem'][$settings]['url']) - ->replaceArgument(1, $config['filesystem'][$settings]['secret']) - ; + ->replaceArgument(1, $config['filesystem'][$settings]['secret']); $container->getDefinition('sonata.media.adapter.filesystem.opencloud') ->replaceArgument(1, $config['filesystem'][$settings]['containerName']) ->replaceArgument(2, $config['filesystem'][$settings]['create_container']); @@ -495,8 +483,7 @@ public function configureExtra(ContainerBuilder $container, array $config) if ($config['pixlr']['enabled']) { $container->getDefinition('sonata.media.extra.pixlr') ->replaceArgument(0, $config['pixlr']['referrer']) - ->replaceArgument(1, $config['pixlr']['secret']) - ; + ->replaceArgument(1, $config['pixlr']['secret']); } else { $container->removeDefinition('sonata.media.extra.pixlr'); } diff --git a/src/Provider/FileProvider.php b/src/Provider/FileProvider.php index 0d138b694..f7ee76dd5 100644 --- a/src/Provider/FileProvider.php +++ b/src/Provider/FileProvider.php @@ -35,9 +35,6 @@ use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; -/** - * @final since sonata-project/media-bundle 3.21.0 - */ class FileProvider extends BaseProvider implements FileProviderInterface { protected $allowedExtensions; diff --git a/src/Twig/Node/MediaNode.php b/src/Twig/Node/MediaNode.php index 13787907b..a686968d9 100644 --- a/src/Twig/Node/MediaNode.php +++ b/src/Twig/Node/MediaNode.php @@ -49,7 +49,6 @@ public function compile(Compiler $compiler) ->subcompile($this->getNode('format')) ->raw(', ') ->subcompile($this->getNode('attributes')) - ->raw(");\n") - ; + ->raw(");\n"); } } diff --git a/src/Twig/Node/PathNode.php b/src/Twig/Node/PathNode.php index 3c8933615..bb71e4f89 100644 --- a/src/Twig/Node/PathNode.php +++ b/src/Twig/Node/PathNode.php @@ -47,7 +47,6 @@ public function compile(Compiler $compiler) ->subcompile($this->getNode('media')) ->raw(', ') ->subcompile($this->getNode('format')) - ->raw(");\n") - ; + ->raw(");\n"); } } diff --git a/src/Twig/Node/ThumbnailNode.php b/src/Twig/Node/ThumbnailNode.php index 52dc4c9b0..e3c2b8ab7 100644 --- a/src/Twig/Node/ThumbnailNode.php +++ b/src/Twig/Node/ThumbnailNode.php @@ -49,7 +49,6 @@ public function compile(Compiler $compiler) ->subcompile($this->getNode('format')) ->raw(', ') ->subcompile($this->getNode('attributes')) - ->raw(");\n") - ; + ->raw(");\n"); } } diff --git a/tests/Fixtures/SonataClassificationBundle/Validator/Constraints/ImageUploadDimensionValidatorTest.php b/tests/Fixtures/SonataClassificationBundle/Validator/Constraints/ImageUploadDimensionValidatorTest.php index ed670cebe..bd65adfb0 100644 --- a/tests/Fixtures/SonataClassificationBundle/Validator/Constraints/ImageUploadDimensionValidatorTest.php +++ b/tests/Fixtures/SonataClassificationBundle/Validator/Constraints/ImageUploadDimensionValidatorTest.php @@ -112,8 +112,7 @@ public function testWithTooSmallImage(): void '%min_width%' => 100, '%min_height%' => 100, ]) - ->assertRaised() - ; + ->assertRaised(); } protected function createValidator(): ConstraintValidatorInterface diff --git a/tests/Provider/PoolTest.php b/tests/Provider/PoolTest.php index 8aaff9533..3f8af4a52 100644 --- a/tests/Provider/PoolTest.php +++ b/tests/Provider/PoolTest.php @@ -37,8 +37,7 @@ public function testGetEmptyProviderName(): void ->getMockBuilder(Pool::class) ->disableOriginalConstructor() ->onlyMethods([]) - ->getMock() - ; + ->getMock(); $mediaPool->getProvider(null); } @@ -52,8 +51,7 @@ public function testGetWithEmptyProviders(): void ->getMockBuilder(Pool::class) ->disableOriginalConstructor() ->onlyMethods([]) - ->getMock() - ; + ->getMock(); $mediaPool->getProvider('provider_a'); } @@ -67,8 +65,7 @@ public function testGetInvalidProviderName(): void ->getMockBuilder(Pool::class) ->disableOriginalConstructor() ->onlyMethods([]) - ->getMock() - ; + ->getMock(); $mediaPool->setProviders([ 'provider_a' => $this->createProvider('provider_a'), 'provider_b' => $this->createProvider('provider_b'), diff --git a/tests/Resizer/CropResizerTest.php b/tests/Resizer/CropResizerTest.php index 27a136f77..7345c3e43 100644 --- a/tests/Resizer/CropResizerTest.php +++ b/tests/Resizer/CropResizerTest.php @@ -77,23 +77,20 @@ public function testResize( ->with(static::callback(static function (Box $box) use ($scaleWidth, $scaleHeight): bool { return $box->getWidth() === $scaleWidth && $box->getHeight() === $scaleHeight; }), static::equalTo('outbound')) - ->willReturnReference($image) - ; + ->willReturnReference($image); $image->expects(0 === $cropWidth && 0 === $cropHeight ? static::never() : static::once()) ->method('crop') ->with(static::anything(), static::callback(static function (Box $box) use ($cropWidth, $cropHeight): bool { return $box->getWidth() === $cropWidth && $box->getHeight() === $cropHeight; })) - ->willReturnReference($image) - ; + ->willReturnReference($image); $image->method('get') ->with(self::FORMAT, [ 'quality' => self::QUALITY, ]) - ->willReturn('CONTENT') - ; + ->willReturn('CONTENT'); $this->adapter->method('load')->willReturn($image); @@ -153,8 +150,7 @@ public function testResizeNoChange( ->with(self::FORMAT, [ 'quality' => self::QUALITY, ]) - ->willReturn('CONTENT') - ; + ->willReturn('CONTENT'); $this->adapter->method('load')->willReturn($image); @@ -190,14 +186,11 @@ public function testGetBox(int $srcWidth, int $srcHeight, int $targetWidth, int { $media = $this->createMock(MediaInterface::class); $media->method('getWidth') - ->willReturn($srcWidth) - ; + ->willReturn($srcWidth); $media->method('getHeight') - ->willReturn($srcHeight) - ; + ->willReturn($srcHeight); $media->expects(static::once())->method('getBox') - ->willReturn(new Box($srcWidth, $srcHeight)) - ; + ->willReturn(new Box($srcWidth, $srcHeight)); $resizer = new CropResizer($this->adapter, $this->metadata); $box = $resizer->getBox($media, ['width' => $targetWidth, 'height' => $targetHeight]);