Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: QA packages upgrade (cs/phpstan) + fix #595

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading