Skip to content

Commit

Permalink
Upgrade ResourceBundle and GridBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Nov 24, 2020
1 parent e214db2 commit 6a3bcf2
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 35 deletions.
6 changes: 0 additions & 6 deletions CONFLICTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
This document explains why certain conflicts were added to `composer.json` and
refereneces related issues.

- `doctrine/inflector:^1.4`:

Inflector 1.4 changes pluralization of `taxon` from `taxons` (used in Sylius) to `taxa`.

References: https://github.com/doctrine/inflector/issues/147

- `symfony/doctrine-bridge:4.4.16`:

This version of Doctrine Bridge introduces a bug that causes an issue related to `ChannelPricing` mapping.
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
"doctrine/doctrine-bundle": "^1.12",
"doctrine/doctrine-cache-bundle": "^1.4",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/inflector": "^1.4 || ^2.0",
"doctrine/migrations": "^3.0",
"doctrine/orm": "^2.7",
"egulias/email-validator": "^2.1",
"friendsofsymfony/oauth-server-bundle": "^1.6",
"friendsofsymfony/rest-bundle": "^2.7",
"friendsofsymfony/rest-bundle": "^3.0",
"fakerphp/faker": "^1.9",
"gedmo/doctrine-extensions": "^2.4.12",
"jms/serializer-bundle": "^2.4",
"jms/serializer-bundle": "^3.5",
"knplabs/gaufrette": "^0.8",
"knplabs/knp-gaufrette-bundle": "^0.7",
"knplabs/knp-menu": "^3.1",
Expand All @@ -55,13 +56,13 @@
"sylius-labs/association-hydrator": "^1.1",
"sylius-labs/doctrine-migrations-extra-bundle": "^0.1.3",
"sylius/fixtures-bundle": "^1.6.1",
"sylius/grid": "^1.7.5",
"sylius/grid-bundle": "^1.7.5",
"sylius/grid": "dev-master",
"sylius/grid-bundle": "dev-master",
"sylius/mailer": "^1.5",
"sylius/mailer-bundle": "^1.5",
"sylius/registry": "^1.5",
"sylius/resource": "^1.6",
"sylius/resource-bundle": "^1.6",
"sylius/resource": "dev-master",
"sylius/resource-bundle": "dev-master",
"sylius/theme-bundle": "^1.5",
"symfony/asset": "^4.4",
"symfony/config": "^4.4",
Expand Down Expand Up @@ -105,10 +106,10 @@
"twig/intl-extra": "^2.12",
"twig/twig": "^2.12",
"webmozart/assert": "^1.9",
"white-october/pagerfanta-bundle": "^1.3",
"willdurand/hateoas": "^2.12",
"willdurand/hateoas-bundle": "^1.4",
"winzou/state-machine-bundle": "^0.3",
"babdev/pagerfanta-bundle": "^2.5",
"willdurand/hateoas": "^3.0",
"willdurand/hateoas-bundle": "^2.0",
"winzou/state-machine-bundle": "^0.5",
"zendframework/zend-hydrator": "^2.4",
"zendframework/zend-stdlib": "^3.2"
},
Expand Down Expand Up @@ -191,7 +192,6 @@
"sylius/user-bundle": "self.version"
},
"conflict": {
"doctrine/inflector": "^1.4",
"symfony/doctrine-bridge": "4.4.16"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true],
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true],
Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true],
Expand Down
7 changes: 6 additions & 1 deletion config/packages/dev/jms_serializer.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
jms_serializer:
visitors:
json:
json_serialization:
options:
- JSON_PRETTY_PRINT
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
json_deserialization:
options:
- JSON_PRETTY_PRINT
- JSON_UNESCAPED_SLASHES
Expand Down
2 changes: 1 addition & 1 deletion config/packages/jms_serializer.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jms_serializer:
visitors:
xml:
xml_serialization:
format_output: '%kernel.debug%'
6 changes: 5 additions & 1 deletion config/packages/prod/jms_serializer.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
jms_serializer:
visitors:
json:
json_serialization:
options:
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
json_deserialization:
options:
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@
<tag name="kernel.event_listener" event="sylius.order_item.pre_delete" method="recalculateOrderOnDelete" />
</service>

