Conditions | 6 |
Paths | 15 |
Total Lines | 22 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function interpret(string $input): void |
||
31 | { |
||
32 | $item = null; |
||
33 | $input = explode(" ", $input); |
||
34 | |||
35 | foreach ($input as $value) { |
||
36 | if (is_numeric($value)) { |
||
37 | $item = $this->depository[$value - 1]; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | foreach ($input as $value) { |
||
42 | if ($value == "album") { |
||
43 | printf("%s ", $item->getName()); |
||
44 | } |
||
45 | |||
46 | if ($value == "author") { |
||
47 | printf("%s", $item->getAuthor()); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | printf("%s", PHP_EOL); |
||
52 | } |
||
54 |