Skip to content

Commit

Permalink
chore: castor synchronize withe Makefile + test v0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
COil committed Nov 27, 2024
1 parent 73b4cc0 commit e036a4a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions castor.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// Until the 1.x Castor version the API may be unstable
// this script was tested with Castor 0.18.2
// this script was tested with Castor 0.21.0

declare(strict_types=1);

Expand Down Expand Up @@ -124,10 +124,10 @@ function cov_report(): void
success(exit_code('open var/coverage/index.html'));
}

#[AsTask(namespace: 'cs', description: 'Run PHPStan', aliases: ['stan'])]
#[AsTask(namespace: 'lint', description: 'Run PHPStan', aliases: ['stan'])]
function stan(): int
{
title('cs:stan');
title('lint:stan');

if (!file_exists('var/cache/dev/App_KernelDevDebugContainer.xml')) {
io()->note('PHPStan needs the dev/debug cache. Generating it...');
Expand All @@ -139,10 +139,10 @@ function stan(): int
return exit_code('vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 1G -vv');
}

#[AsTask(namespace: 'cs', description: 'Fix PHP files with php-cs-fixer (ignore PHP 8.2 warning)', aliases: ['fix-php'])]
#[AsTask(namespace: 'fix', description: 'Fix PHP files with php-cs-fixer (ignore PHP 8.2 warning)', aliases: ['fix-php'])]
function fix_php(): int
{
title('cs:fix-php');
title('fix:fix-php');
$ec = exit_code('vendor/bin/php-cs-fixer fix',
context: context()->withEnvironment(['PHP_CS_FIXER_IGNORE_ENV' => 1])
);
Expand Down Expand Up @@ -248,6 +248,10 @@ function ci(): void
function versions(): void
{
title('helpers:versions');
io()->note('Castor');
run('castor --version');
io()->newLine();

io()->note('PHP');
run('php -v');
io()->newLine();
Expand Down

0 comments on commit e036a4a

Please sign in to comment.