Skip to content

Commit 5401423

Browse files
committed
refactor: use shared PHP-CS-Fixer config from typo3-ci-workflows
Replaces standalone config with the shared factory that handles ext_emconf.php exclusion and standard rules centrally. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent 8c42a80 commit 5401423

File tree

1 file changed

+6
-94
lines changed

1 file changed

+6
-94
lines changed

Build/.php-cs-fixer.dist.php

Lines changed: 6 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,10 @@
11
<?php
22

3-
/**
4-
* This file represents the configuration for Code Sniffing PSR-2-related
5-
* automatic checks of coding guidelines
6-
* Install @fabpot's great php-cs-fixer tool via
7-
*
8-
* $ composer global require friendsofphp/php-cs-fixer
9-
*
10-
* And then simply run
11-
*
12-
* $ php-cs-fixer fix
13-
*
14-
* For more information read:
15-
* http://www.php-fig.org/psr/psr-2/
16-
* http://cs.sensiolabs.org
17-
*/
3+
$createConfig = require __DIR__ . '/../.Build/vendor/netresearch/typo3-ci-workflows/config/php-cs-fixer/config.php';
184

19-
if (PHP_SAPI !== 'cli') {
20-
die('This script supports command line usage only. Please check your command.');
21-
}
5+
return $createConfig(<<<'EOF'
6+
This file is part of the package netresearch/nr-scheduler.
227
23-
$header = <<<EOF
24-
This file is part of the package netresearch/nr-scheduler.
25-
26-
For the full copyright and license information, please read the
27-
LICENSE file that was distributed with this source code.
28-
EOF;
29-
30-
return (new PhpCsFixer\Config())
31-
->setRiskyAllowed(true)
32-
->setRules([
33-
'@PSR12' => true,
34-
'@PER-CS2x0' => true,
35-
'@Symfony' => true,
36-
37-
// Additional custom rules
38-
'declare_strict_types' => true,
39-
'concat_space' => [
40-
'spacing' => 'one',
41-
],
42-
'header_comment' => [
43-
'header' => $header,
44-
'comment_type' => 'PHPDoc',
45-
'location' => 'after_open',
46-
'separate' => 'both',
47-
],
48-
'phpdoc_to_comment' => false,
49-
'phpdoc_no_alias_tag' => false,
50-
'phpdoc_annotation_without_dot' => false,
51-
'no_superfluous_phpdoc_tags' => false,
52-
'phpdoc_separation' => [
53-
'groups' => [
54-
[
55-
'author',
56-
'license',
57-
'link',
58-
],
59-
],
60-
],
61-
'no_alias_functions' => true,
62-
'whitespace_after_comma_in_array' => [
63-
'ensure_single_space' => true,
64-
],
65-
'single_line_throw' => false,
66-
'self_accessor' => false,
67-
'global_namespace_import' => [
68-
'import_classes' => true,
69-
'import_constants' => true,
70-
'import_functions' => true,
71-
],
72-
'function_declaration' => [
73-
'closure_function_spacing' => 'one',
74-
'closure_fn_spacing' => 'one',
75-
],
76-
'binary_operator_spaces' => [
77-
'operators' => [
78-
'=' => 'align_single_space_minimal',
79-
'=>' => 'align_single_space_minimal',
80-
],
81-
],
82-
'yoda_style' => [
83-
'equal' => false,
84-
'identical' => false,
85-
'less_and_greater' => false,
86-
'always_move_variable' => false,
87-
],
88-
])
89-
->setFinder(
90-
PhpCsFixer\Finder::create()
91-
->exclude('.build')
92-
->exclude('config')
93-
->exclude('node_modules')
94-
->exclude('var')
95-
// Exclude ext_emconf.php - TYPO3 does not want declare(strict_types=1) in this file
96-
->notName('ext_emconf.php')
97-
->in(__DIR__ . '/../')
98-
);
8+
For the full copyright and license information, please read the
9+
LICENSE file that was distributed with this source code.
10+
EOF, __DIR__ . '/..');

0 commit comments

Comments
 (0)