for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace PhpCfdi\RfcLinc\Util;
class ShellWhich
{
public function __invoke(string $executable): string
$output = [];
$return = -1;
exec('which ' . escapeshellarg($executable), $output, $return);
if (0 !== (int) $return) {
return '';
}
$count = count($output);
if (0 === $count) {
return $output[$count - 1];