-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Replace Psalm to PHPStan #155
Changes from all commits
e435cf1
17bf899
16869a7
e71aa7e
3be59b3
61ced77
f545127
0e27182
78c7f09
3859d79
771dc2b
954c48f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parameters: | ||
level: 10 | ||
paths: | ||
- src | ||
ignoreErrors: | ||
- identifier: missingType.iterableValue | ||
|
||
includes: | ||
- phar://phpstan.phar/conf/bleedingEdge.neon |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,8 @@ | |
]; | ||
|
||
/** | ||
* @var callable|null A PHP callback, which should be invoked to check whether asset conversion result is outdated. | ||
* @var callable|null A PHP callback, which should be invoked to check whether asset conversion result is | ||
* outdated. | ||
* | ||
* @psalm-var IsOutdatedCallback|null | ||
*/ | ||
|
@@ -57,9 +58,9 @@ | |
/** | ||
* @param Aliases $aliases The aliases instance. | ||
* @param LoggerInterface $logger The logger instance. | ||
* @param array $commands The commands that are used to perform the asset conversion. | ||
* The keys are the asset file extension names, and the values are the corresponding | ||
* target script types (either "css" or "js") and the commands used for the conversion. | ||
* @param array $commands The commands that are used to perform the asset | ||
* conversion. The keys are the asset file extension names, and the values are the corresponding target script types | ||
* (either "css" or "js") and the commands used for the conversion. | ||
* | ||
* You may also use a {@link https://github.com/yiisoft/docs/blob/master/guide/en/concept/aliases.md} | ||
* to specify the location of the command: | ||
|
@@ -78,16 +79,16 @@ | |
private readonly Aliases $aliases, | ||
private readonly LoggerInterface $logger, | ||
array $commands = [], | ||
private bool $forceConvert = false, | ||
Check warning on line 82 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
) { | ||
$this->commands = array_merge($this->commands, $commands); | ||
Check warning on line 84 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
Check warning on line 84 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
} | ||
|
||
public function convert(string $asset, string $basePath, array $optionsConverter = []): string | ||
{ | ||
$pos = strrpos($asset, '.'); | ||
|
||
if ($pos !== false) { | ||
Check warning on line 91 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
$srcExt = substr($asset, $pos + 1); | ||
|
||
$commandOptions = $this->buildConverterOptions($srcExt, $optionsConverter); | ||
|
@@ -252,7 +253,7 @@ | |
|
||
$command = $this->aliases->get($command); | ||
|
||
$command = strtr($command, [ | ||
Check warning on line 256 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
'{options}' => $options, | ||
'{from}' => escapeshellarg("$basePath/$asset"), | ||
'{to}' => escapeshellarg("$basePath/$result"), | ||
|
@@ -266,10 +267,14 @@ | |
$pipes = []; | ||
|
||
$proc = proc_open($command, $descriptors, $pipes, $basePath); | ||
/** | ||
* @var resource $proc | ||
* @var resource[] $pipes | ||
*/ | ||
|
||
$stdout = stream_get_contents($pipes[1]); | ||
Check warning on line 275 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
|
||
$stderr = stream_get_contents($pipes[2]); | ||
Check warning on line 277 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
|
||
foreach ($pipes as $pipe) { | ||
fclose($pipe); | ||
|
@@ -277,8 +282,8 @@ | |
|
||
$status = proc_close($proc); | ||
|
||
if ($status === 0) { | ||
Check warning on line 285 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
Check warning on line 285 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
$this->logger->debug( | ||
Check warning on line 286 in src/AssetConverter.php GitHub Actions / mutation / PHP 8.3-ubuntu-latest
|
||
"Converted $asset into $result:\nSTDOUT:\n$stdout\nSTDERR:\n$stderr", | ||
[__METHOD__] | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it missing with phpstan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't found shepherd analog for PHPStan.