-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathcastor.php
More file actions
38 lines (30 loc) · 769 Bytes
/
castor.php
File metadata and controls
38 lines (30 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
* This file is part of the GifExceptionBundle project.
*
* (c) JoliCode <coucou@jolicode.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Castor\Attribute\AsTask;
use function Castor\run;
#[AsTask(description: 'Fix CS', aliases: ['cs'])]
function cs(bool $dryRun = false): void
{
$command = 'vendor/bin/php-cs-fixer fix --verbose';
if ($dryRun) {
$command .= ' --dry-run';
}
run($command);
}
#[AsTask(description: 'Run the test suite')]
function test(): void
{
run('vendor/bin/simple-phpunit');
}
#[AsTask(description: 'Run static analysis')]
function phpstan(): void
{
run('vendor/bin/phpstan analyse -c phpstan.neon');
}