Conditions | 6 |
Paths | 15 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function interpret(string $input): void |
||
40 | { |
||
41 | $input = explode(" ", $input); |
||
42 | |||
43 | foreach ($input as $value) { |
||
44 | if (is_numeric($value)) { |
||
45 | $item = $this->depository->getItems()[$value - 1]; |
||
46 | } |
||
47 | } |
||
48 | |||
49 | foreach ($input as $value) { |
||
50 | if ($value == "album") { |
||
51 | printf("%s ", $item->getAlbum()); |
||
|
|||
52 | } |
||
53 | |||
54 | if ($value == "author") { |
||
55 | printf("%s", $item->getAuthor()); |
||
56 | } |
||
57 | } |
||
58 | |||
59 | printf("%s", PHP_EOL); |
||
60 | } |
||
62 |