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 Mar 9, 2023
2 parents 6e594c8 + 6675ca8 commit 2b051a3
Show file tree
Hide file tree
Showing 82 changed files with 273 additions and 686 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2, composer-normalize:2
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2
extensions: mongodb, gd
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2
extensions: mongodb, gd
Expand All @@ -67,7 +67,7 @@ jobs:
composer-options: --prefer-dist --prefer-stable

- name: Psalm
run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.1
run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.2

rector:
name: Rector
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2
extensions: mongodb, gd
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/symfony-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2

Expand All @@ -54,7 +54,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2

Expand All @@ -79,7 +79,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2

Expand All @@ -104,7 +104,7 @@ jobs:
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none
tools: composer:v2

Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
strategy:
matrix:
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
Expand All @@ -45,31 +44,21 @@ jobs:
symfony-require: ['']
variant: [normal]
include:
- php-version: '7.4'
- php-version: '8.0'
dependencies: lowest
allowed-to-fail: false
variant: normal
- php-version: '8.1'
- php-version: '8.2'
dependencies: highest
allowed-to-fail: false
symfony-require: 4.4.*
variant: symfony/symfony:"4.4.*"
- php-version: '8.1'
- php-version: '8.2'
dependencies: highest
allowed-to-fail: false
symfony-require: 5.4.*
variant: symfony/symfony:"5.4.*"
- php-version: '8.1'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.0.*
variant: symfony/symfony:"6.0.*"
- php-version: '8.1'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.1.*
variant: symfony/symfony:"6.1.*"
- php-version: '8.1'
- php-version: '8.2'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.2.*
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ phpstan:
.PHONY: phpstan

psalm:
vendor/bin/psalm --php-version=8.1
vendor/bin/psalm --php-version=8.2
.PHONY: psalm

rector:
Expand Down
52 changes: 26 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"homepage": "https://docs.sonata-project.org/projects/SonataMediaBundle",
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"doctrine/persistence": "^3.0.2",
"imagine/imagine": "^1.3",
"knplabs/gaufrette": "^0.10 || ^0.11",
Expand All @@ -38,28 +38,28 @@
"sonata-project/doctrine-extensions": "^1.13 || ^2.0",
"sonata-project/form-extensions": "^1.4",
"sonata-project/twig-extensions": "^1.3 || ^2.0",
"symfony/asset": "^4.4 || ^5.4 || ^6.0",
"symfony/config": "^4.4.11 || ^5.4 || ^6.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0",
"symfony/dependency-injection": "^4.4.8 || ^5.4 || ^6.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0",
"symfony/filesystem": "^4.4 || ^5.4 || ^6.0",
"symfony/finder": "^4.4 || ^5.4 || ^6.0",
"symfony/form": "^4.4.12 || ^5.4 || ^6.0",
"symfony/framework-bundle": "^4.4.6 || ^5.4 || ^6.0",
"symfony/http-client": "^4.4 || ^5.4 || ^6.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
"symfony/mime": "^4.4 || ^5.4 || ^6.0",
"symfony/options-resolver": "^4.4 || ^5.4 || ^6.0",
"symfony/routing": "^4.4 || ^5.4 || ^6.0",
"symfony/security-bundle": "^4.4 || ^5.4 || ^6.0",
"symfony/security-core": "^4.4.24 || ^5.4 || ^6.0",
"symfony/translation": "^4.4 || ^5.4 || ^6.0",
"symfony/asset": "^4.4 || ^5.4 || ^6.2",
"symfony/config": "^4.4.11 || ^5.4 || ^6.2",
"symfony/console": "^4.4 || ^5.4 || ^6.2",
"symfony/dependency-injection": "^4.4.8 || ^5.4 || ^6.2",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.2",
"symfony/filesystem": "^4.4 || ^5.4 || ^6.2",
"symfony/finder": "^4.4 || ^5.4 || ^6.2",
"symfony/form": "^4.4.12 || ^5.4 || ^6.2",
"symfony/framework-bundle": "^4.4.6 || ^5.4 || ^6.2",
"symfony/http-client": "^4.4.11 || ^5.4 || ^6.2",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.2",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.2",
"symfony/mime": "^4.4 || ^5.4 || ^6.2",
"symfony/options-resolver": "^4.4 || ^5.4 || ^6.2",
"symfony/routing": "^4.4 || ^5.4 || ^6.2",
"symfony/security-bundle": "^4.4 || ^5.4 || ^6.2",
"symfony/security-core": "^4.4.24 || ^5.4 || ^6.2",
"symfony/translation": "^4.4 || ^5.4 || ^6.2",
"symfony/translation-contracts": "^1.1 || ^2.0 || ^3.0",
"symfony/twig-bridge": "^4.4 || ^5.4 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.0",
"symfony/validator": "^4.4 || ^5.4 || ^6.0",
"symfony/twig-bridge": "^4.4 || ^5.4 || ^6.2",
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.2",
"symfony/validator": "^4.4 || ^5.4 || ^6.2",
"twig/string-extra": "^3.0",
"twig/twig": "^2.14 || ^3.0"
},
Expand Down Expand Up @@ -89,10 +89,10 @@
"sonata-project/block-bundle": "^4.11",
"sonata-project/classification-bundle": "^4.0",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.0",
"symfony/messenger": "^4.4 || ^5.4 || ^6.0",
"symfony/phpunit-bridge": "^6.1",
"symfony/security-csrf": "^4.4 || ^5.4 || ^6.0",
"symfony/browser-kit": "^4.4 || ^5.4 || ^6.2",
"symfony/messenger": "^4.4 || ^5.4 || ^6.2",
"symfony/phpunit-bridge": "^6.2",
"symfony/security-csrf": "^4.4 || ^5.4 || ^6.2",
"vimeo/psalm": "^4.7.2 || ^5.0"
},
"conflict": {
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]);

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_74,
LevelSetList::UP_TO_PHP_80,
]);

