Skip to content

Commit

Permalink
Bump dependencies & Introduce prefer lowest on CI (#961)
Browse files Browse the repository at this point in the history
| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT

 - [x] Bump dependencies
 - [x] Introduce prefer lowest on CI
 
 I've used versions from Sylius 2.0
  • Loading branch information
NoResponseMate authored Dec 16, 2024
2 parents 9233c4e + 0a3ffcf commit eebdf34
Show file tree
Hide file tree
Showing 32 changed files with 116 additions and 242 deletions.
47 changes: 5 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,19 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, Persistence: ${{ matrix.persistence }}, Collections: ${{ matrix.collections }}"
name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}"
env:
APP_ENV: ${{ matrix.app_env }}
strategy:
fail-fast: false
matrix:
php: ["8.1", "8.2", "8.3"]
pagerfanta: [""]
symfony: ["^5.4", "^6.4"]
persistence: ["^2.0", "^3.0"]
collections: ["^1.8", "^2.0"]
composer-flags: ['--no-scripts --prefer-stable --prefer-dist']
symfony: ["^6.4", "^7.1"]
app_env: ["test"]
include:
- php: "8.1"
pagerfanta: "^3.7"
symfony: "^5.4"
app_env: "test"
- php: "8.3"
symfony: "^7.0"
app_env: "test_without_hateoas"
exclude:
- php: "8.1"
collections: "^2.0"
persistence: "^2.0"
- php: "8.2"
collections: "^2.0"
persistence: "^2.0"
- php: "8.3"
collections: "^2.0"
persistence: "^2.0"
- persistence: "^2.0"
symfony: "^6.4"
symfony: "^7.1"

steps:
-
Expand All @@ -66,24 +47,6 @@ jobs:
composer config extra.symfony.require "${{ matrix.symfony }}"
(cd src/Component && composer config extra.symfony.require "${{ matrix.symfony }}")
-
name: Restrict Pagerfanta version
if: matrix.pagerfanta != ''
run: |
composer require "babdev/pagerfanta-bundle:${{ matrix.pagerfanta }}" --no-update --no-scripts
composer require "pagerfanta/pagerfanta:${{ matrix.pagerfanta }}" --dev --no-update --no-scripts
(cd src/Component && composer require "pagerfanta/core:${{ matrix.pagerfanta }}" --no-update --no-scripts)
-
name: Restrict doctrine/persistence version
if: matrix.persistence != ''
run: composer require "doctrine/persistence:${{ matrix.persistence }}" --no-update --no-scripts

-
name: Restrict doctrine/collections version
if: matrix.collections != ''
run: composer require "doctrine/collections:${{ matrix.collections }}" --no-update --no-scripts

