Skip to content

Commit 20f00d5

Browse files
keradusfabpot
authored andcommitted
chore: PHP CS Fixer - allow header validator
1 parent 1e74e69 commit 20f00d5

File tree

4 files changed

+42
-7
lines changed

4 files changed

+42
-7
lines changed

.php-cs-fixer.dist.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@
1313
exit(0);
1414
}
1515

16-
$fileHeaderComment = <<<'EOF'
17-
This file is part of the Symfony package.
16+
$fileHeaderParts = [
17+
<<<'EOF'
18+
This file is part of the Symfony package.
1819
19-
(c) Fabien Potencier <[email protected]>
20+
(c) Fabien Potencier <[email protected]>
2021

21-
For the full copyright and license information, please view the LICENSE
22-
file that was distributed with this source code.
23-
EOF;
22+
EOF,
23+
<<<'EOF'
24+
25+
For the full copyright and license information, please view the LICENSE
26+
file that was distributed with this source code.
27+
EOF,
28+
];
2429

2530
return (new PhpCsFixer\Config())
2631
// @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777
@@ -31,7 +36,16 @@
3136
'@Symfony' => true,
3237
'@Symfony:risky' => true,
3338
'protected_to_private' => false,
34-
'header_comment' => ['header' => $fileHeaderComment],
39+
'header_comment' => [
40+
'header' => implode('', $fileHeaderParts),
41+
'validator' => implode('', [
42+
'/',
43+
preg_quote($fileHeaderParts[0], '/'),
44+
'(?P<EXTRA>.*)??',
45+
preg_quote($fileHeaderParts[1], '/'),
46+
'/s',
47+
])
48+
],
3549
])
3650
->setRiskyAllowed(true)
3751
->setFinder(

src/Symfony/Component/String/Resources/WcswidthDataGenerator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,17 @@ private function getHeader(string $version): string
8383
<?php
8484
8585
/*
86+
* This file is part of the Symfony package.
87+
*
88+
* (c) Fabien Potencier <[email protected]>
89+
*
8690
* This file has been auto-generated by the Symfony String Component for internal use.
8791
*
8892
* Unicode version: $version
8993
* Date: $date
94+
*
95+
* For the full copyright and license information, please view the LICENSE
96+
* file that was distributed with this source code.
9097
*/
9198
9299

src/Symfony/Component/String/Resources/data/wcswidth_table_wide.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
<?php
22

33
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
48
* This file has been auto-generated by the Symfony String Component for internal use.
59
*
610
* Unicode version: 16.0.0
711
* Date: 2024-09-11T08:21:22+00:00
12+
*
13+
* For the full copyright and license information, please view the LICENSE
14+
* file that was distributed with this source code.
815
*/
916

1017
return [

src/Symfony/Component/String/Resources/data/wcswidth_table_zero.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
<?php
22

33
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
48
* This file has been auto-generated by the Symfony String Component for internal use.
59
*
610
* Unicode version: 16.0.0
711
* Date: 2024-09-11T08:21:22+00:00
12+
*
13+
* For the full copyright and license information, please view the LICENSE
14+
* file that was distributed with this source code.
815
*/
916

1017
return [

0 commit comments

Comments
 (0)