1 | <?php |
||
10 | class Output |
||
11 | { |
||
12 | /** |
||
13 | * @var Client |
||
14 | */ |
||
15 | private $client; |
||
16 | |||
17 | /** |
||
18 | * @param Client $client |
||
19 | */ |
||
20 | public function __construct(Client $client) |
||
24 | |||
25 | /** |
||
26 | * @param string $id |
||
27 | * @param string|null $node |
||
28 | * @param string|null $step |
||
29 | * @param array $params |
||
30 | * @return PromiseInterface |
||
31 | */ |
||
32 | public function output(string $id, string $node = null, string $step = null, array $params = []): PromiseInterface |
||
33 | { |
||
34 | if ($node && $step) { |
||
35 | $path = sprintf('/execution/%s/output/node/%s/step/%s', urlencode($id), urlencode($node), urlencode($step)); |
||
36 | } elseif ($node && !$step) { |
||
37 | $path = sprintf('/execution/%s/output/node/%s', urlencode($id), urlencode($node)); |
||
38 | } elseif (!$node && $step) { |
||
39 | $path = sprintf('/execution/%s/output/step/%s', urlencode($id), urlencode($step)); |
||
40 | } else { |
||
41 | $path = sprintf('/execution/%s/output', urlencode($id)); |
||
42 | } |
||
43 | |||
44 | return $this->client->getConfiguration()->getGuzzle()->sendAsync( |
||
45 | new Request('GET', $this->client->getConfiguration()->getBaseUri() . $path, [], $this->client->getConfiguration()->getFormat()->formatParams($params)) |
||
46 | ); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param string $id |
||
51 | * @param bool $stateOnly |
||
52 | * @return PromiseInterface |
||
53 | */ |
||
54 | public function outputWithState(string $id, bool $stateOnly = false): PromiseInterface |
||
60 | } |
||
61 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: