Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of PHPUnit.
4
 *
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PHPUnit\Util\PHP;
11
 
12
use const PHP_MAJOR_VERSION;
13
use function tmpfile;
14
use PHPUnit\Framework\Exception;
15
 
16
/**
17
 * @internal This class is not covered by the backward compatibility promise for PHPUnit
18
 *
19
 * @see https://bugs.php.net/bug.php?id=51800
20
 */
21
final class WindowsPhpProcess extends DefaultPhpProcess
22
{
23
    public function getCommand(array $settings, string $file = null): string
24
    {
25
        if (PHP_MAJOR_VERSION < 8) {
26
            return '"' . parent::getCommand($settings, $file) . '"';
27
        }
28
 
29
        return parent::getCommand($settings, $file);
30
    }
31
 
32
    /**
33
     * @throws Exception
34
     */
35
    protected function getHandles(): array
36
    {
37
        if (false === $stdout_handle = tmpfile()) {
38
            throw new Exception(
39
                'A temporary file could not be created; verify that your TEMP environment variable is writable'
40
            );
41
        }
42
 
43
        return [
44
            1 => $stdout_handle,
45
        ];
46
    }
47
 
48
    protected function useTemporaryFile(): bool
49
    {
50
        return true;
51
    }
52
}