Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jun 2, 2023
2 parents b56c8b7 + 1de90e4 commit 894d298
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
'no_useless_else' => true,
'no_useless_return' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true],
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
'ordered_class_elements' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']],
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/MediaAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public function listAction(Request $request): Response

$rootCategory = null;
if (
$this->container->has('sonata.media.manager.category') &&
$this->container->has('sonata.media.manager.context')
$this->container->has('sonata.media.manager.category')
&& $this->container->has('sonata.media.manager.context')
) {
$categoryManager = $this->container->get('sonata.media.manager.category');
\assert($categoryManager instanceof CategoryManagerInterface);
Expand Down
4 changes: 2 additions & 2 deletions src/Provider/BaseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ final public function flushCdn(MediaInterface $media): void

foreach ($this->getFormats() as $format => $settings) {
if (
MediaProviderInterface::FORMAT_ADMIN === $format ||
substr($format, 0, \strlen($media->getContext() ?? '')) === $media->getContext()
MediaProviderInterface::FORMAT_ADMIN === $format
|| substr($format, 0, \strlen($media->getContext() ?? '')) === $media->getContext()
) {
$flushPaths[] = $this->getFilesystem()->get($this->generatePrivateUrl($media, $format), true)->getKey();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Provider/FileProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ protected function doTransform(MediaInterface $media): void
}

// this is the name used to store the file
if (null === $media->getProviderReference() ||
MediaInterface::MISSING_BINARY_REFERENCE === $media->getProviderReference()
if (null === $media->getProviderReference()
|| MediaInterface::MISSING_BINARY_REFERENCE === $media->getProviderReference()
) {
$media->setProviderReference($this->generateReferenceName($media));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Thumbnail/FormatThumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public function generate(MediaProviderInterface $provider, MediaInterface $media

foreach ($provider->getFormats() as $format => $settings) {
if (
substr($format, 0, \strlen($media->getContext() ?? '')) === $media->getContext() ||
MediaProviderInterface::FORMAT_ADMIN === $format
substr($format, 0, \strlen($media->getContext() ?? '')) === $media->getContext()
|| MediaProviderInterface::FORMAT_ADMIN === $format
) {
$resizer = null !== $settings['resizer'] && $this->hasResizer($settings['resizer']) ?
$this->getResizer($settings['resizer']) :
Expand Down

0 comments on commit 894d298

Please sign in to comment.