Skip to content

Commit 5210300

Browse files
committed
minor #1190 [CS] Update PhpCsFixer config (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [CS] Update PhpCsFixer config I took some time to check the `.php-cs-fixer.dist.php` file and * compared it to [symfony/symfony one](https://github.com/symfony/symfony/blob/6.4/.php-cs-fixer.dist.php) * checked the rules included in the rulesets (``@Symfony`` ``@Symfony`:risky` and ``@PHPUnit75Migration`:risky`) Rules already in one of the rulesets: * [php_unit_dedicate_assert](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/php_unit/php_unit_dedicate_assert.rst) -> in `@PHPUnit75Migration`:risky * [array_syntax](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/array_notation/array_syntax.rst) -> in `@symfony` * [combine_nested_dirname](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/function_notation/combine_nested_dirname.rst) -> in `@Symfony`:risky * [native_constant_invocation](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/constant_notation/native_constant_invocation.rst) -> in `@Symfony`:risky (with ['strict' => false) bug do we need the difference?) Rules unneeded: * [protected_to_private](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/class_notation/protected_to_private.rst) -> disabled per default * [fopen_flags](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/function_notation/fopen_flags.rst) -> no fopen call in this repository code Rules i suggest to remove: * [list_syntax](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/list_notation/list_syntax.rst) -> not sure to see the necessity of this rule, do we need it ? * [ordered_imports](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/rules/import/ordered_imports.rst) -> already in `@Symfony` (with a different order, but the same order present in PSR and PHPCSFIXER rulesets) -- ~I also realised there is no rule to include the symfony licence header in every PHP files, should we add it ?~ (done) --- Updated config: ```php ->setRules([ '`@PHPUnit75Migration`:risky' => true, '`@Symfony`' => true, '`@Symfony`:risky' => true, 'header_comment' => ['header' => $fileHeaderComment], ]) ``` Commits ------- ddd0e8f [CS] Update PhpCsFixer config
2 parents 85629ce + ddd0e8f commit 5210300

File tree

197 files changed

+1567
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+1567
-48
lines changed

.php-cs-fixer.dist.php

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
if (!file_exists(__DIR__.'/src')) {
413
exit(0);
514
}
615

16+
$fileHeaderComment = <<<'EOF'
17+
This file is part of the Symfony package.
18+
19+
(c) Fabien Potencier <[email protected]>
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+
725
return (new PhpCsFixer\Config())
826
->setRules([
27+
'@PHPUnit75Migration:risky' => true,
928
'@Symfony' => true,
1029
'@Symfony:risky' => true,
11-
'@PHPUnit75Migration:risky' => true,
12-
'php_unit_dedicate_assert' => ['target' => '5.6'],
13-
'array_syntax' => ['syntax' => 'short'],
14-
'fopen_flags' => false,
15-
'protected_to_private' => false,
16-
'native_constant_invocation' => true,
17-
'combine_nested_dirname' => true,
18-
'list_syntax' => ['syntax' => 'short'],
19-
'ordered_imports' => [
20-
'imports_order' => ['const', 'class', 'function'],
21-
],
30+
'header_comment' => ['header' => $fileHeaderComment],
2231
])
2332
->setRiskyAllowed(true)
2433
->setFinder(
@@ -28,6 +37,5 @@
2837
->notPath('#/Fixtures/#')
2938
->notPath('#/app/var/#')
3039
->notPath('#/var/cache/#')
31-
->notPath('Turbo/Attribute/Broadcast.php') // Need https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4702
3240
)
3341
;

src/Autocomplete/config/routes.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
413

514
return function (RoutingConfigurator $routes) {

src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\UX\Autocomplete\Form;
413

514
use Doctrine\ORM\EntityRepository;

src/Autocomplete/translations/AutocompleteBundle.ar.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'لم يتم العثور على أي نتائج',
514
'No more results' => 'لا توجد نتائج أٌخرى',

src/Autocomplete/translations/AutocompleteBundle.bg.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Няма намерени съвпадения',
514
'No more results' => 'Няма повече резултати',

src/Autocomplete/translations/AutocompleteBundle.ca.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'No s\'han trobat resultats',
514
'No more results' => 'No hi ha més resultats',

src/Autocomplete/translations/AutocompleteBundle.cs.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Nenalezeny žádné položky',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.da.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Ingen resultater fundet',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.de.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Keine Übereinstimmungen gefunden',
514
'No more results' => 'Keine weiteren Ergebnisse',

src/Autocomplete/translations/AutocompleteBundle.el.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Δεν βρέθηκαν αποτελέσματα',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.en.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'No results found',
514
'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.es.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'No se han encontrado resultados',
514
'No more results' => 'No hay más resultados',

src/Autocomplete/translations/AutocompleteBundle.eu.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Ez da bat datorrenik aurkitu',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.fa.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'هیچ نتیجه‌ای یافت نشد',
514
'No more results' => 'نتیجه دیگری وجود ندارد',

src/Autocomplete/translations/AutocompleteBundle.fi.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Ei tuloksia',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.fr.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Aucun résultat trouvé',
514
'No more results' => 'Aucun autre résultat trouvé',

src/Autocomplete/translations/AutocompleteBundle.gl.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Non se atoparon resultados',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.hr.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Nema rezultata',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.hu.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Nincs találat',
514
'No more results' => 'Nincs több találat',

src/Autocomplete/translations/AutocompleteBundle.id.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Tidak ada hasil yang ditemukan',
514
'No more results' => 'Tidak ada hasil lagi',

src/Autocomplete/translations/AutocompleteBundle.it.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Nessun risultato trovato',
514
'No more results' => 'Non ci sono altri risultati',

src/Autocomplete/translations/AutocompleteBundle.lb.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Keng Resultater fonnt',
514
'No more results' => 'Keng weider Resultater',

src/Autocomplete/translations/AutocompleteBundle.lt.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Atitikmenų nerasta',
514
// 'No more results' => 'No more results',

src/Autocomplete/translations/AutocompleteBundle.nl.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return [
413
'No results found' => 'Geen resultaten gevonden…',
514
'No more results' => 'Niet meer resultaten gevonden…',

0 commit comments

Comments
 (0)