@@ -230,7 +230,7 @@ |
||
230 | 230 | $defaultSort = $data['column_name']; |
231 | 231 | if (count($matches == 3)){ |
232 | 232 | $defaultSortDirection = $matches[2]; |
233 | - }else{ |
|
233 | + } else{ |
|
234 | 234 | $defaultSortDirection = 'ASC'; |
235 | 235 | } |
236 | 236 | } |
@@ -50,8 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | private static function getAllPossiblePathsRec($sub_table_paths) |
52 | 52 | { |
53 | - if (count($sub_table_paths)==0) |
|
54 | - return array(); |
|
53 | + if (count($sub_table_paths)==0) { |
|
54 | + return array(); |
|
55 | + } |
|
55 | 56 | |
56 | 57 | $table_path = array_shift($sub_table_paths); |
57 | 58 | $possible_sub_paths = AmbiguityException::getAllPossiblePathsRec($sub_table_paths); |
@@ -63,9 +64,9 @@ discard block |
||
63 | 64 | { |
64 | 65 | $return_table_paths[] = array_merge(array(array('paths'=>array($path))), $possible_sub_path); |
65 | 66 | } |
67 | + } else { |
|
68 | + $return_table_paths[] = array(array('paths'=>array($path))); |
|
66 | 69 | } |
67 | - else |
|
68 | - $return_table_paths[] = array(array('paths'=>array($path))); |
|
69 | 70 | } |
70 | 71 | return $return_table_paths; |
71 | 72 | } |
@@ -31,12 +31,10 @@ discard block |
||
31 | 31 | if ($cnt==1) |
32 | 32 | { |
33 | 33 | return $this[0]->__get($var); |
34 | - } |
|
35 | - elseif ($cnt>1) |
|
34 | + } elseif ($cnt>1) |
|
36 | 35 | { |
37 | 36 | throw new TDBMException('Array contains many objects! Use getarray_'.$var.' to retrieve an array of '.$var); |
38 | - } |
|
39 | - else |
|
37 | + } else |
|
40 | 38 | { |
41 | 39 | throw new TDBMException('Array contains no objects'); |
42 | 40 | } |
@@ -47,12 +45,10 @@ discard block |
||
47 | 45 | if ($cnt==1) |
48 | 46 | { |
49 | 47 | return $this[0]->__set($var, $value); |
50 | - } |
|
51 | - elseif ($cnt>1) |
|
48 | + } elseif ($cnt>1) |
|
52 | 49 | { |
53 | 50 | throw new TDBMException('Array contains many objects! Use setarray_'.$var.' to set the array of '.$var); |
54 | - } |
|
55 | - else |
|
51 | + } else |
|
56 | 52 | { |
57 | 53 | throw new TDBMException('Array contains no objects'); |
58 | 54 | } |
@@ -77,8 +73,7 @@ discard block |
||
77 | 73 | return $this->setarray($column, $values[0]); |
78 | 74 | } elseif (count($this)==1) { |
79 | 75 | $this[0]->__call($func_name, $values); |
80 | - } |
|
81 | - else |
|
76 | + } else |
|
82 | 77 | { |
83 | 78 | throw new TDBMException("Method ".$func_name." not found"); |
84 | 79 | } |
@@ -27,12 +27,10 @@ |
||
27 | 27 | public function __construct($iterator, callable $callable) { |
28 | 28 | if (is_array($iterator)) { |
29 | 29 | $this->iterator = new \ArrayIterator($iterator); |
30 | - } |
|
31 | - elseif (!($iterator instanceof Iterator)) |
|
30 | + } elseif (!($iterator instanceof Iterator)) |
|
32 | 31 | { |
33 | 32 | throw new TDBMException("\$iterator parameter must be an instance of Iterator"); |
34 | - } |
|
35 | - else |
|
33 | + } else |
|
36 | 34 | { |
37 | 35 | $this->iterator = $iterator; |
38 | 36 | } |
@@ -693,8 +693,9 @@ |
||
693 | 693 | // Fourth, let's apply the same steps to the orderby_bag |
694 | 694 | // 4-1 orderby_bag should be an array, if it is a singleton, let's put it in an array. |
695 | 695 | |
696 | - if (!is_array($orderby_bag)) |
|
697 | - $orderby_bag = array($orderby_bag); |
|
696 | + if (!is_array($orderby_bag)) { |
|
697 | + $orderby_bag = array($orderby_bag); |
|
698 | + } |
|
698 | 699 | |
699 | 700 | // 4-2, let's take all the objects out of the orderby bag, and let's make objects from them |
700 | 701 | $orderby_bag2 = array(); |