-
name: Remove hateoas on Symfony 7
if: matrix.symfony == '^7.0'
Expand All @@ -93,7 +56,7 @@ jobs:
name: Install dependencies
run: |
composer update --no-scripts
(cd src/Component && composer update --no-scripts)
(cd src/Component && composer update ${{ matrix.composer-flags }})
-
name: Prepare test application
Expand Down
93 changes: 47 additions & 46 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,74 +26,75 @@
],
"require": {
"php": "^8.1",
"babdev/pagerfanta-bundle": "^3.7 || ^4.0",
"babdev/pagerfanta-bundle": "^4.4",
"doctrine/annotations": "^2.0",
"doctrine/collections": "^1.8 || ^2.0",
"doctrine/collections": "^2.2",
"doctrine/event-manager": "^1.1 || ^2.0",
"doctrine/inflector": "^1.4 || ^2.0",
"doctrine/persistence": "^2.0 || ^3.0",
"gedmo/doctrine-extensions": "^2.4.12 || ^3.0",
"doctrine/inflector": "^2.0",
"doctrine/persistence": "^3.3",
"gedmo/doctrine-extensions": "^3.17.1",
"sylius/registry": "^1.2",
"symfony/config": "^5.4 || ^6.4 || ^7.0",
"symfony/deprecation-contracts": "^2.1 || ^3.0",
"symfony/expression-language": "^5.4 || ^6.4 || ^7.0",
"symfony/form": "^5.4 || ^6.4 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/http-foundation": "^5.4 || ^6.4 || ^7.0",
"symfony/intl": "^5.4 || ^6.4 || ^7.0",
"symfony/security-core": "^5.4 || ^6.4 || ^7.0",
"symfony/security-csrf": "^5.4 || ^6.4 || ^7.0",
"symfony/routing": "^5.4 || ^6.4 || ^7.0",
"symfony/translation": "^5.4 || ^6.4 || ^7.0",
"symfony/twig-bundle": "^5.4 || ^6.4 || ^7.0",
"symfony/validator": "^5.4 || ^6.4 || ^7.0",
"symfony/yaml": "^5.4 || ^6.4 || ^7.0",
"webmozart/assert": "^1.8",
"symfony/config": "^6.4 || ^7.1",
"symfony/deprecation-contracts": "^3.5",
"symfony/expression-language": "^6.4 || ^7.1",
"symfony/form": "^6.4 || ^7.1",
"symfony/framework-bundle": "^6.4 || ^7.1",
"symfony/http-foundation": "^6.4 || ^7.1",
"symfony/intl": "^6.4 || ^7.1",
"symfony/security-core": "^6.4 || ^7.1",
"symfony/security-csrf": "^6.4 || ^7.1",
"symfony/routing": "^6.4 || ^7.1",
"symfony/translation": "^6.4 || ^7.1",
"symfony/twig-bundle": "^6.4 || ^7.1",
"symfony/validator": "^6.4 || ^7.1",
"symfony/yaml": "^6.4 || ^7.1",
"webmozart/assert": "^1.11",
"willdurand/negotiation": "^3.1"
},
"replace": {
"sylius/resource": "self.version"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.0",
"doctrine/doctrine-bundle": "^2.13",
"doctrine/orm": "^2.18",
"friendsofsymfony/rest-bundle": "^3.0",
"friendsofsymfony/rest-bundle": "^3.7",
"jms/serializer-bundle": "^3.5 || ^4.0 || ^5.0",
"lchrusciel/api-test-case": "^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.2.1 || ^5.1",
"pagerfanta/pagerfanta": "^3.7 || ^4.0",
"pagerfanta/pagerfanta": "^4.4",
"pamil/phpspec-skip-example-extension": "^4.2",
"phpspec/phpspec": "^7.3",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^1.7",
"phpstan/phpstan-phpunit": "^1.1",
"phpspec/phpspec": "^7.5",
"phpspec/prophecy-phpunit": "^2.2",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.6",
"rector/rector": "^0.18.2",
"sylius-labs/coding-standard": "^4.0",
"sylius/grid-bundle": "^1.11 || ^1.13@beta",
"symfony/console": "^5.4 || ^6.4 || ^7.0",
"symfony/css-selector": "^5.4 || ^6.4 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
"symfony/dotenv": "^5.4 || ^6.4 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
"symfony/stopwatch": "^5.4 || ^6.4 || ^7.0",
"symfony/uid": "^5.4 || ^6.4 || ^7.0",
"symfony/workflow": "^5.4 || ^6.4 || ^7.0",
"symfony/messenger": "^5.4 || ^6.4 || ^7.0",
"symfony/serializer": "^5.4 || ^6.4 || ^7.0",
"symfony/security-bundle": "^5.4 || ^6.4 || ^7.0",
"twig/twig": "^3.0",
"vimeo/psalm": "^5.20",
"willdurand/hateoas-bundle": "^2.0",
"sylius-labs/coding-standard": "^4.4",
"sylius/grid-bundle": "^1.13",
"symfony/console": "^6.4 || ^7.1",
"symfony/css-selector": "^6.4 || ^7.1",
"symfony/dependency-injection": "^6.4 || ^7.1",
"symfony/dotenv": "^6.4 || ^7.1",
"symfony/http-kernel": "^6.4 || ^7.1",
"symfony/stopwatch": "^6.4 || ^7.1",
"symfony/uid": "^6.4 || ^7.1",
"symfony/workflow": "^6.4 || ^7.1",
"symfony/messenger": "^6.4 || ^7.1",
"symfony/serializer": "^6.4 || ^7.1",
"symfony/security-bundle": "^6.4 || ^7.1",
"twig/twig": "^3.14",
"vimeo/psalm": "^5.26",
"willdurand/hateoas-bundle": "^2.5",
"winzou/state-machine-bundle": "^0.6.2"
},
"conflict": {
"doctrine/orm": "<2.18 || ^3.0",
"doctrine/doctrine-bundle": "<2.0 || ^3.0",
"friendsofsymfony/rest-bundle": "<3.0",
"jms/serializer-bundle": "<3.5",
"willdurand/hateoas-bundle": "<2.0 || ^2.6",
"pagerfanta/pagerfanta" : "<4.4",
"willdurand/hateoas-bundle": "<2.0 || ^3.0",
"winzou/state-machine-bundle": "<0.6.2",
"twig/twig": "<3.0"
},
Expand All @@ -110,7 +111,7 @@
},
"extra": {
"symfony": {
"require": "^6.4"
"require": "^7.1"
}
},
"autoload": {
Expand Down
26 changes: 13 additions & 13 deletions src/Component/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
"doctrine/inflector": "^1.4 || ^2.0",
"gedmo/doctrine-extensions": "^2.4.12 || ^3.0",
"pagerfanta/core": "^3.7 || ^4.0",
"symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0",
"symfony/form": "^5.4 || ^6.4 || ^7.0",
"symfony/http-foundation": "^5.4 || ^6.4 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0",
"symfony/property-access": "^5.4 || ^6.4 || ^7.0",
"symfony/routing": "^5.4 || ^6.4 || ^7.0",
"symfony/security-core": "^5.4 || ^6.4 || ^7.0",
"symfony/security-csrf": "^5.4 || ^6.4 || ^7.0",
"symfony/string": "^5.4 || ^6.4 || ^7.0",
"symfony/translation": "^5.4 || ^6.4 || ^7.0",
"symfony/validator": "^5.4 || ^6.4 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.1",
"symfony/form": "^6.4 || ^7.1",
"symfony/http-foundation": "^6.4 || ^7.1",
"symfony/http-kernel": "^6.4 || ^7.1",
"symfony/property-access": "^6.4 || ^7.1",
"symfony/routing": "^6.4 || ^7.1",
"symfony/security-core": "^6.4 || ^7.1",
"symfony/security-csrf": "^6.4 || ^7.1",
"symfony/string": "^6.4 || ^7.1",
"symfony/translation": "^6.4 || ^7.1",
"symfony/validator": "^6.4 || ^7.1",
"willdurand/negotiation": "^3.1",
"winzou/state-machine": "^0.4"
},
Expand All @@ -54,8 +54,8 @@
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"sylius/grid": "^1.7 || ^1.13@alpha",
"symfony/serializer": "^5.4 || ^6.4 || ^7.0",
"symfony/workflow": "^5.4 || ^6.4 || ^7.0",
"symfony/serializer": "^6.4 || ^7.1",
"symfony/workflow": "^6.4 || ^7.1",
"twig/twig": "^3.0"
},
"conflict": {
Expand Down
18 changes: 5 additions & 13 deletions tests/Application/src/Entity/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,17 @@
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;

/**
* @Serializer\ExclusionPolicy("all")
*/
#[Serializer\ExclusionPolicy(policy: 'ALL')]
#[ORM\Embeddable]
final class Author
{
/**
* @Serializer\Expose
*
* @Serializer\Type("string")
*/
#[Serializer\Expose]
#[Serializer\Type(name: 'string')]
#[ORM\Column(name: 'first_name', length: 255)]
private ?string $firstName = null;

/**
* @Serializer\Expose
*
* @Serializer\Type("string")
*/
#[Serializer\Expose]
#[Serializer\Type(name: 'string')]
#[ORM\Column(name: 'last_name', length: 255)]
private ?string $lastName = null;

Expand Down
28 changes: 8 additions & 20 deletions tests/Application/src/Entity/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
use Sylius\Resource\Model\TranslatableInterface;
use Sylius\Resource\Model\TranslatableTrait;

/**
* @Serializer\ExclusionPolicy("all")
*/
#[Serializer\ExclusionPolicy(policy: 'ALL')]
#[ORM\Entity]
#[ORM\MappedSuperclass]
#[ORM\Table(name: 'app_book')]
Expand All @@ -31,23 +29,16 @@ class Book implements ResourceInterface, TranslatableInterface
__construct as private initializeTranslationsCollection;
}

/**
* @Serializer\Expose
*
* @Serializer\Type("integer")
*
* @Serializer\XmlAttribute
*/
#[Serializer\Expose]
#[Serializer\Type(name: 'integer')]
#[Serializer\XmlAttribute]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;

/**
* @Serializer\Expose
*
* @Serializer\Type("string")
*/
#[Serializer\Expose]
#[Serializer\Type(name: 'string')]
#[ORM\Column(length: 255)]
private ?string $author = null;

Expand All @@ -56,11 +47,8 @@ public function getId(): ?int
return $this->id;
}

/**
* @Serializer\VirtualProperty()
*
* @Serializer\SerializedName("title")
*/
#[Serializer\VirtualProperty]
#[Serializer\SerializedName(name: 'title')]
public function getTitle(): ?string
{
return $this->getTranslation()->getTitle();
Expand Down
Loading

0 comments on commit eebdf34

Please sign in to comment.