Skip to content

Commit

Permalink
chore: add php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
mtarld committed Sep 5, 2022
1 parent 6b45611 commit ec7fbea
Show file tree
Hide file tree
Showing 16 changed files with 351 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
22 changes: 22 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'trailing_comma_in_multiline' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
'declare_strict_types' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
;
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.11",
"justinrainbow/json-schema": "^5.2",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "6.1.*",
Expand Down
298 changes: 297 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Expand Down
2 changes: 2 additions & 0 deletions config/preload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}
2 changes: 2 additions & 0 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use App\Shared\Infrastructure\Symfony\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
Expand Down
1 change: 1 addition & 0 deletions src/Shared/Domain/Repository/PaginatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* @template T of object
*
* @extends \IteratorAggregate<T>
*/
interface PaginatorInterface extends \IteratorAggregate, \Countable
Expand Down
Loading

0 comments on commit ec7fbea

Please sign in to comment.