Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pimcore 6/Symfony 4 compatibilty #996

Merged
merged 23 commits into from
Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e2441a1
[All] make CoreShop fit for Pimcore 6 and Symfony 4
dpfaffenbauer May 19, 2019
38dc59b
[Travis] add tests for symfony 4
dpfaffenbauer May 19, 2019
9d97098
[Travis] add tests for symfony 4
dpfaffenbauer May 19, 2019
642c424
[Composer] update packages
dpfaffenbauer May 21, 2019
39ce954
[Travis] fix wrong debug output and verbose output composer install
dpfaffenbauer May 21, 2019
d02acfb
[Travis] allow symfony 4 build to fail
dpfaffenbauer May 21, 2019
27c6cca
[Symfony] fix deprecations already coming from symfony and doctrine
dpfaffenbauer May 21, 2019
9daacce
[Symfony] fix deprecations already coming from symfony and doctrine
dpfaffenbauer May 21, 2019
5fad3ff
[Tests] make Pimcore Services public for tests
dpfaffenbauer May 22, 2019
84e9bc6
[Composer] allow pimcore 5.8 and 6
dpfaffenbauer May 23, 2019
1508844
[CoreBundle, ProductBundle] fix getValuesFromParent in CoreExtensions
dpfaffenbauer May 23, 2019
cae4156
[Behat] also make pimcore services public for behat tests
dpfaffenbauer May 23, 2019
691af40
only make templating helper classses public
dpfaffenbauer Jun 5, 2019
b88d896
[Pimcore6] add to required tests
dpfaffenbauer Jun 5, 2019
d171e9c
set minimum-stability to dev for Pimcore 6
dpfaffenbauer Jun 5, 2019
f385c69
[Behat] make knp service alias public
dpfaffenbauer Jun 6, 2019
ea510ac
remove sension distribution bundle stuff and install assets and cache…
dpfaffenbauer Jun 6, 2019
fd16b25
[Symfony4] introduce AutoMapping Validator fix until the issue is act…
dpfaffenbauer Jun 6, 2019
c39db8f
set web directory for assets-install command manually
dpfaffenbauer Jun 6, 2019
2e6aa27
[Symfony4] fix getExtendedTypes should be static
dpfaffenbauer Jun 6, 2019
adc55ed
[Symfony4] disable deprecations helper
dpfaffenbauer Jun 6, 2019
516fc36
[Pimcore6] compatibilty to new null returned
dpfaffenbauer Jun 6, 2019
712217a
[Pimcore6] compatibilty to new null returned #2
dpfaffenbauer Jun 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ docs/generate-docs.sh
output/
tmp/
phpda.html
var
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
- PIMCORE_VERSION="^5"
- CORESHOP_TEST=1
- CORESHOP_SUITE=application
- SYMFONY_VERSION="^3.4"

matrix:
include:
Expand Down Expand Up @@ -40,6 +41,18 @@ matrix:
env:
- PIMCORE_VERSION="~5.8"

- sudo: required
php: 7.2
env:
- PIMCORE_VERSION="~6.0"
- SYMFONY_VERSION="^4.0"

- sudo: required
php: 7.3
env:
- PIMCORE_VERSION="~6.0"
- SYMFONY_VERSION="^4.0"

- sudo: required
php: 7.2
env:
Expand All @@ -49,11 +62,26 @@ matrix:
php: 7.3
env:
- PIMCORE_VERSION="dev-master"

- sudo: required
php: 7.2
env:
- PIMCORE_VERSION="dev-master"
- SYMFONY_VERSION="^4.0"

- sudo: required
php: 7.3
env:
- PIMCORE_VERSION="dev-master"
- SYMFONY_VERSION="^4.0"
allow_failures:
- env:
- CORESHOP_SUITE=codestyle
- env:
- PIMCORE_VERSION="dev-master"
- env:
- PIMCORE_VERSION="dev-master"
- SYMFONY_VERSION="^4.0"
fast_finish: true

