Skip to content

Commit

Permalink
Allow packages from "symfony/*" ^7
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Dec 14, 2023
1 parent 6ea63ab commit 151cd3e
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 55 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ jobs:
allowed-to-fail: false
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"
- php-version: '8.2'
dependencies: highest
allowed-to-fail: false
symfony-require: 7.0.*
variant: symfony/symfony:"7.0.*"

steps:
- name: Checkout
Expand Down
58 changes: 29 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,44 @@
"sonata-project/doctrine-extensions": "^1.13 || ^2.0",
"sonata-project/form-extensions": "^1.4 || ^2.0",
"sonata-project/twig-extensions": "^1.3 || ^2.0",
"symfony/asset": "^5.4 || ^6.2",
"symfony/config": "^5.4 || ^6.2",
"symfony/console": "^5.4 || ^6.2",
"symfony/dependency-injection": "^5.4 || ^6.2",
"symfony/event-dispatcher": "^5.4 || ^6.2",
"symfony/filesystem": "^5.4 || ^6.2",
"symfony/finder": "^5.4 || ^6.2",
"symfony/form": "^5.4 || ^6.2",
"symfony/framework-bundle": "^5.4 || ^6.2",
"symfony/http-client": "^5.4 || ^6.2",
"symfony/http-foundation": "^5.4 || ^6.2",
"symfony/http-kernel": "^5.4 || ^6.2",
"symfony/mime": "^5.4 || ^6.2",
"symfony/options-resolver": "^5.4 || ^6.2",
"symfony/routing": "^5.4 || ^6.2",
"symfony/security-bundle": "^5.4 || ^6.2",
"symfony/security-core": "^5.4 || ^6.2",
"symfony/translation": "^5.4 || ^6.2",
"symfony/asset": "^5.4 || ^6.2 || ^7.0",
"symfony/config": "^5.4 || ^6.2 || ^7.0",
"symfony/console": "^5.4 || ^6.2 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0",
"symfony/event-dispatcher": "^5.4 || ^6.2 || ^7.0",
"symfony/filesystem": "^5.4 || ^6.2 || ^7.0",
"symfony/finder": "^5.4 || ^6.2 || ^7.0",
"symfony/form": "^5.4 || ^6.2 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0",
"symfony/http-client": "^5.4 || ^6.2 || ^7.0",
"symfony/http-foundation": "^5.4 || ^6.2 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.2 || ^7.0",
"symfony/mime": "^5.4 || ^6.2 || ^7.0",
"symfony/options-resolver": "^5.4 || ^6.2 || ^7.0",
"symfony/routing": "^5.4 || ^6.2 || ^7.0",
"symfony/security-bundle": "^5.4 || ^6.2 || ^7.0",
"symfony/security-core": "^5.4 || ^6.2 || ^7.0",
"symfony/translation": "^5.4 || ^6.2 || ^7.0",
"symfony/translation-contracts": "^2.0 || ^3.0",
"symfony/twig-bridge": "^5.4 || ^6.2",
"symfony/twig-bundle": "^5.4 || ^6.2",
"symfony/validator": "^5.4 || ^6.2",
"symfony/twig-bridge": "^5.4 || ^6.2 || ^7.0",
"symfony/twig-bundle": "^5.4 || ^6.2 || ^7.0",
"symfony/validator": "^5.4 || ^6.2 || ^7.0",
"twig/string-extra": "^3.0",
"twig/twig": "^3.0"
},
"require-dev": {
"async-aws/simple-s3": "^1.0",
"aws/aws-sdk-php": "^3.0",
"dama/doctrine-test-bundle": "^7.0",
"dama/doctrine-test-bundle": "^8.0.1",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/mongodb-odm": "^2.4",
"doctrine/orm": "^2.14",
"friendsofphp/php-cs-fixer": "^3.4",
"knplabs/knp-menu-bundle": "^3.0",
"liip/imagine-bundle": "^2.0",
"masterminds/html5": "^2.7",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"matthiasnoback/symfony-config-test": "^4.2 || ^5.1",
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand All @@ -87,12 +87,12 @@
"rector/rector": "^0.18",
"sonata-project/admin-bundle": "^4.28",
"sonata-project/block-bundle": "^4.11 || ^5.0",
"sonata-project/classification-bundle": "^4.0",
"sonata-project/classification-bundle": "^4.x-dev",
"sonata-project/doctrine-orm-admin-bundle": "^4.0",
"symfony/browser-kit": "^5.4 || ^6.2",
"symfony/messenger": "^5.4 || ^6.2",
"symfony/phpunit-bridge": "^6.2",
"symfony/security-csrf": "^5.4 || ^6.2",
"symfony/browser-kit": "^5.4 || ^6.2 || ^7.0",
"symfony/messenger": "^5.4 || ^6.2 || ^7.0",
"symfony/phpunit-bridge": "^6.2 || ^7.0",
"symfony/security-csrf": "^5.4 || ^6.2 || ^7.0",
"vimeo/psalm": "^5.0"
},
"conflict": {
Expand Down
9 changes: 1 addition & 8 deletions src/Filesystem/Replicate.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public function delete($key): bool
}

