Skip to content

Commit

Permalink
refactor: Restructure bundle directory (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaveras authored Jun 2, 2023
1 parent 8c67008 commit 255d7ea
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
EOF;

$finder = PhpCsFixer\Finder::create()
->in([__DIR__.'/'])
->in([__DIR__.'/src', __DIR__.'/tests'])
->name('*.php')
->notName('Configuration.php')
;

$config = new PhpCsFixer\Config();

return $config
->setUsingCache(false)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
Expand Down
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 11 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 2 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@
>
<testsuites>
<testsuite name="Bundle Test Suit">
<directory>./Tests/</directory>
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./</directory>
<directory>./src/</directory>
</include>
<exclude>
<directory>./.github/</directory>
<directory>./Tests/</directory>
<directory>./vendor/</directory>
<file>./.php-cs-fixer.php</file>
<file>./rector.php</file>
</exclude>
</source>
</phpunit>
5 changes: 5 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 255d7ea

Please sign in to comment.