Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ composer.lock
.project
.settings
vendor

.phpunit.result.cache
.php_cs.cache
56 changes: 19 additions & 37 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
<?php
$finder = Symfony\CS\Finder\DefaultFinder::create()
->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;
57 changes: 30 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
stopOnFailure="false"
processIsolation="false"
backupGlobals="false"
syntaxCheck="true"
>
<testsuite name="HumusAmqpModule Test-Suite">
<directory>./tests</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/Container/CliFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* and is licensed under the MIT license.
*/

declare (strict_types=1);
declare(strict_types=1);

namespace HumusAmqpModule\Container;

Expand Down
2 changes: 1 addition & 1 deletion src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* and is licensed under the MIT license.
*/

declare (strict_types=1);
declare(strict_types=1);

namespace HumusAmqpModule;

Expand Down
4 changes: 2 additions & 2 deletions tests/Container/CliFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
11 changes: 8 additions & 3 deletions tests/ModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)));
}
}