Skip to content

Commit

Permalink
DevKit updates for 3.x branch (#1949)
Browse files Browse the repository at this point in the history
* DevKit updates

* Applied fixes from FlintCI (#1951)

* DevKit updates

* DevKit updates

* DevKit updates

* Remove final annotation for extended classes

Co-authored-by: Sullivan SENECHAL <[email protected]>
Co-authored-by: Vincent Langlet <[email protected]>
  • Loading branch information
3 people authored Apr 19, 2021
1 parent 21c4ebf commit 3d425ff
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 113 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
- master
pull_request:

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

jobs:
build:
name: Sphinx build
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
- master
pull_request:

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

jobs:
php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -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

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
19 changes: 19 additions & 0 deletions .symfony.bundle.yaml
Original file line number Diff line number Diff line change
@@ -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:
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ It's auto-generated by sonata-project/dev-kit package.

<php>
<ini name="precision" value="8" />
<!-- Use max[self]=0 when https://github.com/symfony/symfony/issues/40400 is fixed -->
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=99999" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
<env name="SYMFONY_PHPUNIT_VERSION" value="9.4" />
</php>

Expand Down
3 changes: 1 addition & 2 deletions src/Admin/BaseMediaAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ protected function configureListFields(ListMapper $listMapper)
->addIdentifier('name')
->add('description')
->add('enabled')
->add('size')
;
->add('size');
}

protected function configureFormFields(FormMapper $formMapper)
Expand Down
12 changes: 4 additions & 8 deletions src/Admin/GalleryAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -148,7 +145,6 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper)
->add('enabled')
->add('context', null, [
'show_filter' => false,
])
;
]);
}
}
6 changes: 2 additions & 4 deletions src/Admin/GalleryHasMediaAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -55,7 +54,6 @@ protected function configureListFields(ListMapper $listMapper)
->add('media')
->add('gallery')
->add('position')
->add('enabled')
;
->add('enabled');
}
}
3 changes: 1 addition & 2 deletions src/Admin/ODM/MediaAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper)
->add('name')
->add('providerReference')
->add('enabled')
->add('context')
;
->add('context');
}
}
3 changes: 1 addition & 2 deletions src/Admin/ORM/MediaAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ protected function configureDatagridFilters(DatagridMapper $datagridMapper)
$datagridMapper
->add('width')
->add('height')
->add('contentType')
;
->add('contentType');

$providers = [];

Expand Down
2 changes: 0 additions & 2 deletions src/Block/MediaBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
use Twig\Environment;

/**
* @final since sonata-project/media-bundle 3.21.0
*
* @author Thomas Rabaix <[email protected]>
*/
class MediaBlockService extends AbstractBlockService
Expand Down
3 changes: 1 addition & 2 deletions src/DependencyInjection/Compiler/AddProviderCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])]);
Expand Down
33 changes: 11 additions & 22 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ public function getConfigTreeBuilder()
->scalarNode('constraint')->defaultValue(true)->end()
->end()
->end()
->end()
;
->end();

$this->addContextsSection($node);
$this->addCdnSection($node);
Expand Down Expand Up @@ -127,8 +126,7 @@ private function addContextsSection(ArrayNodeDefinition $node): void
->end()
->end()
->end()
->end()
;
->end();
}

private function addCdnSection(ArrayNodeDefinition $node): void
Expand Down Expand Up @@ -178,8 +176,7 @@ private function addCdnSection(ArrayNodeDefinition $node): void
->end()
->end()
->end()
->end()
;
->end();
}

private function addFilesystemSection(ArrayNodeDefinition $node): void
Expand Down Expand Up @@ -333,8 +330,7 @@ private function addFilesystemSection(ArrayNodeDefinition $node): void
->end()
->end()
->end()
->end()
;
->end();
}

private function addProvidersSection(ArrayNodeDefinition $node): void
Expand Down Expand Up @@ -441,8 +437,7 @@ private function addProvidersSection(ArrayNodeDefinition $node): void
->end()
->end()
->end()
->end()
;
->end();
}

private function addExtraSection(ArrayNodeDefinition $node): void
Expand All @@ -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
Expand All @@ -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
Expand All @@ -498,8 +491,7 @@ private function addBuzzSection(ArrayNodeDefinition $node): void
->end()
->end()
->end()
->end()
;
->end();
}

private function addHttpClientSection(ArrayNodeDefinition $node): void
Expand All @@ -519,8 +511,7 @@ private function addHttpClientSection(ArrayNodeDefinition $node): void
->end()
->end()
->end()
->end()
;
->end();
}

private function addResizerSection(ArrayNodeDefinition $node): void
Expand Down Expand Up @@ -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
Expand All @@ -564,8 +554,7 @@ private function addAdapterSection(ArrayNodeDefinition $node): void
->scalarNode('default')->defaultValue('sonata.media.adapter.image.gd')->end()
->end()
->end()
->end()
;
->end();
}

/**
Expand Down
Loading

0 comments on commit 3d425ff

Please sign in to comment.