/**
* @param string $key
*
* @return int|bool
*/
public function mtime($key)
Expand All @@ -82,10 +80,7 @@ public function exists($key): bool
}

/**
* @param string $key
* @param string $content
*
* @return int|bool
* @return bool
*/
public function write($key, $content)
{
Expand All @@ -112,8 +107,6 @@ public function write($key, $content)
}

/**
* @param string $key
*
* @return string|bool
*/
public function read($key)
Expand Down
8 changes: 2 additions & 6 deletions src/Form/DataTransformer/ProviderDataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ public function __construct(
/**
* @param mixed $value
*
* @return mixed
*
* @phpstan-param MediaInterface|null $value
* @phpstan-return MediaInterface|null
*/
#[\ReturnTypeWillChange]
public function transform($value)
public function transform($value): mixed
{
if (null === $value) {
return new $this->class();
Expand All @@ -70,13 +68,11 @@ public function transform($value)
/**
* @param mixed $value
*
* @return mixed
*
* @phpstan-param MediaInterface|null $value
* @phpstan-return MediaInterface|null
*/
#[\ReturnTypeWillChange]
public function reverseTransform($value)
public function reverseTransform($value): mixed
{
if (!$value instanceof MediaInterface) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/MediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function configureOptions(OptionsResolver $resolver): void
->setAllowedValues('context', array_keys($this->pool->getContexts()));
}

public function getParent(): ?string
public function getParent(): string
{
return FormType::class;
}
Expand Down
7 changes: 3 additions & 4 deletions src/Messenger/GenerateThumbnailsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
use Sonata\MediaBundle\Model\MediaManagerInterface;
use Sonata\MediaBundle\Provider\Pool;
use Sonata\MediaBundle\Thumbnail\GenerableThumbnailInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

/**
* @author Jordi Sala Morales <jordism91@gmail.com>
*
* @psalm-suppress DeprecatedInterface
*/
final class GenerateThumbnailsHandler implements MessageHandlerInterface
#[AsMessageHandler()]
final class GenerateThumbnailsHandler
{
public function __construct(
private GenerableThumbnailInterface $thumbnail,
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getDescription(): ?string
return $this->description;
}

public function getImage(): ?string
public function getImage(): string
{
return $this->image;
}
Expand Down
5 changes: 1 addition & 4 deletions src/Validator/Constraints/ValidMediaFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ public function validatedBy(): string
return 'sonata.media.validator.format';
}

/**
* @return string|string[]
*/
#[\ReturnTypeWillChange]
public function getTargets()
public function getTargets(): string
{
return self::CLASS_CONSTRAINT;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/App/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ framework:
enabled: true
translator:
enabled: true
validation:
enable_annotations: false
router:
utf8: true
http_method_override: false
Expand Down Expand Up @@ -77,6 +75,8 @@ doctrine:
dbal:
driver: pdo_sqlite
path: "%app.base_dir%sonata_media_test.db3"
# "dama/doctrine-test-bundle" relies on savepoints.
use_savepoints: true
orm:
entity_managers:
default:
Expand Down

0 comments on commit 151cd3e

Please sign in to comment.