cache:
Expand Down
1 change: 1 addition & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function registerContainerConfiguration(\Symfony\Component\Config\Loader\

$loader->load(function (\Symfony\Component\DependencyInjection\ContainerBuilder $container) use ($loader) {
$container->addCompilerPass(new \CoreShop\Test\DependencyInjection\MakeServicesPublicPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, -100000);
$container->addCompilerPass(new \CoreShop\Test\DependencyInjection\MakePimcoreServicesPublicPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, -100000);
$container->addCompilerPass(new \CoreShop\Test\DependencyInjection\MonologChannelLoggerPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
});
}
Expand Down
1 change: 1 addition & 0 deletions app/TestAppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function registerContainerConfiguration(\Symfony\Component\Config\Loader\

$loader->load(function (\Symfony\Component\DependencyInjection\ContainerBuilder $container) use ($loader) {
$container->addCompilerPass(new \CoreShop\Test\DependencyInjection\MakeServicesPublicPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, -100000);
$container->addCompilerPass(new \CoreShop\Test\DependencyInjection\MakePimcoreServicesPublicPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, -100000);
$container->addCompilerPass(new \CoreShop\Test\DependencyInjection\MonologChannelLoggerPass(), \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
});
}
Expand Down
27 changes: 3 additions & 24 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@
"payum/paypal-express-checkout-nvp": "^1.4",
"payum/payum-bundle": "^2.2",
"payum/sofort": "^1.4",
"php-http/guzzle6-adapter": "^1.1",
"pimcore/pimcore": "^5.8.0",
"rinvex/countries": "^5.0",
"php-http/guzzle6-adapter": "^2.0",
"pimcore/pimcore": "^5.8 | ^6.0",
"rinvex/countries": "^6.0",
"stof/doctrine-extensions-bundle": "^1.2",
"symfony/twig-bundle": "^3.2",
"webmozart/assert": "^1.2"
},
"require-dev": {
Expand Down Expand Up @@ -136,26 +135,6 @@
"app/AppKernel.php"
]
},
"scripts": {
"post-create-project-cmd": "Pimcore\\Composer::postCreateProject",
"post-install-cmd": [
"Pimcore\\Composer::postInstall",
"@symfony-scripts"
],
"post-update-cmd": [
"Pimcore\\Composer::postUpdate",
"@symfony-scripts"
],
"pre-package-update": [
"Pimcore\\Composer::prePackageUpdate"
],
"symfony-scripts": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ final class StoreTypeExtension extends AbstractTypeExtension
{
return StoreType::class;
}

public static function getExtendedTypes()
{
return [StoreType::class];
}
}
```

Expand Down
4 changes: 2 additions & 2 deletions etc/_scripts/twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e

echo "BEHAT TESTS"
bin/console lint:twig src --no-debug
echo "TWIG LINT"
bin/console lint:twig src --no-debug
4 changes: 2 additions & 2 deletions etc/_scripts/yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e

echo "BEHAT TESTS"
bin/console lint:yaml src --no-debug
echo "YAML LINT"
bin/console lint:yaml src --no-debug
14 changes: 12 additions & 2 deletions etc/_setup/install
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,15 @@ cp app/config/parameters.example.yml app/config/parameters.yml
######### Install composer dependencies
#########
##########################################################################################
COMPOSER_MEMORY_LIMIT=-1 composer req pimcore/pimcore:$PIMCORE_VERSION --no-interaction --no-scripts
COMPOSER_MEMORY_LIMIT=-1 composer install -o
composer config minimum-stability dev
composer config prefer-stable true
COMPOSER_MEMORY_LIMIT=-1 composer req pimcore/pimcore:$PIMCORE_VERSION symfony/symfony:$SYMFONY_VERSION --no-interaction --no-scripts --no-update
COMPOSER_MEMORY_LIMIT=-1 composer install -o --no-interaction

##########################################################################################
#########
######### Install composer dependencies
#########
##########################################################################################
bin/console cache:clear
bin/console assets:install --symlink web
16 changes: 1 addition & 15 deletions features/cart/rules/discount_amount_action.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,4 @@ Feature: Adding a new cart rule
And I apply the voucher code "asdf" to my cart
Then the cart discount should be "-2000" including tax
Then the cart total should be "8000" including tax

Scenario: Add a new discount rule with 20 percent discount for all products with tax
Given the site has a tax rate "AT" with "20%" rate
And the site has a tax rule group "AT"
And the tax rule group has a tax rule for country "Austria" with tax rate "AT"
And the product "Shoe" has tax rule group "AT"
And adding a cart price rule named "discount"
And the cart rule is active
And the cart rule is a voucher rule with code "asdf"
And the cart rule has a action discount with 20 in currency "EUR" off
And I apply the voucher code "asdf" to my cart
Then the cart discount should be "-2000" excluding tax
Then the cart discount should be "-2400" including tax
Then the cart total should be "8000" excluding tax
Then the cart total should be "9600" including tax

4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />

<env name="KERNEL_CLASS" value="TestAppKernel" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="100"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
</php>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
namespace CoreShop\Bundle\AddressBundle\Twig;

use CoreShop\Bundle\AddressBundle\Templating\Helper\FormatAddressHelperInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

final class FormatAddressExtension extends \Twig_Extension
final class FormatAddressExtension extends AbstractExtension
{
/**
* @var FormatAddressHelperInterface
Expand All @@ -35,7 +37,7 @@ public function __construct(FormatAddressHelperInterface $helper)
public function getFilters()
{
return [
new \Twig_Filter('coreshop_format_address', [$this->helper, 'formatAddress'], ['is_safe' => ['html']]),
new TwigFilter('coreshop_format_address', [$this->helper, 'formatAddress'], ['is_safe' => ['html']]),
];
}
}
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/AddressBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"php": "^7.2",
"coreshop/address": "^2.0",
"coreshop/resource-bundle": "^2.0",
"pimcore/pimcore": "^5.8.0"
"pimcore/pimcore": "^5.8.0 | ^6.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
2 changes: 1 addition & 1 deletion src/CoreShop/Bundle/ConfigurationBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"php": "^7.2",
"coreshop/configuration": "^2.0",
"coreshop/resource-bundle": "^2.0",
"pimcore/pimcore": "^5.8.0"
"pimcore/pimcore": "^5.8.0 | ^6.0.0"
},
"config": {
"bin-dir": "bin"
Expand Down
6 changes: 5 additions & 1 deletion src/CoreShop/Bundle/CoreBundle/CoreExtension/StoreValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ public function getGetterCode($class)
$code .= "\t" . '}' . "\n";
$code .= "\t" . '$data = $this->' . $key . ";\n\n";
$code .= "\t" . 'if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("' . $key . '")->isEmpty($data)) {' . "\n";
$code .= "\t\t" . 'return $this->getValueFromParent("' . $key . '", $store);' . "\n";
$code .= "\t\t" . 'try {' . "\n";
$code .= "\t\t\t" . 'return $this->getValueFromParent("' . $key . '");' . "\n";
$code .= "\t\t" . '} catch (InheritanceParentNotFoundException $e) {' . "\n";
$code .= "\t\t\t" . '// no data from parent available, continue ... ' . "\n";
$code .= "\t\t" . '}' . "\n";
$code .= "\t" . '}' . "\n\n";
$code .= "\t" . 'if (is_array($data)) {' . "\n";
$code .= "\t\t" . '/** @var \CoreShop\Component\Core\Model\ProductStoreValuesInterface $storeValuesBlock */' . "\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ public function getExtendedType()
{
return AddToCartType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [AddToCartType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ public function getExtendedType()
{
return CarrierType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [CarrierType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,11 @@ public function getExtendedType()
{
return CartCreationCartItemType::class;
}
/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [CartCreationCartItemType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,12 @@ public function getExtendedType()
{
return CartCreationType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [CartCreationType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,11 @@ public function getExtendedType()
{
return CartItemType::class;
}
/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [CartItemType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ public function getExtendedType()
{
return CartType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [CartType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ public function getExtendedType()
{
return CountryType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [CountryType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ public function getExtendedType()
{
return CustomerType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [CustomerType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ public function getExtendedType()
{
return OrderShipmentCreationType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [OrderShipmentCreationType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ public function getExtendedType()
{
return PaymentProviderType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [PaymentProviderType::class];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,12 @@ public function getExtendedType()
{
return ProductQuantityRangeCollectionType::class;
}

/**
* {@inheritdoc}
*/
public static function getExtendedTypes()
{
return [ProductQuantityRangeCollectionType::class];
}
}
Loading