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 Aug 12, 2022
2 parents 10e02e1 + 32e5122 commit 4aee6c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
20 changes: 4 additions & 16 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,26 @@
HEADER;

$rules = [
'@PHP70Migration' => true,
'@PHP70Migration:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@PHPUnit57Migration:risky' => true,
'@PHPUnit60Migration:risky' => true,
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@PSR12' => true,
'@PSR12:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false],
'header_comment' => ['header' => $header],
'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],
'no_useless_else' => true,
'no_useless_return' => 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']],
'php_unit_method_casing' => false,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_strict' => true,
'php_unit_test_annotation' => false,
'php_unit_test_case_static_method_calls' => true,
'phpdoc_order' => true,
'phpdoc_to_comment' => ['ignored_tags' => ['psalm-suppress']],
'single_line_throw' => false,
'static_lambda' => true,
Expand Down
20 changes: 10 additions & 10 deletions src/Command/UpdateCdnStatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ protected function configure(): void
->addArgument('context', InputArgument::OPTIONAL, 'The context')
->setHelp(
<<<'EOF'
The <info>%command.name%</info> command helps maintaining your model media in sync
with the CDN. Since the flush process in a CDN is not an immediate operation, the
media that is marked as flushable has the status <info>CDNInterface::STATUS_TO_FLUSH</info>
when it is updated. This command iterates over the media, retrieves the flush status
from the CDN and performs the update in your model based on the CDN response.
The <info>%command.name%</info> command helps maintaining your model media in sync
with the CDN. Since the flush process in a CDN is not an immediate operation, the
media that is marked as flushable has the status <info>CDNInterface::STATUS_TO_FLUSH</info>
when it is updated. This command iterates over the media, retrieves the flush status
from the CDN and performs the update in your model based on the CDN response.
When you execute the command, it will prompt for a media provider and context:
When you execute the command, it will prompt for a media provider and context:
<info>php %command.full_name%</info>
<info>php %command.full_name%</info>
You can also pass the media provider and the context as arguments:
You can also pass the media provider and the context as arguments:
<info>php %command.full_name% sonata.media.provider.file default</info>
<info>php %command.full_name% sonata.media.provider.file default</info>
EOF
EOF
);
}

Expand Down
16 changes: 4 additions & 12 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,7 @@ private function addProvidersSection(ArrayNodeDefinition $node): void
->arrayNode('allowed_extensions')
->beforeNormalization()
->ifArray()
->then(static function (array $allowedExtensions): array {
return array_map('strtolower', $allowedExtensions);
})
->then(static fn (array $allowedExtensions): array => array_map('strtolower', $allowedExtensions))
->end()
->prototype('scalar')->end()
->defaultValue([
Expand All @@ -308,9 +306,7 @@ private function addProvidersSection(ArrayNodeDefinition $node): void
->arrayNode('allowed_mime_types')
->beforeNormalization()
->ifArray()
->then(static function (array $allowedMimeTypes): array {
return array_map('strtolower', $allowedMimeTypes);
})
->then(static fn (array $allowedMimeTypes): array => array_map('strtolower', $allowedMimeTypes))
->end()
->prototype('scalar')->end()
->defaultValue([
Expand Down Expand Up @@ -338,19 +334,15 @@ private function addProvidersSection(ArrayNodeDefinition $node): void
->arrayNode('allowed_extensions')
->beforeNormalization()
->ifArray()
->then(static function (array $allowedExtensions): array {
return array_map('strtolower', $allowedExtensions);
})
->then(static fn (array $allowedExtensions): array => array_map('strtolower', $allowedExtensions))
->end()
->prototype('scalar')->end()
->defaultValue(['jpg', 'png', 'jpeg'])
->end()
->arrayNode('allowed_mime_types')
->beforeNormalization()
->ifArray()
->then(static function (array $allowedMimeTypes): array {
return array_map('strtolower', $allowedMimeTypes);
})
->then(static fn (array $allowedMimeTypes): array => array_map('strtolower', $allowedMimeTypes))
->end()
->prototype('scalar')->end()
->defaultValue([
Expand Down

0 comments on commit 4aee6c9

Please sign in to comment.