diff --git a/.php_cs b/.php_cs index 1f94cb1..6e11d60 100644 --- a/.php_cs +++ b/.php_cs @@ -1,6 +1,6 @@ in('src') ; @@ -13,11 +13,14 @@ This source file is subject to the MIT license that is bundled with this source code in the file LICENSE. EOT; -Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); - -return Symfony\CS\Config\Config::create() - ->setUsingCache(true) - ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) - ->fixers(array('-empty_return', '-phpdoc_no_empty_return', 'header_comment')) - ->finder($finder) +return PhpCsFixer\Config::create() + ->setRules(array( + '@Symfony' => true, + 'simplified_null_return' => false, + 'phpdoc_no_empty_return' => false, + 'no_mixed_echo_print' => ['use' => 'print'], + 'header_comment' => ['header' => $header], + )) + ->setUsingCache(false) + ->setFinder($finder) ; diff --git a/.travis.yml b/.travis.yml index 746d817..a82008b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,28 @@ language: php php: - - 5.5 - 5.6 - 7.0 - - hhvm + - 7.1 matrix: include: - - php: 5.5 + - php: 5.6 env: COMPOSER_FLAGS="--prefer-lowest" before_install: - composer self-update - composer --version - - wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer.phar + - if [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer.phar; fi + - if [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then php php-cs-fixer.phar --version; fi install: - COMPOSER_ROOT_VERSION=dev-master composer update --prefer-source $COMPOSER_FLAGS script: - - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php php-cs-fixer.phar fix --dry-run -v; fi - - bin/phpunit --coverage-clover build/logs/clover.xml + - if [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then php php-cs-fixer.phar fix --dry-run -v; fi + - if [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then bin/phpunit --coverage-clover build/logs/clover.xml; fi + - if [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then bin/phpunit; fi after_script: - - php bin/coveralls -v + - if [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then php bin/coveralls -v; fi diff --git a/src/LightSaml/SymfonyBridgeBundle/Bridge/Container/ProviderContainer.php b/src/LightSaml/SymfonyBridgeBundle/Bridge/Container/ProviderContainer.php index 826c4bd..f95c7cc 100644 --- a/src/LightSaml/SymfonyBridgeBundle/Bridge/Container/ProviderContainer.php +++ b/src/LightSaml/SymfonyBridgeBundle/Bridge/Container/ProviderContainer.php @@ -41,4 +41,9 @@ public function getNameIdProvider() { return $this->container->get('lightsaml.provider.name_id'); } + + public function getAttributeNameProvider() + { + return $this->container->get('lightsaml.provider.attribute_name'); + } } diff --git a/src/LightSaml/SymfonyBridgeBundle/DependencyInjection/LightSamlSymfonyBridgeExtension.php b/src/LightSaml/SymfonyBridgeBundle/DependencyInjection/LightSamlSymfonyBridgeExtension.php index 58513ff..98ad4bd 100644 --- a/src/LightSaml/SymfonyBridgeBundle/DependencyInjection/LightSamlSymfonyBridgeExtension.php +++ b/src/LightSaml/SymfonyBridgeBundle/DependencyInjection/LightSamlSymfonyBridgeExtension.php @@ -157,7 +157,7 @@ private function configureParty(ContainerBuilder $container, array $config) foreach ($config['party']['idp']['files'] as $id => $file) { $id = sprintf('lightsaml.party.idp_entity_descriptor_store.file.%s', $id); - if(class_exists('Symfony\Component\DependencyInjection\ChildDefinition')) { + if (class_exists('Symfony\Component\DependencyInjection\ChildDefinition')) { // Symfony >= 3.3 $container ->setDefinition($id, new ChildDefinition('lightsaml.party.idp_entity_descriptor_store.file')) diff --git a/tests/LightSaml/SymfonyBridgeBundle/Tests/DependencyInjection/Compiler/AddMethodCallCompilerPassTest.php b/tests/LightSaml/SymfonyBridgeBundle/Tests/DependencyInjection/Compiler/AddMethodCallCompilerPassTest.php index f988d68..c941d1b 100644 --- a/tests/LightSaml/SymfonyBridgeBundle/Tests/DependencyInjection/Compiler/AddMethodCallCompilerPassTest.php +++ b/tests/LightSaml/SymfonyBridgeBundle/Tests/DependencyInjection/Compiler/AddMethodCallCompilerPassTest.php @@ -21,7 +21,7 @@ public function test_process_does_nothing_if_container_does_not_have_the_service $pass->process($containerBuilder); - $this->assertCount(0, $containerBuilder->getDefinitions()); + $this->assertFalse($containerBuilder->hasDefinition($serviceId)); } public function test_process_adds_calls_to_service_with_argument_reference_to_all_tagged_services()