-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from aurelienCastellarnau/feature/128384
[FEATURE#128384] feat(sprinter_service_provider): Migration vers Symfony4
- Loading branch information
Showing
40 changed files
with
8,426 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
coverage_clover: tmp/behat/coverage.clover.xml | ||
json_path: tmp/behat/coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
image: etna/drone-php7:php71 | ||
env: | ||
- APP_ENV=test | ||
- COVERALLS_REPO_TOKEN=$$COVERALLS_TOKEN | ||
- COVERALLS_SERVICE_NAME=drone.io | ||
script: | ||
- composer global require phpdocumentor/phpdocumentor --no-interaction --prefer-dist --no-progress | ||
- composer install --dev --no-interaction --prefer-dist --no-progress --no-scripts | ||
- composer phing | ||
- composer coveralls | ||
services: | ||
- rabbitmq | ||
notify: | ||
slack: | ||
webhook_url: $$SLACK_WEBHOOK_URL | ||
username: drone | ||
channel: $$SLACK_CHANNEL | ||
on_started: true | ||
on_failure: true | ||
on_success: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
bin/ | ||
tmp/ | ||
vendor/ | ||
composer.lock | ||
|
||
###> symfony/framework-bundle ### | ||
/.env.local | ||
/.env.local.php | ||
/.env.*.local | ||
/public/bundles/ | ||
/var/ | ||
/vendor/ | ||
|
||
###> phpunit/phpunit ### | ||
/phpunit.xml | ||
###< phpunit/phpunit ### | ||
|
||
###> squizlabs/php_codesniffer ### | ||
/.phpcs-cache | ||
/phpcs.xml | ||
###< squizlabs/php_codesniffer ### | ||
|
||
###> friendsofphp/php-cs-fixer ### | ||
/.php_cs | ||
/.php_cs.cache | ||
###< friendsofphp/php-cs-fixer ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__ . "/src") | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
"@PSR1" => true, | ||
"@PSR2" => true, | ||
"@Symfony" => true, | ||
"@Symfony:risky" => true, | ||
"@DoctrineAnnotation" => true, | ||
"@PHP56Migration" => true, | ||
"@PHP56Migration:risky" => true, | ||
"@PHP70Migration" => true, | ||
"@PHP70Migration:risky" => true, | ||
"@PHP71Migration" => true, | ||
"@PHP71Migration:risky" => true, | ||
"binary_operator_spaces" => [ | ||
"align_double_arrow" => true, | ||
"align_equals" => true | ||
], | ||
"concat_space" => true, | ||
"strict_comparison" => true, | ||
"combine_consecutive_issets" => true, | ||
"combine_consecutive_unsets" => true, | ||
"comment_to_phpdoc" => true, | ||
"compact_nullable_typehint" => true, | ||
"explicit_indirect_variable" => true, | ||
"explicit_string_variable" => true, | ||
"header_comment" => [ | ||
"commentType" => "PHPDoc", | ||
"header" => "PHP version 7.1\n@author BLU <dev@etna-alternance.net>", | ||
"location" => "after_open", | ||
"separate" => "bottom" | ||
], | ||
"linebreak_after_opening_tag" => true, | ||
"no_useless_else" => true, | ||
"no_useless_return" => true, | ||
"ordered_imports" => true, | ||
"phpdoc_order" => true, | ||
"psr0" => true, | ||
"return_assignment" => true, | ||
"visibility_required" => [ | ||
"elements" => ['property', 'method'] | ||
], | ||
"concat_space" => [ | ||
"spacing" => "one" | ||
] | ||
]) | ||
->setFinder($finder) | ||
->setRiskyAllowed(true) | ||
->setUsingCache(false) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace TestApp; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\Config\Resource\FileResource; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\HttpKernel\Kernel as BaseKernel; | ||
use Symfony\Component\Routing\RouteCollectionBuilder; | ||
|
||
class Kernel extends BaseKernel | ||
{ | ||
use MicroKernelTrait; | ||
|
||
const CONFIG_EXTS = '.{php,xml,yaml,yml}'; | ||
|
||
public function getCacheDir() | ||
{ | ||
return $this->getProjectDir().'/tmp/cache/'.$this->environment; | ||
} | ||
|
||
public function getLogDir() | ||
{ | ||
return $this->getProjectDir().'/tmp/log'; | ||
} | ||
|
||
public function registerBundles() | ||
{ | ||
$contents = require $this->getProjectDir().'/TestApp/config/bundles.php'; | ||
foreach ($contents as $class => $envs) { | ||
if (isset($envs['all']) || isset($envs[$this->environment])) { | ||
yield new $class(); | ||
} | ||
} | ||
} | ||
|
||
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader) | ||
{ | ||
$container->addResource(new FileResource($this->getProjectDir().'/TestApp/config/bundles.php')); | ||
// Feel free to remove the "container.autowiring.strict_mode" parameter | ||
// if you are using symfony/dependency-injection 4.0+ as it's the default behavior | ||
$container->setParameter('container.autowiring.strict_mode', true); | ||
$container->setParameter('container.dumper.inline_class_loader', true); | ||
$confDir = $this->getProjectDir().'/TestApp/config'; | ||
|
||
$loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); | ||
$loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); | ||
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); | ||
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); | ||
} | ||
|
||
protected function configureRoutes(RouteCollectionBuilder $routes) | ||
{ | ||
$confDir = $this->getProjectDir().'/TestApp/config'; | ||
|
||
$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); | ||
$routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob'); | ||
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
return [ | ||
OldSound\RabbitMqBundle\OldSoundRabbitMqBundle::class => ['all' => true], | ||
ETNA\Sprinter\SprinterBundle::class => ['all' => true], | ||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
old_sound_rabbit_mq: | ||
connections: | ||
default: | ||
url: 'amqp://guest:guest@localhost:5672' | ||
vhost: '/test-behat' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
framework: | ||
secret: 'toto' | ||
|
||
php_errors: | ||
log: true | ||
|
||
test: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sprinter: | ||
default: | ||
routing_key: sprinter.lefran_f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Put parameters here that don't need to change on each machine where the app is deployed | ||
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration | ||
parameters: | ||
application_name: 'test_app' | ||
version: 2.0.0 | ||
|
||
services: | ||
# default configuration for services in *this* file | ||
_defaults: | ||
autowire: true # Automatically injects dependencies in your services. | ||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. | ||
public: true # Allows optimizing the container by removing unused services; this also means | ||
# fetching services directly from the container via $container->get() won't work. | ||
# The best practice is to be explicit about your dependencies anyway. | ||
|
||
# makes classes in src/ available to be used as services | ||
# this creates a service per class whose id is the fully-qualified class name | ||
TestApp\: | ||
resource: '../app/*' | ||
exclude: '../app/{Entity,Migrations,Tests,Utils,Kernel.php}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
default: | ||
formatters: | ||
progress: | ||
decorated: true | ||
verbose: true | ||
time: true | ||
language: fr | ||
output_path: null | ||
multiline_arguments: true | ||
|
||
suites: | ||
default: | ||
paths: | ||
- '%paths.base%/features/suites' | ||
contexts: | ||
- FeatureContext: | ||
- ETNA\FeatureContext\ApiContext | ||
- ETNA\FeatureContext\RabbitContext | ||
- ETNA\FeatureContext\ExceptionContainerContext | ||
- ETNA\FeatureContext\SymfonyTestKernelContext: | ||
bundles: | ||
- '\ETNA\Sprinter\SprinterBundle' | ||
- '\OldSound\RabbitMqBundle\OldSoundRabbitMqBundle' | ||
extensions: | ||
Behat\Symfony2Extension: | ||
kernel: | ||
class: TestApp\Kernel | ||
|
||
ci: | ||
suites: | ||
default: | ||
paths: | ||
- '%paths.base%/features/suites' | ||
contexts: | ||
- ETNA\FeatureContext\CoverageContext: | ||
coverage_path: /tmp/behat/coverage | ||
whitelist: | ||
- src | ||
blacklist: | ||
- vendor | ||
- bin | ||
- tmp | ||
- Tests | ||
- FeatureContext: | ||
- ETNA\FeatureContext\ApiContext | ||
- ETNA\FeatureContext\RabbitContext | ||
- ETNA\FeatureContext\ExceptionContainerContext | ||
- ETNA\FeatureContext\SymfonyTestKernelContext: | ||
bundles: | ||
- '\ETNA\Sprinter\SprinterBundle' | ||
- '\OldSound\RabbitMqBundle\OldSoundRabbitMqBundle' | ||
extensions: | ||
Behat\Symfony2Extension: | ||
kernel: | ||
class: TestApp\Kernel |
Oops, something went wrong.