‪TYPO3CMS  11.5
header-comment.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 if (PHP_SAPI !== 'cli') {
19  die('This script supports command line usage only. Please check your command.');
20 }
21 
22 ‪$finder = PhpCsFixer\Finder::create()
23  ->name('*.php')
24  ->in(__DIR__ . '/../../typo3/sysext')
25  ->exclude('Acceptance/Support/_generated') // EXT:core
26  // Configuration files do not need header comments
27  ->exclude('Configuration')
28  ->notName('*locallang*.php')
29  ->notName('AdditionalConfiguration.php')
30  ->notName('ext_localconf.php')
31  ->notName('ext_tables.php')
32  ->notName('ext_emconf.php')
33  // Third-party inclusion files should not have a changed comment
34  ->notName('Rfc822AddressesParser.php')
35  ->notName('ClassMapGenerator.php')
36 ;
37 
38 ‪$headerComment = <<<COMMENT
39 This file is part of the ‪TYPO3 CMS project.
40 
41 It is free software; you can redistribute it and/or modify it under
42 the terms of the GNU General Public License, either version 2
43 of the License, or any later version.
44 
45 For the full copyright and license information, please read the
46 LICENSE.txt file that was distributed with this source code.
47 
48 The ‪TYPO3 project - inspiring people to share!
49 COMMENT;
50 
51 return PhpCsFixer\Config::create()
52  ->setRiskyAllowed(false)
53  ->setRules([
54  'header_comment' => [
55  'header' => ‪$headerComment,
56  'comment_type' => 'comment',
57  'separate' => 'both',
58  'location' => 'after_declare_strict',
59  ],
60  ])
61  ->setFinder(‪$finder);
‪$headerComment
‪$headerComment
Definition: header-comment.php:38
‪$finder
‪if(PHP_SAPI !=='cli') $finder
Definition: header-comment.php:22
‪TYPO3