Total Complexity | 14 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | trait App |
||
8 | { |
||
9 | |||
10 | public function runBeforeComma() |
||
19 | } |
||
20 | |||
21 | |||
22 | public function runAfterComma() |
||
23 | { |
||
24 | $class = $this->detectClass($this->after_comma_len); |
||
25 | $methodName = 'Class' . $class; |
||
26 | if(method_exists($this,$methodName)) |
||
27 | { |
||
28 | return $this->$methodName($this->after_comma_array,$this->after_comma_len); |
||
29 | } |
||
30 | return 'عفوا هذا الرقم خارج نطاقنا حاليا حاول لاحقاً'; |
||
31 | } |
||
32 | |||
33 | |||
34 | public function detectClass($len) |
||
66 | |||
67 | } |
||
69 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: