Merge branch '6.4' into 7.2

* 6.4:
  -
  CS fixes
This commit is contained in:
Nicolas Grekas
2025-07-10 10:21:57 +02:00
3 changed files with 4 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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).')';

View File

@@ -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');
}