Skip to content

Commit

Permalink
Sync with Symfony Standard v3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
teohhanhui committed Apr 5, 2018
1 parent a02a5ed commit 9b958f5
Show file tree
Hide file tree
Showing 29 changed files with 170 additions and 172 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.php_cs
/.php_cs.cache

/app/config/parameters.yml
Expand All @@ -11,10 +12,6 @@
/web/js
/web/media

/bin/*
!/bin/console
!/bin/symfony_requirements

/vendor
/node_modules

Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ before_script:
script:
- composer validate --strict

- bin/phpspec run --no-interaction -f dot
- vendor/bin/phpspec run --no-interaction -f dot

- bin/console sylius:fixtures:load --no-interaction --env=test_cached --no-debug -vvv

- echo "Testing (Behat - brand new, regular scenarios; ~@javascript && ~@todo && ~@cli)" "Sylius"
- bin/behat --strict --no-interaction -vvv -f progress -p cached --tags="~@javascript && ~@todo && ~@cli"
- vendor/bin/behat --strict --no-interaction -vvv -f progress -p cached --tags="~@javascript && ~@todo && ~@cli"

- echo "Testing (Behat - brand new, javascript scenarios; @javascript && ~@todo && ~@cli)" "Sylius"
- bin/behat --strict --no-interaction -vvv -f progress -p cached --tags="@javascript && ~@todo && ~@cli" || bin/behat --strict --no-interaction -vvv -f progress -p cached --tags="@javascript && ~@todo && ~@cli" --rerun
- vendor/bin/behat --strict --no-interaction -vvv -f progress -p cached --tags="@javascript && ~@todo && ~@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress -p cached --tags="@javascript && ~@todo && ~@cli" --rerun

after_failure:
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"
Expand Down
21 changes: 17 additions & 4 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
declare(strict_types=1);

use Sylius\Bundle\CoreBundle\Application\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* @author Paweł Jędrzejewski <[email protected]>
* @author Gonzalo Vilaseca <[email protected]>
*/
class AppKernel extends Kernel
{
/**
Expand All @@ -36,4 +34,19 @@ public function registerBundles(): array

return array_merge(parent::registerBundles(), $bundles);
}

/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(function (ContainerBuilder $container) {
$container->setParameter('container.autowiring.strict_mode', true);
$container->setParameter('container.dumper.inline_class_loader', true);

$container->addObjectResource($this);
});

parent::registerContainerConfiguration($loader);
}
}
7 changes: 2 additions & 5 deletions app/TestAppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* @author Kamil Kokot <kamil@kokot.me>
*/
class TestAppKernel extends AppKernel
{
/**
Expand All @@ -43,7 +40,7 @@ public function shutdown(): void
}

/**
* Remove all container references from all loaded services
* Remove all container references from all loaded services.
*
* @param ContainerInterface $container
*/
Expand All @@ -55,7 +52,7 @@ protected function cleanupContainer(ContainerInterface $container): void

$services = $containerServicesPropertyReflection->getValue($container) ?: [];
foreach ($services as $serviceId => $service) {
if (in_array($serviceId, $this->getServicesToIgnoreDuringContainerCleanup())) {
if (in_array($serviceId, $this->getServicesToIgnoreDuringContainerCleanup(), true)) {
continue;
}

Expand Down
49 changes: 25 additions & 24 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,55 @@
# (c) Paweł Jędrzejewski

imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }
- { resource: "@SyliusAdminApiBundle/Resources/config/app/config.yml" }
- { resource: '@SyliusCoreBundle/Resources/config/app/config.yml' }
- { resource: '@SyliusAdminBundle/Resources/config/app/config.yml' }
- { resource: '@SyliusShopBundle/Resources/config/app/config.yml' }
- { resource: '@SyliusAdminApiBundle/Resources/config/app/config.yml' }

- { resource: "parameters.yml" }
- { resource: "security.yml" }
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }

parameters:
locale: en_US

framework:
translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
translator: { fallbacks: ['%locale%'] }
secret: '%secret%'
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: "%kernel.debug%"
resource: '%kernel.project_dir%/app/config/routing.yml'
strict_requirements: '%kernel.debug%'
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating: { engines: ["twig"] }
default_locale: "%locale%"
templating: { engines: ['twig'] }
default_locale: '%locale%'
trusted_proxies: ~
session:
handler_id: ~

doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
server_version: "5.5"
driver: '%database_driver%'
host: '%database_host%'
port: '%database_port%'
dbname: '%database_name%'
user: '%database_user%'
password: '%database_password%'
server_version: '5.5'
charset: UTF8

doctrine_migrations:
dir_name: "%kernel.root_dir%/migrations"
dir_name: '%kernel.project_dir%/app/migrations'
namespace: Sylius\Migrations
table_name: sylius_migrations
name: Sylius Migrations

swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
transport: '%mailer_transport%'
host: '%mailer_host%'
username: '%mailer_user%'
password: '%mailer_password%'

fos_rest:
exception: ~
Expand Down
8 changes: 4 additions & 4 deletions app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# (c) Paweł Jędrzejewski

imports:
- { resource: "config.yml" }
- { resource: config.yml }

framework:
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
router: { resource: '%kernel.project_dir%/app/config/routing_dev.yml' }
profiler: { only_exceptions: false }

doctrine:
dbal:
dbname: "%database_name%_dev"
dbname: '%database_name%_dev'

monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
firephp:
type: firephp
Expand Down
4 changes: 2 additions & 2 deletions app/config/config_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (c) Paweł Jędrzejewski

imports:
- { resource: "config.yml" }
- { resource: config.yml }

monolog:
handlers:
Expand All @@ -12,5 +12,5 @@ monolog:
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
6 changes: 3 additions & 3 deletions app/config/config_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (c) Paweł Jędrzejewski

imports:
- { resource: "config.yml" }
- { resource: config.yml }

monolog:
handlers:
Expand All @@ -12,12 +12,12 @@ monolog:
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug

doctrine:
dbal:
dbname: "%database_name%_staging"
dbname: '%database_name%_staging'

swiftmailer:
disable_delivery: true
10 changes: 5 additions & 5 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (c) Paweł Jędrzejewski

imports:
- { resource: "config.yml" }
- { resource: config.yml }

parameters:
locale: en_US
Expand All @@ -14,20 +14,20 @@ framework:

doctrine:
dbal:
dbname: "%database_name%_test"
dbname: '%database_name%_test'

monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: error

payum:
gateways:
paypal_express_checkout:
factory: paypal_express_checkout
payum.http_client: "@sylius.payum.http_client"
payum.http_client: '@sylius.payum.http_client'
username: TEST
password: TEST
signature: TEST
Expand All @@ -44,7 +44,7 @@ swiftmailer:
logging: true
spool:
type: file
path: "%kernel.cache_dir%/spool"
path: '%kernel.cache_dir%/spool'

sylius_theme:
sources:
Expand Down
4 changes: 2 additions & 2 deletions app/config/config_test_cached.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (c) Paweł Jędrzejewski

imports:
- { resource: "config_test.yml" }
- { resource: config_test.yml }

doctrine:
orm:
Expand All @@ -24,4 +24,4 @@ fos_rest:
debug: true

doctrine_migrations:
dir_name: "%kernel.root_dir%/../vendor/sylius/sylius/app/migrations"
dir_name: '%kernel.project_dir%/vendor/sylius/sylius/app/migrations'
24 changes: 12 additions & 12 deletions app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
parameters:
database_driver: "%env(SYLIUS_DATABASE_DRIVER)%"
database_host: "%env(SYLIUS_DATABASE_HOST)%"
database_port: "%env(SYLIUS_DATABASE_PORT)%"
database_name: "%env(SYLIUS_DATABASE_NAME)%"
database_user: "%env(SYLIUS_DATABASE_USER)%"
database_password: "%env(SYLIUS_DATABASE_PASSWORD)%"
database_driver: '%env(SYLIUS_DATABASE_DRIVER)%'
database_host: '%env(SYLIUS_DATABASE_HOST)%'
database_port: '%env(SYLIUS_DATABASE_PORT)%'
database_name: '%env(SYLIUS_DATABASE_NAME)%'
database_user: '%env(SYLIUS_DATABASE_USER)%'
database_password: '%env(SYLIUS_DATABASE_PASSWORD)%'
# You should uncomment this if you want use pdo_sqlite.
# database_path: "%kernel.root_dir%/data.db3"
# database_path: '%kernel.project_dir%/var/data/data.sqlite'

mailer_transport: "%env(SYLIUS_MAILER_TRANSPORT)%"
mailer_host: "%env(SYLIUS_MAILER_HOST)%"
mailer_user: "%env(SYLIUS_MAILER_USER)%"
mailer_password: "%env(SYLIUS_MAILER_PASSWORD)%"
mailer_transport: '%env(SYLIUS_MAILER_TRANSPORT)%'
mailer_host: '%env(SYLIUS_MAILER_HOST)%'
mailer_user: '%env(SYLIUS_MAILER_USER)%'
mailer_password: '%env(SYLIUS_MAILER_PASSWORD)%'

secret: "%env(SYLIUS_SECRET)"
secret: '%env(SYLIUS_SECRET)'

# Fallback values (used if environmental variables are not set)
env(SYLIUS_DATABASE_DRIVER): pdo_mysql
Expand Down
2 changes: 2 additions & 0 deletions app/config/router_test_cached.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

/*
* This file implements rewrite rules for PHP built-in web server.
*
Expand Down
10 changes: 5 additions & 5 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# (c) Paweł Jędrzejewski

sylius_admin:
resource: "@SyliusAdminBundle/Resources/config/routing.yml"
resource: '@SyliusAdminBundle/Resources/config/routing.yml'
prefix: /admin

sylius_api:
resource: "@SyliusAdminApiBundle/Resources/config/routing.yml"
resource: '@SyliusAdminApiBundle/Resources/config/routing.yml'
prefix: /api

sylius_shop:
resource: "@SyliusShopBundle/Resources/config/routing.yml"
resource: '@SyliusShopBundle/Resources/config/routing.yml'
prefix: /{_locale}
requirements:
_locale: ^[a-z]{2}(?:_[A-Z]{2})?$

sylius_shop_payum:
resource: "@SyliusShopBundle/Resources/config/routing/payum.yml"
resource: '@SyliusShopBundle/Resources/config/routing/payum.yml'

sylius_shop_default_locale:
path: /
Expand All @@ -25,4 +25,4 @@ sylius_shop_default_locale:
_controller: sylius.controller.shop.locale_switch:switchAction

_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.xml"
resource: '@LiipImagineBundle/Resources/config/routing.xml'
4 changes: 2 additions & 2 deletions app/config/routing_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# (c) Paweł Jędrzejewski

_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt

_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler

_main:
Expand Down
Loading

0 comments on commit 9b958f5

Please sign in to comment.