Skip to content

Commit 8b31587

Browse files
phpcsfixer
1 parent e8a1c38 commit 8b31587

16 files changed

+66
-60
lines changed

.php-cs-fixer.dist.php

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
11
<?php
22

3-
$finder = PhpCsFixer\Finder::create()
4-
->in(__DIR__)
5-
->ignoreDotFiles(true)
6-
->ignoreVCS(true)
7-
->exclude(['build', 'vendor'])
8-
->files()
9-
->name('*.php')
10-
;
3+
/*
4+
* This file is part of the CleverAge/DoctrineProcessBundle package.
5+
*
6+
* Copyright (c) 2017-2023 Clever-Age
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
1111

12-
$config = new PhpCsFixer\Config();
12+
if (!file_exists(__DIR__.'/src')) {
13+
exit(0);
14+
}
1315

14-
return $config
15-
->setUsingCache(true)
16-
->setRiskyAllowed(true)
17-
->setFinder($finder)
16+
$fileHeaderComment = <<<'EOF'
17+
This file is part of the CleverAge/DoctrineProcessBundle package.
18+
19+
Copyright (c) 2017-2023 Clever-Age
20+
21+
For the full copyright and license information, please view the LICENSE
22+
file that was distributed with this source code.
23+
EOF;
24+
25+
return (new PhpCsFixer\Config())
1826
->setRules([
27+
'@PHP71Migration' => true,
28+
'@PHPUnit75Migration:risky' => true,
1929
'@Symfony' => true,
2030
'@Symfony:risky' => true,
21-
'@PHPUnit48Migration:risky' => true,
22-
'array_syntax' => ['syntax' => 'short'],
23-
'fopen_flags' => false,
24-
'ordered_imports' => true,
2531
'protected_to_private' => false,
26-
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
27-
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
28-
// Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading
29-
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
30-
'single_line_throw' => false,
31-
// this must be disabled because the output of some tests include NBSP characters
32-
'non_printable_character' => false,
33-
'blank_line_between_import_groups' => false,
34-
'no_trailing_comma_in_singleline' => false,
35-
'nullable_type_declaration_for_default_null_value' => true,
36-
'phpdoc_to_comment' => false,
32+
'native_constant_invocation' => ['strict' => false],
33+
'header_comment' => ['header' => $fileHeaderComment],
34+
'modernize_strpos' => true,
35+
'get_class_to_class_keyword' => true,
3736
])
37+
->setRiskyAllowed(true)
38+
->setFinder(
39+
(new PhpCsFixer\Finder())
40+
->in(__DIR__.'/src')
41+
->append([__FILE__])
42+
)
43+
->setCacheFile('.php-cs-fixer.cache')
3844
;

src/CleverAgeDoctrineProcessBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/*
6-
* This file is part of the CleverAge/ProcessBundle package.
6+
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
88
* Copyright (c) 2017-2023 Clever-Age
99
*

src/DependencyInjection/CleverAgeDoctrineProcessExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.

src/Task/Database/DatabaseReaderTask.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.

src/Task/Database/DatabaseUpdaterTask.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.

src/Task/EntityManager/AbstractDoctrineQueryTask.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.
@@ -60,8 +60,8 @@ protected function getQueryBuilder(
6060
EntityRepository $repository,
6161
array $criteria,
6262
array $orderBy,
63-
?int $limit = null,
64-
?int $offset = null
63+
int $limit = null,
64+
int $offset = null
6565
): QueryBuilder {
6666
$qb = $repository->createQueryBuilder('e');
6767
foreach ($criteria as $field => $value) {

src/Task/EntityManager/AbstractDoctrineTask.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.

src/Task/EntityManager/ClearEntityManagerTask.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.

src/Task/EntityManager/DoctrineBatchWriterTask.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.

src/Task/EntityManager/DoctrineCleanerTask.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
/**
5+
/*
66
* This file is part of the CleverAge/DoctrineProcessBundle package.
77
*
8-
* Copyright (C) 2017-2023 Clever-Age
8+
* Copyright (c) 2017-2023 Clever-Age
99
*
1010
* For the full copyright and license information, please view the LICENSE
1111
* file that was distributed with this source code.

0 commit comments

Comments
 (0)