Skip to content

Commit a34ce0a

Browse files
NGSTACK-938 fix phpstan issues
1 parent 8e43404 commit a34ce0a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Action/CheckLinter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ protected function doExecute(Config $config, IO $io, Repository $repository, Act
3333
}
3434

3535
/**
36+
* @param $directories string[]
37+
*
3638
* @return array<string, mixed>
3739
*/
3840
protected function checkLinter(array $directories, string $linterCommand): array

src/Action/CheckPrettier.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ final class CheckPrettier extends Action
2222

2323
protected function doExecute(Config $config, IO $io, Repository $repository, ActionConfig $action): void
2424
{
25+
/** @var string|string[] $extensions */
2526
$extensions = $action->getOptions()->get('extensions', ['js', 'jsx', 'ts', 'tsx', 'css', 'scss']);
2627
$excludedFiles = $action->getOptions()->get('excluded_files') ?? [];
2728
$directories = $action->getOptions()->get('directories', ['assets']);
2829
$prettierCommand = $action->getOptions()->get('prettier_command', 'pnpm prettier');
2930
$formatOptions = $action->getOptions()->get('prettier_options', '--check');
3031

3132
$finder = new Finder();
32-
$finder->in($directories)->files()->name(preg_filter('/^/', '*.', $extensions));
33+
preg_filter('/^/', '*.', $extensions);
34+
$finder->in($directories)->files()->name($extensions);
3335

3436
if ($finder->hasResults()) {
3537
$io->write(sprintf('Running %s on files:', $prettierCommand));

0 commit comments

Comments
 (0)