File: PhpOptions.php

package info (click to toggle)
php-composer-xdebug-handler 3.0.5-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: php: 2,501; makefile: 18
file content (99 lines) | stat: -rw-r--r-- 1,907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php

declare(strict_types=1);

/*
 * This file is part of composer/xdebug-handler.
 *
 * (c) Composer <https://github.com/composer>
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Composer\XdebugHandler\Tests\App\Framework;

class PhpOptions
{
    /** @var list<string> */
    private $phpArgs = [];
    /** @var list<string> */
    private $scriptArgs = [];
    /** @var array<string, string> */
    private $envs = [];
    /** @var bool */
    private $stdin = false;
    /** @var bool */
    private $passthru = false;

    /**
     * @return list<string>
     */
    public function getPhpArgs(): array
    {
        return $this->phpArgs;
    }

    /**
     * @return list<string>
     */
    public function getScriptArgs(): array
    {
        return $this->scriptArgs;
    }

    /**
     * @return array<string, string>
     */
    public function getEnvs(): array
    {
        return $this->envs;
    }

    public function getStdin(): bool
    {
        return $this->stdin;
    }

    public function getPassthru(): bool
    {
        return $this->passthru;
    }

    /**
     *
     * @param string ...$phpArgs
     */
    public function addPhpArgs(...$phpArgs): void
    {
        foreach ($phpArgs as $item) {
            $this->phpArgs[] = $item;
        }
    }

    /**
     *
     * @param string ...$scriptArgs
     */
    public function addScriptArgs(...$scriptArgs): void
    {
        foreach ($scriptArgs as $item) {
            $this->scriptArgs[] = $item;
        }
    }

    public function addEnv(string $name, string $value): void
    {
        $this->envs[$name] = $value;
    }

    public function setPassthru(bool $value): void
    {
        $this->passthru = $value;
    }

    public function setStdin(bool $value): void
    {
        $this->stdin = $value;
    }
}