[TASK] Optimize CSS clearfix usage
[Packages/TYPO3.CMS.git] / Build / .php_cs
1 <?php
2 /*
3 * This file is part of the TYPO3 CMS project.
4 *
5 * It is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License, either version 2
7 * of the License, or any later version.
8 *
9 * For the full copyright and license information, please read the
10 * LICENSE.txt file that was distributed with this source code.
11 *
12 * The TYPO3 project - inspiring people to share!
13 */
14
15 /**
16 * This file represents the configuration for Code Sniffing PSR-2-related
17 * automatic checks of coding guidelines
18 * Install @fabpot's great php-cs-fixer tool via
19 *
20 * $ composer global require fabpot/php-cs-fixer
21 *
22 * And then simply run
23 *
24 * $ php-cs-fixer fix --config-file Build/.php_cs
25 *
26 * inside the TYPO3 directory. Warning: This may take up to 10 minutes.
27 *
28 * For more information read:
29 * http://www.php-fig.org/psr/psr-2/
30 * http://cs.sensiolabs.org
31 */
32
33 if (PHP_SAPI !== 'cli') {
34 die('This script supports command line usage only. Please check your command.');
35 }
36 // Define in which folders to search and which folders to exclude
37 // Exclude some directories that are excluded by Git anyways to speed up the sniffing
38 $finder = Symfony\CS\Finder\DefaultFinder::create()
39 ->exclude('vendor')
40 ->exclude('typo3conf')
41 ->exclude('typo3temp')
42 ->exclude('adodb')
43 ->exclude('php-openid')
44 ->in(__DIR__ . '/../');
45
46 // Return a Code Sniffing configuration using
47 // all sniffers needed for PSR-2
48 // and additionally:
49 // - Remove leading slashes in use clauses.
50 // - PHP single-line arrays should not have trailing comma.
51 // - Single-line whitespace before closing semicolon are prohibited.
52 // - Remove unused use statements in the PHP source code
53 // - Ensure Concatenation to have at least one whitespace around
54 // - Remove trailing whitespace at the end of blank lines.
55 return Symfony\CS\Config\Config::create()
56 ->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
57 ->fixers([
58 'remove_leading_slash_use',
59 'single_array_no_trailing_comma',
60 'spaces_before_semicolon',
61 'unused_use',
62 'concat_with_spaces',
63 'whitespacy_lines',
64 'ordered_use',
65 'single_quote',
66 'duplicate_semicolon',
67 'extra_empty_lines',
68 'phpdoc_no_package',
69 'phpdoc_scalar',
70 'no_empty_lines_after_phpdocs'
71 ])
72 ->finder($finder);