<service id="jms_serializer.serialized_name_annotation_strategy" class="%jms_serializer.serialized_name_annotation_strategy.class%" public="false">
<service id="jms_serializer.serialized_name_annotation_strategy" class="JMS\Serializer\Naming\SerializedNameAnnotationStrategy" public="false">
<argument type="service" id="jms_serializer.identical_property_naming_strategy" />
</service>
<service id="jms_serializer.identical_property_naming_strategy" class="JMS\Serializer\Naming\IdenticalPropertyNamingStrategy" public="false" />
</services>
</container>
23 changes: 23 additions & 0 deletions src/Sylius/Bundle/CoreBundle/SyliusCoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

namespace Sylius\Bundle\CoreBundle;

use Doctrine\Inflector\InflectorFactory;
use Doctrine\Inflector\Rules\Patterns;
use Doctrine\Inflector\Rules\Ruleset;
use Doctrine\Inflector\Rules\Substitution;
use Doctrine\Inflector\Rules\Substitutions;
use Doctrine\Inflector\Rules\Transformations;
use Doctrine\Inflector\Rules\Word;
use Sylius\Bundle\CoreBundle\DependencyInjection\Compiler\BackwardsCompatibility\ResolveShopUserTargetEntityPass;
use Sylius\Bundle\CoreBundle\DependencyInjection\Compiler\IgnoreAnnotationsPass;
use Sylius\Bundle\CoreBundle\DependencyInjection\Compiler\LazyCacheWarmupPass;
Expand All @@ -22,6 +29,7 @@
use Sylius\Bundle\CoreBundle\DependencyInjection\Compiler\TranslatableEntityLocalePass;
use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
use Sylius\Component\Resource\Metadata\Metadata;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class SyliusCoreBundle extends AbstractResourceBundle
Expand All @@ -33,6 +41,21 @@ public function getSupportedDrivers(): array
];
}

public function boot(): void
{
parent::boot();

$factory = InflectorFactory::create();
$factory->withPluralRules(new Ruleset(
new Transformations(),
new Patterns(),
new Substitutions(new Substitution(new Word('taxon'), new Word('taxons')))
));
$inflector = $factory->build();

Metadata::setInflector($inflector);
}

public function build(ContainerBuilder $container): void
{
parent::build($container);
Expand Down
15 changes: 3 additions & 12 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"src/Entity/.gitignore"
]
},
"babdev/pagerfanta-bundle": {
"version": "v2.8.0"
},
"behat/behat": {
"version": "v3.7.0"
},
Expand Down Expand Up @@ -254,9 +257,6 @@
"jms/metadata": {
"version": "1.7.0"
},
"jms/parser-lib": {
"version": "1.0.0"
},
"jms/serializer": {
"version": "1.14.1"
},
Expand Down Expand Up @@ -465,9 +465,6 @@
"php-http/promise": {
"version": "v1.0.0"
},
"phpcollection/phpcollection": {
"version": "0.5.0"
},
"phpdocumentor/reflection-common": {
"version": "1.0.1"
},
Expand All @@ -477,9 +474,6 @@
"phpdocumentor/type-resolver": {
"version": "0.4.0"
},
"phpoption/phpoption": {
"version": "1.5.0"
},
"phpspec/php-diff": {
"version": "v1.1.0"
},
Expand Down Expand Up @@ -1093,9 +1087,6 @@
"webmozart/path-util": {
"version": "2.3.0"
},
"white-october/pagerfanta-bundle": {
"version": "v1.3.2"
},
"willdurand/hateoas": {
"version": "2.12.0"
},
Expand Down

0 comments on commit 6a3bcf2

Please sign in to comment.