Skip to content

Commit

Permalink
Fix CS (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Jan 1, 2022
1 parent 98d38d9 commit 40d0ace
Show file tree
Hide file tree
Showing 75 changed files with 215 additions and 69 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/composer.lock
/coverage.xml
/.phar/
/.php-cs-fixer.cache
/.php_cs.cache
/phpunit.xml
/vendor/
/var/
.phpunit.result.cache
/.phpunit.result.cache
117 changes: 59 additions & 58 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
<?php

/*
* This file is part of the Hautelook\AliceBundle package.
*
* (c) Baldur Rensch <brensch@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

$header = <<<'HEADER'
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

const HEADER = <<<'HEADER'
This file is part of the Hautelook\AliceBundle package.
(c) Baldur Rensch <brensch@gmail.com>
Expand All @@ -11,76 +23,65 @@
file that was distributed with this source code.
HEADER;

$finder = PhpCsFixer\Finder::create()
$finder = Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
->in(__DIR__.'/fixtures')
->exclude('fixtures/Resolver/cache/')
->exclude('fixtures/Functional/cache/')
->exclude('fixtures/Resolver/cache')
->exclude('fixtures/Functional/cache')
->append([
__DIR__.'/.php-cs-fixer.dist.php',
__DIR__.'/bin/console',
])
;

return PhpCsFixer\Config::create()
return (new Config())
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'align_multiline_comment' => [
'comment_type' => 'phpdocs_only',
],
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short',
],
'braces' => [
'allow_single_line_closure' => true,
],
//'declare_strict_types' => true,
'doctrine_annotation_array_assignment' => [
'operator' => '=',
],
'doctrine_annotation_spaces' => [
'after_array_assignments_equals' => false,
'before_array_assignments_equals' => false,
'@PSR2' => true,
'blank_line_after_opening_tag' => true,
'cast_spaces' => true,
'combine_consecutive_unsets' => true,
'declare_equal_normalize' => true,
'declare_strict_types' => true,
'general_phpdoc_annotation_remove' => [
'annotations' => [
'inheritDoc',
],
],
'header_comment' => [
'header' => $header,
'header' => HEADER,
'location' => 'after_open',
],
'native_function_invocation' => [
'include' => [
'@compiler_optimized',
],
],
'no_extra_blank_lines' => [
'tokens' => [
'break',
'continue',
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'throw',
'use',
],
],
'include' => true,
'lowercase_cast' => true,
'modernize_types_casting' => true,
'native_function_casing' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_superfluous_phpdoc_tags' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => [
'importsOrder' => [
'class',
'function',
'const',
],
'sortAlgorithm' => 'alpha',
],
'no_short_bool_cast' => true,
'no_spaces_around_offset' => true,
'no_unused_imports' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'single_line_throw' => false,
'strict_comparison' => true,
'strict_param' => true,
'ternary_to_null_coalescing' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_trim' => true,
'php_unit_fqcn_annotation' => true,
'php_unit_test_class_requires_covers' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'trim_array_spaces' => true,
'whitespace_after_comma_in_array' => true,
])
->setFinder($finder)
;
2 changes: 2 additions & 0 deletions fixtures/DataFixtures/Loader/FakeLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\DataFixtures\Loader;

use Fidry\AliceDataFixtures\LoaderInterface as DataFixturesLoaderInterface;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/DataFixtures/Loader/FakeLoaderPersisterAware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\DataFixtures\Loader;

use Fidry\AliceDataFixtures\Persistence\PersisterAwareInterface;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/FixtureLocator/FakeFixtureLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\FixtureLocator;

use Hautelook\AliceBundle\FixtureLocatorInterface;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional;

use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/ConfigurableKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional;

use Hautelook\AliceBundle\HautelookAliceBundle;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/SimpleBundle/SimpleBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\SimpleBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/SimpleKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional;

use Hautelook\AliceBundle\Functional\SimpleBundle\SimpleBundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\ABundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Bundle/ABundle/TestABundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\ABundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\BBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Bundle/BBundle/TestBBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\BBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\CBundle\DataFixtures\ORM\AEnv;

use Hautelook\AliceBundle\Doctrine\DataFixtures\AbstractLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\CBundle\DataFixtures\ORM\BEnv;

use Hautelook\AliceBundle\Doctrine\DataFixtures\AbstractLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\CBundle\DataFixtures\ORM\DEnv;

use Hautelook\AliceBundle\Doctrine\DataFixtures\AbstractLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\CBundle\DataFixtures\ORM\EEnv;

use Hautelook\AliceBundle\Doctrine\DataFixtures\AbstractLoader;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Bundle/CBundle/TestCBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\CBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Bundle\EmptyBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\DataFixtures\Faker\Provider;

class FooProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\DataFixtures\Processor;

use Hautelook\AliceBundle\Functional\TestBundle\Entity\Brand;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/Brand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

class City
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/Dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/Inte.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/Prod.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

class Project
Expand Down
2 changes: 2 additions & 0 deletions fixtures/Functional/TestBundle/Entity/Shard.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand Down
Loading

0 comments on commit 40d0ace

Please sign in to comment.