@@ -66,7 +66,7 @@ |
||
66 | 66 | 'target' => $this->target, |
67 | 67 | 'readOnly' => $this->readOnly, |
68 | 68 | 'comment' => $this->comment, |
69 | - ], function ($v) { |
|
69 | + ], function($v) { |
|
70 | 70 | return null !== $v; |
71 | 71 | }); |
72 | 72 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | 'target' => $this->target, |
67 | 67 | 'readOnly' => $this->readOnly, |
68 | 68 | 'comment' => $this->comment, |
69 | - ], function ($v) { |
|
69 | + ], function($v) { |
|
70 | 70 | return null !== $v; |
71 | 71 | }); |
72 | 72 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $this->parser = new Parser(); |
39 | 39 | $this->dumper = new Dumper(); |
40 | - $this->path = __DIR__.'/Fixtures'; |
|
40 | + $this->path = __DIR__ . '/Fixtures'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | protected function tearDown() |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | |
76 | 76 | public function testSpecifications() |
77 | 77 | { |
78 | - $files = $this->parser->parse(file_get_contents($this->path.'/index.yml')); |
|
78 | + $files = $this->parser->parse(file_get_contents($this->path . '/index.yml')); |
|
79 | 79 | foreach ($files as $file) { |
80 | - $yamls = file_get_contents($this->path.'/'.$file.'.yml'); |
|
80 | + $yamls = file_get_contents($this->path . '/' . $file . '.yml'); |
|
81 | 81 | |
82 | 82 | // split YAMLs documents |
83 | 83 | foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } elseif (isset($test['todo']) && $test['todo']) { |
92 | 92 | // TODO |
93 | 93 | } else { |
94 | - eval('$expected = '.trim($test['php']).';'); |
|
94 | + eval('$expected = ' . trim($test['php']) . ';'); |
|
95 | 95 | $this->assertSame($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']); |
96 | 96 | } |
97 | 97 | } |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | |
231 | 231 | public function testBinaryDataIsDumpedBase64Encoded() |
232 | 232 | { |
233 | - $binaryData = file_get_contents(__DIR__.'/Fixtures/arrow.gif'); |
|
234 | - $expected = '{ data: !!binary '.base64_encode($binaryData).' }'; |
|
233 | + $binaryData = file_get_contents(__DIR__ . '/Fixtures/arrow.gif'); |
|
234 | + $expected = '{ data: !!binary ' . base64_encode($binaryData) . ' }'; |
|
235 | 235 | |
236 | 236 | $this->assertSame($expected, $this->dumper->dump(array('data' => $binaryData))); |
237 | 237 | } |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | ), |
382 | 382 | ); |
383 | 383 | |
384 | - $this->assertSame(file_get_contents(__DIR__.'/Fixtures/multiple_lines_as_literal_block.yml'), $this->dumper->dump($data, 2, 0, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)); |
|
384 | + $this->assertSame(file_get_contents(__DIR__ . '/Fixtures/multiple_lines_as_literal_block.yml'), $this->dumper->dump($data, 2, 0, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | public function testDumpMultiLineStringAsScalarBlockWhenFirstLineHasLeadingSpace() |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | ), |
393 | 393 | ); |
394 | 394 | |
395 | - $this->assertSame(file_get_contents(__DIR__.'/Fixtures/multiple_lines_as_literal_block_leading_space_in_first_line.yml'), $this->dumper->dump($data, 2, 0, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)); |
|
395 | + $this->assertSame(file_get_contents(__DIR__ . '/Fixtures/multiple_lines_as_literal_block_leading_space_in_first_line.yml'), $this->dumper->dump($data, 2, 0, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | public function testCarriageReturnIsMaintainedWhenDumpingAsMultiLineLiteralBlock() |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | if ($input instanceof CommentedItem) { |
62 | 62 | //$comment = $input->getComment(); |
63 | - $output = '# '.$input->getComment()."\n"; |
|
63 | + $output = '# ' . $input->getComment() . "\n"; |
|
64 | 64 | $input = $input->getItem(); |
65 | 65 | } else { |
66 | 66 | //$comment = null; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | if ($inline <= 0 || (!\is_array($input) && $dumpObjectAsInlineMap) || empty($input)) { |
79 | - $output .= $prefix.Inline::dump($input, $flags); |
|
79 | + $output .= $prefix . Inline::dump($input, $flags); |
|
80 | 80 | } else { |
81 | 81 | $dumpAsMap = Inline::isHash($input); |
82 | 82 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // If the first line starts with a space character, the spec requires a blockIndicationIndicator |
93 | 93 | // http://www.yaml.org/spec/1.2/spec.html#id2793979 |
94 | 94 | $blockIndentationIndicator = (' ' === substr($value, 0, 1)) ? (string) $this->indentation : ''; |
95 | - $output .= sprintf("%s%s%s |%s\n", $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator); |
|
95 | + $output .= sprintf("%s%s%s |%s\n", $prefix, $dumpAsMap ? Inline::dump($key, $flags) . ':' : '-', '', $blockIndentationIndicator); |
|
96 | 96 | |
97 | 97 | $pregSplit = preg_split('/\n|\r\n/', $value); |
98 | 98 | if ($pregSplit === false) { |
@@ -119,10 +119,10 @@ discard block |
||
119 | 119 | $output .= sprintf( |
120 | 120 | '%s%s%s%s', |
121 | 121 | $prefix, |
122 | - $dumpAsMap ? Inline::dump($key, $flags).':' : '-', |
|
122 | + $dumpAsMap ? Inline::dump($key, $flags) . ':' : '-', |
|
123 | 123 | $willBeInlined ? ' ' : "\n", |
124 | 124 | $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags) |
125 | - ).($willBeInlined ? "\n" : ''); |
|
125 | + ) . ($willBeInlined ? "\n" : ''); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function __construct() |
66 | 66 | { |
67 | - $this->validatorSchema = \GuzzleHttp\json_decode((string)file_get_contents(__DIR__ . '/ServiceJsonSchema.json'), false); |
|
67 | + $this->validatorSchema = \GuzzleHttp\json_decode((string) file_get_contents(__DIR__ . '/ServiceJsonSchema.json'), false); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $r = $resources['requests']; |
108 | 108 | $service->requestMemory = $r['memory'] ?? null; |
109 | 109 | $service->requestCpu = $r['cpu'] ?? null; |
110 | - $service->requestStorage= $r['storage'] ?? null; |
|
110 | + $service->requestStorage = $r['storage'] ?? null; |
|
111 | 111 | } |
112 | 112 | if (isset($resources['limits'])) { |
113 | 113 | $l = $resources['limits']; |
@@ -128,13 +128,12 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function jsonSerialize(): array |
130 | 130 | { |
131 | - $labelMap = function (CommentedItem $commentedItem): array { |
|
131 | + $labelMap = function(CommentedItem $commentedItem): array { |
|
132 | 132 | return null === $commentedItem->getComment() ? |
133 | - ['value' => $commentedItem->getItem()] : |
|
134 | - ['value' => $commentedItem->getItem(), 'comment' => $commentedItem->getComment()]; |
|
133 | + ['value' => $commentedItem->getItem()] : ['value' => $commentedItem->getItem(), 'comment' => $commentedItem->getComment()]; |
|
135 | 134 | }; |
136 | 135 | |
137 | - $jsonSerializeMap = function (\JsonSerializable $obj): array { |
|
136 | + $jsonSerializeMap = function(\JsonSerializable $obj): array { |
|
138 | 137 | return $obj->jsonSerialize(); |
139 | 138 | }; |
140 | 139 | |
@@ -433,7 +432,7 @@ discard block |
||
433 | 432 | 'source' => $source, |
434 | 433 | 'target' => $target, |
435 | 434 | 'comment' => $comment, |
436 | - ], function ($v) { |
|
435 | + ], function($v) { |
|
437 | 436 | return null !== $v; |
438 | 437 | }); |
439 | 438 | } |
@@ -584,7 +583,7 @@ discard block |
||
584 | 583 | |
585 | 584 | private function removeVolumesByType(string $type): void |
586 | 585 | { |
587 | - $filterFunction = function (Volume $vol) use ($type) { |
|
586 | + $filterFunction = function(Volume $vol) use ($type) { |
|
588 | 587 | return $vol->getType() !== $type; |
589 | 588 | }; |
590 | 589 | $this->volumes = array_values(array_filter($this->volumes, $filterFunction)); |
@@ -607,7 +606,7 @@ discard block |
||
607 | 606 | |
608 | 607 | public function removeVolumesBySource(string $source): void |
609 | 608 | { |
610 | - $filterFunction = function (Volume $vol) use ($source) { |
|
609 | + $filterFunction = function(Volume $vol) use ($source) { |
|
611 | 610 | return $vol->getSource() !== $source; |
612 | 611 | }; |
613 | 612 | $this->volumes = array_values(array_filter($this->volumes, $filterFunction)); |