for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\Yii\Debug\Api\Inspector\Command;
use Symfony\Component\Process\Process;
use Yiisoft\Aliases\Aliases;
class PsalmCommand
{
public function __construct(private Aliases $aliases)
}
public function run()
$projectDirectory = $this->aliases->get('@root');
$debugDirectory = $this->aliases->get('@runtime/debug');
$outputFilePath = $debugDirectory . DIRECTORY_SEPARATOR . 'psalm-report.json';
$params = [
'vendor/bin/psalm',
'--report=' . $outputFilePath,
];
$process = new Process($params);
$process
->setWorkingDirectory($projectDirectory)
->setTimeout(null)
->run();
return json_decode(
file_get_contents($outputFilePath),
true
);