‪TYPO3CMS  ‪main
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('ext_localconf.php')
30  ->notName('ext_tables.php')
31  ->notName('ext_emconf.php')
32  // ClassAliasMap files do not need header comments
33  ->notName('ClassAliasMap.php')
34  // CodeSnippets and Examples in Documentation do not need header comments
35  ->exclude('Documentation')
36  // Third-party inclusion files should not have a changed comment
37  ->notName('Rfc822AddressesParser.php')
38  ->notName('ClassMapGenerator.php')
39 ;
40 
41 ‪$headerComment = <<<COMMENT
42 This file is part of the ‪TYPO3 CMS project.
43 
44 It is free software; you can redistribute it and/or modify it under
45 the terms of the GNU General Public License, either version 2
46 of the License, or any later version.
47 
48 For the full copyright and license information, please read the
49 LICENSE.txt file that was distributed with this source code.
50 
51 The ‪TYPO3 project - inspiring people to share!
52 COMMENT;
53 
54 return (new \PhpCsFixer\Config())
55  ->setRiskyAllowed(false)
56  ->setRules([
57  'no_extra_blank_lines' => true,
58  'header_comment' => [
59  'header' => ‪$headerComment,
60  'comment_type' => 'comment',
61  'separate' => 'both',
62  'location' => 'after_declare_strict',
63  ],
64  ])
65  ->setFinder(‪$finder);
‪$headerComment
‪$headerComment
Definition: header-comment.php:41
‪$finder
‪if(PHP_SAPI !=='cli') $finder
Definition: header-comment.php:22
‪TYPO3