mirror of
https://github.com/symfony/process.git
synced 2026-03-23 23:42:06 +01:00
Merge branch '6.4' into 7.2
* 6.4: - CS fixes
This commit is contained in:
@@ -72,7 +72,7 @@ class ExecutableFinder
|
||||
$pathExt = getenv('PATHEXT');
|
||||
$suffixes = array_merge($suffixes, $pathExt ? explode(\PATH_SEPARATOR, $pathExt) : ['.exe', '.bat', '.cmd', '.com']);
|
||||
}
|
||||
$suffixes = '' !== pathinfo($name, PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']);
|
||||
$suffixes = '' !== pathinfo($name, \PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']);
|
||||
foreach ($suffixes as $suffix) {
|
||||
foreach ($dirs as $dir) {
|
||||
if ('' === $dir) {
|
||||
|
||||
@@ -1584,7 +1584,7 @@ class Process implements \IteratorAggregate
|
||||
|
||||
if (!$comSpec && $comSpec = (new ExecutableFinder())->find('cmd.exe')) {
|
||||
// Escape according to CommandLineToArgvW rules
|
||||
$comSpec = '"'.preg_replace('{(\\\\*+)"}', '$1$1\"', $comSpec) .'"';
|
||||
$comSpec = '"'.preg_replace('{(\\\\*+)"}', '$1$1\"', $comSpec).'"';
|
||||
}
|
||||
|
||||
$cmd = ($comSpec ?? 'cmd').' /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')';
|
||||
|
||||
@@ -174,7 +174,7 @@ class ExecutableFinderTest extends TestCase
|
||||
*/
|
||||
public function testEmptyDirInPath()
|
||||
{
|
||||
putenv(sprintf('PATH=%s%s', \dirname(\PHP_BINARY), \PATH_SEPARATOR));
|
||||
putenv(\sprintf('PATH=%s%s', \dirname(\PHP_BINARY), \PATH_SEPARATOR));
|
||||
|
||||
try {
|
||||
touch('executable');
|
||||
@@ -183,7 +183,7 @@ class ExecutableFinderTest extends TestCase
|
||||
$finder = new ExecutableFinder();
|
||||
$result = $finder->find('executable');
|
||||
|
||||
$this->assertSame(sprintf('.%sexecutable', \DIRECTORY_SEPARATOR), $result);
|
||||
$this->assertSame(\sprintf('.%sexecutable', \DIRECTORY_SEPARATOR), $result);
|
||||
} finally {
|
||||
unlink('executable');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user