Skip to content

Commit

Permalink
Fixes installation of tool, update to phpstan2, migration castor script
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx committed Nov 22, 2024
1 parent 7226cd0 commit aadd54e
Show file tree
Hide file tree
Showing 8 changed files with 950 additions and 215 deletions.
1 change: 1 addition & 0 deletions jolinotif
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ final class Cli

public function __construct()
{
// @phpstan-ignore offsetAccess.nonOffsetAccessible,assign.propertyType
$this->command = $_SERVER['argv'][0];
}

Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
- jolinotif
tmpDir: 'var/phpstan/tmp'
inferPrivatePropertyTypeFromConstructor: true
checkGenericClassInNonGenericObjectType: false
# checkGenericClassInNonGenericObjectType: false
excludePaths:
analyse: []
ignoreErrors:
Expand Down
10 changes: 7 additions & 3 deletions tools/php-cs-fixer/castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@

use Castor\Attribute\AsTask;

use function Castor\context;
use function Castor\exit_code;
use function Castor\run;

#[AsTask(description: 'Fix CS', aliases: ['cs'])]
function cs(bool $dryRun = false): int
{
if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
install();
}

$command = [
__DIR__ . '/vendor/bin/php-cs-fixer',
'fix',
Expand All @@ -34,12 +39,11 @@ function cs(bool $dryRun = false): int
#[AsTask(description: 'install dependencies')]
function install(): void
{
run(['composer', 'install'], workingDirectory: __DIR__);
run(['composer', 'install'], context: context()->withWorkingDirectory(__DIR__));
}

#[AsTask(description: 'Update dependencies')]
function update(): void
{
run(['composer', 'update'], workingDirectory: __DIR__);
run(['composer', 'bump'], workingDirectory: __DIR__);
run(['composer', 'update'], context: context()->withWorkingDirectory(__DIR__));
}
5 changes: 3 additions & 2 deletions tools/php-cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"require": {
"friendsofphp/php-cs-fixer": "^3.54.0"
"friendsofphp/php-cs-fixer": "^3.64.0"
},
"config": {
"bump-after-update": true,
"platform": {
"php": "8.1"
"php": "8.2"
}
}
}
Loading

0 comments on commit aadd54e

Please sign in to comment.