diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index 48ac071..0438a42 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -9,7 +9,7 @@
EOF;
$finder = PhpCsFixer\Finder::create()
- ->in([__DIR__.'/'])
+ ->in([__DIR__.'/src', __DIR__.'/tests'])
->name('*.php')
->notName('Configuration.php')
;
@@ -17,6 +17,7 @@
$config = new PhpCsFixer\Config();
return $config
+ ->setUsingCache(false)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
diff --git a/composer.json b/composer.json
index 111804e..c58a4d5 100644
--- a/composer.json
+++ b/composer.json
@@ -24,11 +24,13 @@
},
"autoload": {
"psr-4": {
- "Ksaveras\\CircuitBreakerBundle\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
+ "Ksaveras\\CircuitBreakerBundle\\": "src"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Ksaveras\\CircuitBreakerBundle\\Tests\\": "tests"
+ }
},
"scripts": {
"phpcs": "./vendor/bin/php-cs-fixer fix --dry-run --diff",
diff --git a/phpstan.neon b/phpstan.neon
index d62109a..859eda1 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -2,10 +2,17 @@ parameters:
level: max
checkMissingIterableValueType: false
paths:
- - DependencyInjection
- - Tests
- excludePaths:
- - DependencyInjection/Configuration.php
+ - src
+ - tests
+ ignoreErrors:
+ -
+ message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:arrayPrototype\\(\\)\\.$#"
+ count: 1
+ path: src/DependencyInjection/Configuration.php
+ -
+ message: "#^Cannot call method integerNode\\(\\) on Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\|null\\.$#"
+ count: 1
+ path: src/DependencyInjection/Configuration.php
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index eb9b2e9..843ff1d 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -9,19 +9,12 @@
>
- ./Tests/
+ ./tests/
- ./
+ ./src/
-
- ./.github/
- ./Tests/
- ./vendor/
- ./.php-cs-fixer.php
- ./rector.php
-
diff --git a/rector.php b/rector.php
index 963fba7..7aed73d 100644
--- a/rector.php
+++ b/rector.php
@@ -12,6 +12,8 @@
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
+use Rector\PHPUnit\Set\PHPUnitLevelSetList;
+use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYieldsRector;
@@ -33,6 +35,9 @@
SetList::EARLY_RETURN,
SetList::INSTANCEOF,
SetList::TYPE_DECLARATION,
+ PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
+ PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
+ PHPUnitSetList::PHPUNIT_CODE_QUALITY,
]);
$rectorConfig->skip([
diff --git a/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php
similarity index 99%
rename from DependencyInjection/Configuration.php
rename to src/DependencyInjection/Configuration.php
index 6542cfc..4e03db1 100644
--- a/DependencyInjection/Configuration.php
+++ b/src/DependencyInjection/Configuration.php
@@ -18,6 +18,7 @@ final class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ksaveras_circuit_breaker');
+ /** @var ArrayNodeDefinition $rootNode */
$rootNode = $treeBuilder->getRootNode();
$this->addStorageSection($rootNode);
diff --git a/DependencyInjection/Factory/Storage/AbstractStorageFactory.php b/src/DependencyInjection/Factory/Storage/AbstractStorageFactory.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/AbstractStorageFactory.php
rename to src/DependencyInjection/Factory/Storage/AbstractStorageFactory.php
diff --git a/DependencyInjection/Factory/Storage/ApcuStorageFactory.php b/src/DependencyInjection/Factory/Storage/ApcuStorageFactory.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/ApcuStorageFactory.php
rename to src/DependencyInjection/Factory/Storage/ApcuStorageFactory.php
diff --git a/DependencyInjection/Factory/Storage/InMemoryStorageFactory.php b/src/DependencyInjection/Factory/Storage/InMemoryStorageFactory.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/InMemoryStorageFactory.php
rename to src/DependencyInjection/Factory/Storage/InMemoryStorageFactory.php
diff --git a/DependencyInjection/Factory/Storage/PredisStorageFactory.php b/src/DependencyInjection/Factory/Storage/PredisStorageFactory.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/PredisStorageFactory.php
rename to src/DependencyInjection/Factory/Storage/PredisStorageFactory.php
diff --git a/DependencyInjection/Factory/Storage/PsrCacheStorageFactory.php b/src/DependencyInjection/Factory/Storage/PsrCacheStorageFactory.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/PsrCacheStorageFactory.php
rename to src/DependencyInjection/Factory/Storage/PsrCacheStorageFactory.php
diff --git a/DependencyInjection/Factory/Storage/RedisStorageFactory.php b/src/DependencyInjection/Factory/Storage/RedisStorageFactory.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/RedisStorageFactory.php
rename to src/DependencyInjection/Factory/Storage/RedisStorageFactory.php
diff --git a/DependencyInjection/Factory/Storage/ServiceStorageFactory.php b/src/DependencyInjection/Factory/Storage/ServiceStorageFactory.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/ServiceStorageFactory.php
rename to src/DependencyInjection/Factory/Storage/ServiceStorageFactory.php
diff --git a/DependencyInjection/Factory/Storage/StorageFactoryInterface.php b/src/DependencyInjection/Factory/Storage/StorageFactoryInterface.php
similarity index 100%
rename from DependencyInjection/Factory/Storage/StorageFactoryInterface.php
rename to src/DependencyInjection/Factory/Storage/StorageFactoryInterface.php
diff --git a/DependencyInjection/KsaverasCircuitBreakerExtension.php b/src/DependencyInjection/KsaverasCircuitBreakerExtension.php
similarity index 100%
rename from DependencyInjection/KsaverasCircuitBreakerExtension.php
rename to src/DependencyInjection/KsaverasCircuitBreakerExtension.php
diff --git a/KsaverasCircuitBreakerBundle.php b/src/KsaverasCircuitBreakerBundle.php
similarity index 100%
rename from KsaverasCircuitBreakerBundle.php
rename to src/KsaverasCircuitBreakerBundle.php
diff --git a/Resources/config/storage.xml b/src/Resources/config/storage.xml
similarity index 100%
rename from Resources/config/storage.xml
rename to src/Resources/config/storage.xml
diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/tests/DependencyInjection/ConfigurationTest.php
similarity index 100%
rename from Tests/DependencyInjection/ConfigurationTest.php
rename to tests/DependencyInjection/ConfigurationTest.php
diff --git a/Tests/DependencyInjection/Factory/Storage/ApcuStorageFactoryTest.php b/tests/DependencyInjection/Factory/Storage/ApcuStorageFactoryTest.php
similarity index 100%
rename from Tests/DependencyInjection/Factory/Storage/ApcuStorageFactoryTest.php
rename to tests/DependencyInjection/Factory/Storage/ApcuStorageFactoryTest.php
diff --git a/Tests/DependencyInjection/Factory/Storage/InMemoryStorageFactoryTest.php b/tests/DependencyInjection/Factory/Storage/InMemoryStorageFactoryTest.php
similarity index 100%
rename from Tests/DependencyInjection/Factory/Storage/InMemoryStorageFactoryTest.php
rename to tests/DependencyInjection/Factory/Storage/InMemoryStorageFactoryTest.php
diff --git a/Tests/DependencyInjection/Factory/Storage/PredisStorageFactoryTest.php b/tests/DependencyInjection/Factory/Storage/PredisStorageFactoryTest.php
similarity index 100%
rename from Tests/DependencyInjection/Factory/Storage/PredisStorageFactoryTest.php
rename to tests/DependencyInjection/Factory/Storage/PredisStorageFactoryTest.php
diff --git a/Tests/DependencyInjection/Factory/Storage/PsrCacheStorageFactoryTest.php b/tests/DependencyInjection/Factory/Storage/PsrCacheStorageFactoryTest.php
similarity index 100%
rename from Tests/DependencyInjection/Factory/Storage/PsrCacheStorageFactoryTest.php
rename to tests/DependencyInjection/Factory/Storage/PsrCacheStorageFactoryTest.php
diff --git a/Tests/DependencyInjection/Factory/Storage/RedisStorageFactoryTest.php b/tests/DependencyInjection/Factory/Storage/RedisStorageFactoryTest.php
similarity index 100%
rename from Tests/DependencyInjection/Factory/Storage/RedisStorageFactoryTest.php
rename to tests/DependencyInjection/Factory/Storage/RedisStorageFactoryTest.php
diff --git a/Tests/DependencyInjection/KsaverasCircuitBreakerExtensionTest.php b/tests/DependencyInjection/KsaverasCircuitBreakerExtensionTest.php
similarity index 100%
rename from Tests/DependencyInjection/KsaverasCircuitBreakerExtensionTest.php
rename to tests/DependencyInjection/KsaverasCircuitBreakerExtensionTest.php