diff --git a/.gitignore b/.gitignore index dbbe959..8a571ca 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ composer.lock .project .settings vendor - +.phpunit.result.cache +.php_cs.cache \ No newline at end of file diff --git a/.php_cs b/.php_cs index 4b7b398..1ae7995 100644 --- a/.php_cs +++ b/.php_cs @@ -1,39 +1,21 @@ in('bin') - ->in('src') - ->in('tests'); -$config = Symfony\CS\Config\Config::create(); -$config->level(null); -$config->fixers( - array( - 'braces', - 'duplicate_semicolon', - 'elseif', - 'empty_return', - 'encoding', - 'eof_ending', - 'function_call_space', - 'function_declaration', - 'indentation', - 'join_function', - 'line_after_namespace', - 'linefeed', - 'lowercase_keywords', - 'parenthesis', - 'multiple_use', - 'method_argument_space', - 'object_operator', - 'php_closing_tag', - 'remove_lines_between_uses', - 'short_array_syntax', - 'short_tag', - 'standardize_not_equal', - 'trailing_spaces', - 'unused_use', - 'visibility', - 'whitespacy_lines', - ) -); -$config->finder($finder); + +$config = PhpCsFixer\Config::create(); +$config->setRules([ + '@PSR2' => true, +]); + +$finder = PhpCsFixer\Finder::create(); + +/* + * You can set manually these paths: + */ +$finder->in([ + 'bin', + 'src', + 'tests' +]); + +$config->setFinder($finder); + return $config; diff --git a/.travis.yml b/.travis.yml index 5f1dd2d..402be70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,30 @@ -language: php - -sudo: false - -php: - - 7.0 - -env: - matrix: - - DEPENDENCIES="" - - DEPENDENCIES="--prefer-lowest --prefer-stable" - -cache: - directories: - - $HOME/.composer/cache - -before_script: - - phpenv config-rm xdebug.ini - - composer self-update - - composer update --prefer-dist $DEPENDENCIES - -script: - - php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml - - ./vendor/bin/php-cs-fixer fix -v --diff --dry-run - -after_success: - - php vendor/bin/coveralls -v +language: php + +sudo: false + +php: + - 7.0 + - 7.1 + - 7.2 + - 7.3 + +env: + matrix: + - DEPENDENCIES="" + - DEPENDENCIES="--prefer-lowest --prefer-stable" + +cache: + directories: + - $HOME/.composer/cache + +before_script: + - phpenv config-rm xdebug.ini + - composer self-update + - composer update --prefer-dist $DEPENDENCIES + +script: + - php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml + - ./vendor/bin/php-cs-fixer fix -v --diff --dry-run + +after_success: + - travis_retry php vendor/bin/php-coveralls -v diff --git a/composer.json b/composer.json index 123b658..6f355c3 100644 --- a/composer.json +++ b/composer.json @@ -15,15 +15,14 @@ "php": "^7.0", "prolic/humus-amqp" : "^1.0", "container-interop/container-interop": "^1.1", - "sandrokeil/interop-config": "^1.0", - "symfony/console": "^2.5|^3.0", + "sandrokeil/interop-config": "^1.0 || ^2.0", + "symfony/console": "^3.0|^4.0", "zendframework/zend-modulemanager": "^2.7" }, "require-dev": { - "phpunit/phpunit": "^5.4", - "phpspec/prophecy": "^1.6", - "friendsofphp/php-cs-fixer": "^1.11.5", - "satooshi/php-coveralls": "^1.0" + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0", + "friendsofphp/php-cs-fixer": "^2.14", + "php-coveralls/php-coveralls": "^2.1" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e01362b..8a0d104 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,6 @@ stopOnFailure="false" processIsolation="false" backupGlobals="false" - syntaxCheck="true" > ./tests diff --git a/src/Container/CliFactory.php b/src/Container/CliFactory.php index 73bcb5f..a890152 100644 --- a/src/Container/CliFactory.php +++ b/src/Container/CliFactory.php @@ -18,7 +18,7 @@ * and is licensed under the MIT license. */ -declare (strict_types=1); +declare(strict_types=1); namespace HumusAmqpModule\Container; diff --git a/src/Module.php b/src/Module.php index b0b199c..3306aca 100644 --- a/src/Module.php +++ b/src/Module.php @@ -18,7 +18,7 @@ * and is licensed under the MIT license. */ -declare (strict_types=1); +declare(strict_types=1); namespace HumusAmqpModule; diff --git a/tests/Container/CliFactoryTest.php b/tests/Container/CliFactoryTest.php index 621abf2..5cbb0e8 100644 --- a/tests/Container/CliFactoryTest.php +++ b/tests/Container/CliFactoryTest.php @@ -18,13 +18,13 @@ * and is licensed under the MIT license. */ -declare (strict_types=1); +declare(strict_types=1); namespace HumusAmqpModuleTest\Container; use HumusAmqpModule\Container\CliFactory; use Interop\Container\ContainerInterface; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Application; /** diff --git a/tests/ModuleTest.php b/tests/ModuleTest.php index f3fe2d0..7265d0d 100644 --- a/tests/ModuleTest.php +++ b/tests/ModuleTest.php @@ -18,12 +18,12 @@ * and is licensed under the MIT license. */ -declare (strict_types=1); +declare(strict_types=1); namespace HumusAmqpModuleTest; use HumusAmqpModule\Module; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; /** * Class ModuleTest @@ -38,7 +38,12 @@ public function it_gets_config() { $module = new Module(); $config = $module->getConfig(); - $this->assertInternalType('array', $config); + if (\method_exists($this, 'assertIsArray')) { + $this->assertIsArray($config); + } else { + $this->assertInternalType('array', $config); + } + $this->assertSame($config, unserialize(serialize($config))); } }