|
11 | 11 | use function Castor\PHPQa\phpstan; |
12 | 12 | use function Castor\run; |
13 | 13 |
|
| 14 | +const PHP_CS_FIXER_VERSION = '3.95.1'; |
| 15 | + |
14 | 16 | #[AsTask('cs:check', namespace: 'qa', description: 'Check for coding standards without fixing them')] |
15 | | -function qa_cs_check() |
| 17 | +function qa_cs_check(): void |
16 | 18 | { |
17 | | - php_cs_fixer(['fix', '--config', __DIR__ . '/.php-cs-fixer.php', '--dry-run', '--diff'], '3.92.3', [ |
| 19 | + php_cs_fixer(['fix', '--config', __DIR__ . '/.php-cs-fixer.php', '--dry-run', '--diff'], PHP_CS_FIXER_VERSION, [ |
18 | 20 | 'kubawerlos/php-cs-fixer-custom-fixers' => '^3.21', |
19 | 21 | ]); |
20 | 22 | } |
21 | 23 |
|
22 | 24 | #[AsTask('cs:fix', namespace: 'qa', description: 'Fix all coding standards', aliases: ['cs'])] |
23 | | -function qa_cs_fix() |
| 25 | +function qa_cs_fix(): void |
24 | 26 | { |
25 | | - php_cs_fixer(['fix', '--config', __DIR__ . '/.php-cs-fixer.php', '-v'], '3.92.3', [ |
| 27 | + php_cs_fixer(['fix', '--config', __DIR__ . '/.php-cs-fixer.php', '-v'], PHP_CS_FIXER_VERSION, [ |
26 | 28 | 'kubawerlos/php-cs-fixer-custom-fixers' => '^3.21', |
27 | 29 | ]); |
28 | 30 | } |
29 | 31 |
|
30 | 32 | #[AsTask('phpstan', namespace: 'qa', description: 'Run PHPStan for static analysis', aliases: ['phpstan'])] |
31 | | -function qa_phpstan(bool $generateBaseline = false) |
| 33 | +function qa_phpstan(bool $generateBaseline = false): void |
32 | 34 | { |
33 | 35 | $params = ['analyse', '--configuration', __DIR__ . '/phpstan.neon', '--memory-limit=-1', '-v']; |
34 | 36 | if ($generateBaseline) { |
35 | 37 | $params[] = '--generate-baseline'; |
36 | 38 | } |
37 | 39 |
|
38 | | - phpstan($params, '1.12.23'); |
| 40 | + phpstan($params, '2.1.51'); |
39 | 41 | } |
40 | 42 |
|
41 | 43 | #[AsTask('mapper', namespace: 'debug', description: 'Debug a mapper', aliases: ['debug'])] |
42 | | -function debug_mapper(string $source, string $target, string $load = '') |
| 44 | +function debug_mapper(string $source, string $target, string $load = ''): void |
43 | 45 | { |
44 | 46 | require_once __DIR__ . '/vendor/autoload.php'; |
45 | 47 |
|
@@ -79,13 +81,13 @@ function debug_mapper(string $source, string $target, string $load = '') |
79 | 81 | } |
80 | 82 |
|
81 | 83 | #[AsTask('install', namespace: 'doc', description: 'Install tool for documentation (need poetry)')] |
82 | | -function doc_install() |
| 84 | +function doc_install(): void |
83 | 85 | { |
84 | 86 | run('poetry install'); |
85 | 87 | } |
86 | 88 |
|
87 | 89 | #[AsTask('server', namespace: 'doc', description: 'Serve documentation')] |
88 | | -function doc_serve() |
| 90 | +function doc_serve(): void |
89 | 91 | { |
90 | 92 | run('poetry run mkdocs serve -a localhost:8000'); |
91 | 93 | } |
@@ -113,7 +115,7 @@ function build_assets(): void |
113 | 115 | } |
114 | 116 |
|
115 | 117 | #[AsTask('build-github-pages', namespace: 'doc', description: 'Serve documentation')] |
116 | | -function doc_build_github_pages() |
| 118 | +function doc_build_github_pages(): void |
117 | 119 | { |
118 | 120 | // clean .build directory |
119 | 121 | run('rm -rf ./.build', context: context()->withAllowFailure()); |
|
0 commit comments