$rectorConfig->importNames();
Expand Down
12 changes: 4 additions & 8 deletions src/Action/MediaDownloadAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@

final class MediaDownloadAction
{
private MediaManagerInterface $mediaManager;

private Pool $pool;

public function __construct(MediaManagerInterface $mediaManager, Pool $pool)
{
$this->mediaManager = $mediaManager;
$this->pool = $pool;
public function __construct(
private MediaManagerInterface $mediaManager,
private Pool $pool
) {
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Admin/GalleryAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ final class GalleryAdmin extends AbstractAdmin
{
protected $classnameLabel = 'Gallery';

private Pool $pool;

public function __construct(Pool $pool)
public function __construct(private Pool $pool)
{
parent::__construct();

$this->pool = $pool;
}

protected function prePersist(object $object): void
Expand Down
19 changes: 3 additions & 16 deletions src/Block/FeatureMediaBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,16 @@
*/
final class FeatureMediaBlockService extends AbstractBlockService implements EditableBlockService
{
private Pool $pool;

/**
* @var AdminInterface<MediaInterface>|null
*/
private ?AdminInterface $mediaAdmin;

private MediaManagerInterface $mediaManager;

/**
* @param AdminInterface<MediaInterface>|null $mediaAdmin
*/
public function __construct(
Environment $twig,
Pool $pool,
?AdminInterface $mediaAdmin,
MediaManagerInterface $mediaManager
private Pool $pool,
private ?AdminInterface $mediaAdmin,
private MediaManagerInterface $mediaManager
) {
parent::__construct($twig);

$this->pool = $pool;
$this->mediaAdmin = $mediaAdmin;
$this->mediaManager = $mediaManager;
}

public function configureSettings(OptionsResolver $resolver): void
Expand Down
21 changes: 4 additions & 17 deletions src/Block/GalleryBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,16 @@
*/
final class GalleryBlockService extends AbstractBlockService implements EditableBlockService
{
private Pool $pool;

/**
* @var AdminInterface<GalleryInterface<GalleryItemInterface>>|null
*/
private ?AdminInterface $galleryAdmin;

private GalleryManagerInterface $galleryManager;

/**
* @param AdminInterface<GalleryInterface<GalleryItemInterface>>|null $galleryAdmin
*/
public function __construct(
Environment $twig,
Pool $pool,
?AdminInterface $galleryAdmin,
GalleryManagerInterface $galleryManager
private Pool $pool,
private ?AdminInterface $galleryAdmin,
private GalleryManagerInterface $galleryManager
) {
parent::__construct($twig);

$this->pool = $pool;
$this->galleryAdmin = $galleryAdmin;
$this->galleryManager = $galleryManager;
}

public function configureSettings(OptionsResolver $resolver): void
Expand Down Expand Up @@ -270,7 +257,7 @@ private function getMediaType(MediaInterface $media): ?string
return 'video';
}

if ('image' === substr($contentType, 0, 5)) {
if (str_starts_with($contentType, 'image')) {
return 'image';
}

Expand Down
14 changes: 5 additions & 9 deletions src/Block/GalleryListBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@

final class GalleryListBlockService extends AbstractBlockService implements EditableBlockService
{
private GalleryManagerInterface $galleryManager;

private Pool $pool;

public function __construct(Environment $twig, GalleryManagerInterface $galleryManager, Pool $pool)
{
public function __construct(
Environment $twig,
private GalleryManagerInterface $galleryManager,
private Pool $pool
) {
parent::__construct($twig);

$this->galleryManager = $galleryManager;
$this->pool = $pool;
}

public function configureEditForm(FormMapper $form, BlockInterface $block): void
Expand Down
19 changes: 3 additions & 16 deletions src/Block/MediaBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,16 @@
*/
final class MediaBlockService extends AbstractBlockService implements EditableBlockService
{
private Pool $pool;

/**
* @var AdminInterface<MediaInterface>|null
*/
private ?AdminInterface $mediaAdmin;

private MediaManagerInterface $mediaManager;

/**
* @param AdminInterface<MediaInterface>|null $mediaAdmin
*/
public function __construct(
Environment $twig,
Pool $pool,
?AdminInterface $mediaAdmin,
MediaManagerInterface $mediaManager
private Pool $pool,
private ?AdminInterface $mediaAdmin,
private MediaManagerInterface $mediaManager
) {
parent::__construct($twig);

$this->pool = $pool;
$this->mediaAdmin = $mediaAdmin;
$this->mediaManager = $mediaManager;
}

public function configureSettings(OptionsResolver $resolver): void
Expand Down

0 comments on commit 2b051a3

Please sign in to comment.