|
10 | 10 | * For the full copyright and license information, please view |
11 | 11 | * the LICENSE file that was distributed with this source code. |
12 | 12 | */ |
13 | | - |
| 13 | +use Boundwize\StructArmed\Rule\Rules\Function_\MustHaveReturnTypeFunctionRule; |
| 14 | +use Boundwize\StructArmed\Preset\Presets\CodeQualityPreset; |
14 | 15 | use CodeIgniter\Cache\ResponseCache; |
15 | 16 | use CodeIgniter\HTTP\CLIRequest; |
16 | 17 | use CodeIgniter\HTTP\Header; |
|
47 | 48 | __DIR__ . '/tests/system/Config/fixtures', |
48 | 49 | ], |
49 | 50 | __DIR__ . '/system/ThirdParty', |
| 51 | + CodeQualityPreset::ANONYMOUS_FUNCTIONS_MUST_BE_STATIC => [ |
| 52 | + __DIR__ . '/system/View/Cells/Cell.php', |
| 53 | + ], |
50 | 54 | ]) |
51 | 55 | ->cacheDirectory(is_dir('/tmp') ? '/tmp/structarmed' : null) |
52 | | - ->withPreset(Preset::PSR4()) |
| 56 | + ->withPresets(Preset::PSR4(), Preset::CODEQUALITY()) |
| 57 | + |
| 58 | + ->layer('Helpers', __DIR__ . '/system/Helpers') |
| 59 | + ->rule('helpers.functions_must_have_return_type', new MustHaveReturnTypeFunctionRule('Helpers')) |
| 60 | + |
53 | 61 | // Resolve CodeIgniter layers from class names because several layers share directories. |
54 | 62 | ->layerPattern('API', '/^CodeIgniter\\\\API\\\\.*$/') |
55 | 63 | ->layerPattern('Cache', '/^CodeIgniter\\\\Cache\\\\.*$/') |
|
112 | 120 | 'Security' => ['Cookie', 'HTTP', 'I18n', 'Session'], |
113 | 121 | 'Session' => ['Cookie', 'Database', 'HTTP', 'I18n'], |
114 | 122 | 'Throttle' => ['Cache', 'I18n'], |
115 | | - 'Validation' => ['Database', 'HTTP', 'I18n', 'Input'], |
| 123 | + 'Validation' => ['Database', 'HTTP', 'Helpers', 'I18n', 'Input'], |
116 | 124 | 'View' => ['Cache'], |
117 | 125 | ]) |
118 | 126 | ->skipPathsForRuleset(['*test*']) |
|
0 commit comments