Skip to content

Commit

Permalink
chore: QA packages upgrade (cs/phpstan) + fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoD02 authored and pyrech committed Dec 30, 2024
1 parent 3dbf4cf commit 8540dc8
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 70 deletions.
7 changes: 3 additions & 4 deletions src/Console/Command/TaskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
use Symfony\Component\DependencyInjection\Attribute\Exclude;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Filesystem\Filesystem;
use function Castor\context;

/** @internal */
#[Exclude]
Expand Down Expand Up @@ -264,15 +263,15 @@ private function getSuggestedValues(AsArgument|AsOption $attribute): array|\Clos

// If the currently typed value is not an absolute path, we will suggest items in the root directory
if (!$this->fs->isAbsolutePath($value)) {
$path = PathHelper::getRoot() . DIRECTORY_SEPARATOR . $value;
$path = PathHelper::getRoot() . \DIRECTORY_SEPARATOR . $value;
}

// If the typed value exists and is a directory, we will suggest items in that directory
if ($this->fs->exists($path) && is_dir($path) && is_readable($path) && !str_ends_with($value, '.')) {
return $this->getPathSuggestions($path, rtrim($value, '/\\') . DIRECTORY_SEPARATOR);
return $this->getPathSuggestions($path, rtrim($value, '/\\') . \DIRECTORY_SEPARATOR);
}

$parentDir = dirname($path);
$parentDir = \dirname($path);

// If the "parent directory" of the currently typed value does not exist, there is nothing to suggest
if (!$this->fs->exists($parentDir) || !is_dir($parentDir) || !is_readable($parentDir)) {
Expand Down
6 changes: 3 additions & 3 deletions tests/AutocompleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ public function testPathCompletion(\Closure $function, array $input, array $expe

$suggestions = $tester->complete($input);

$message = sprintf('%s - Suggestions: %s',
$message = \sprintf('%s - Suggestions: %s',
(new \ReflectionFunction($function))->getName(),
implode(', ', $suggestions)
);

if ($exactExpectations) {
$this->assertCount(count($expectedItems), $suggestions, $message);
$this->assertCount(\count($expectedItems), $suggestions, $message);
$this->assertSame($expectedItems, $suggestions, $message);

return;
}

$this->assertCount(count($expectedItems), array_intersect($suggestions, $expectedItems), $message);
$this->assertCount(\count($expectedItems), array_intersect($suggestions, $expectedItems), $message);
}

public function providePathCompletionTests(): \Generator
Expand Down
2 changes: 1 addition & 1 deletion tools/php-cs-fixer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "project",
"license": "MIT",
"require": {
"friendsofphp/php-cs-fixer": "^3.64.0"
"friendsofphp/php-cs-fixer": "^3.65.0"
},
"config": {
"bump-after-update": true,
Expand Down
102 changes: 51 additions & 51 deletions tools/php-cs-fixer/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/phpstan/castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function phpstan(bool $generateBaseline = false): int
}

$command = [
__DIR__ . '/vendor/bin/phpstan', '-v',
__DIR__ . '/vendor/bin/phpstan', '-v', '--memory-limit=512M',
];

if ($generateBaseline) {
Expand Down
2 changes: 1 addition & 1 deletion tools/phpstan/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "project",
"license": "MIT",
"require": {
"phpstan/phpstan": "^1.12.11"
"phpstan/phpstan": "^1.12.13"
},
"config": {
"bump-after-update": true,
Expand Down
Loading

0 comments on commit 8540dc8

Please sign in to comment.