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