Conditions | 5 |
Paths | 5 |
Total Lines | 24 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
1 | #!/usr/bin/php |
||
25 | private function parseResult($args) |
||
26 | { |
||
27 | // Just a single ayah is return. No need to parse anything. |
||
28 | if(is_string($args)) return $args . "\n"; |
||
29 | |||
30 | // Multiple ayah/one surah or multiple surah/one ayah. Not both. |
||
31 | if(is_string(current($args))) return $this->buildAyah($args); |
||
32 | |||
33 | // Both multiple ayah and multiple surah. |
||
34 | $count = 0; |
||
35 | $result = "\n"; |
||
36 | |||
37 | foreach($args as $translation => $aya) { |
||
38 | |||
39 | $result .= strtoupper($translation) . "\n" . str_repeat('=', strlen($translation) + 2) . "\n\n"; |
||
40 | $result .= $this->buildAyah($aya); |
||
41 | |||
42 | ++$count; |
||
43 | if( $count < sizeof($args) ) $result .= "\n\n"; |
||
44 | } |
||
45 | |||
46 | return $result; |
||
47 | |||
48 | } |
||
49 | |||
63 |