@@ -46,8 +46,9 @@ discard block |
||
46 | 46 | Clause::LIMIT |
47 | 47 | ] as $clause |
48 | 48 | ) { |
49 | - if($this->clause($clause) === null) |
|
50 | - continue; |
|
49 | + if($this->clause($clause) === null) { |
|
50 | + continue; |
|
51 | + } |
|
51 | 52 | |
52 | 53 | $ret .= ' ' . $this->clause($clause); |
53 | 54 | } |
@@ -78,8 +79,9 @@ discard block |
||
78 | 79 | */ |
79 | 80 | public function selectAlso(array $setter): self |
80 | 81 | { |
81 | - if (empty($setter)) |
|
82 | - throw new \InvalidArgumentException('EMPTY_SETTER_ARRAY'); |
|
82 | + if (empty($setter)) { |
|
83 | + throw new \InvalidArgumentException('EMPTY_SETTER_ARRAY'); |
|
84 | + } |
|
83 | 85 | |
84 | 86 | foreach ($setter as $alias => $column) { |
85 | 87 | |
@@ -110,8 +112,7 @@ discard block |
||
110 | 112 | if($this->clause(Clause::JOINS) === null){ |
111 | 113 | $joins = new Joins([$join]); |
112 | 114 | $this->add($joins); |
113 | - } |
|
114 | - else{ |
|
115 | + } else{ |
|
115 | 116 | $this->clause(Clause::JOINS)->add($join); |
116 | 117 | } |
117 | 118 |
@@ -14,10 +14,11 @@ |
||
14 | 14 | |
15 | 15 | if ($predicates !== null) { |
16 | 16 | foreach ($predicates as $predicate) { |
17 | - if (is_string($predicate)) |
|
18 | - $this->and($predicate); |
|
19 | - else |
|
20 | - $this->and($predicate, $predicate->bindings()); |
|
17 | + if (is_string($predicate)) { |
|
18 | + $this->and($predicate); |
|
19 | + } else { |
|
20 | + $this->and($predicate, $predicate->bindings()); |
|
21 | + } |
|
21 | 22 | } |
22 | 23 | } |
23 | 24 | } |
@@ -72,8 +72,9 @@ discard block |
||
72 | 72 | $this->statement = $statement; |
73 | 73 | } |
74 | 74 | |
75 | - if ($this->statement instanceof \PDOStatement) |
|
76 | - $this->prepared = $this->statement; |
|
75 | + if ($this->statement instanceof \PDOStatement) { |
|
76 | + $this->prepared = $this->statement; |
|
77 | + } |
|
77 | 78 | |
78 | 79 | $this->run($bindings); |
79 | 80 | } |
@@ -97,8 +98,9 @@ discard block |
||
97 | 98 | $pdo_cascade = $this->pdo; |
98 | 99 | } |
99 | 100 | // two time testing is necessary, f.i. lastInsertId is a PDO method, not a PDOStatement method |
100 | - if ($pdo_cascade === null || !method_exists($pdo_cascade, $method)) |
|
101 | - throw new \BadMethodCallException("__call($method) not possible in PDO or PDOStatement"); |
|
101 | + if ($pdo_cascade === null || !method_exists($pdo_cascade, $method)) { |
|
102 | + throw new \BadMethodCallException("__call($method) not possible in PDO or PDOStatement"); |
|
103 | + } |
|
102 | 104 | |
103 | 105 | return call_user_func_array([$pdo_cascade, $method], $args); |
104 | 106 | } |
@@ -130,8 +132,9 @@ discard block |
||
130 | 132 | throw new CruditesException('No executed statement available for fetching results'); |
131 | 133 | } |
132 | 134 | |
133 | - if ($mode === \PDO::FETCH_CLASS) |
|
134 | - return $this->executed->fetchAll($mode, $fetch_argument, $ctor_args); |
|
135 | + if ($mode === \PDO::FETCH_CLASS) { |
|
136 | + return $this->executed->fetchAll($mode, $fetch_argument, $ctor_args); |
|
137 | + } |
|
135 | 138 | |
136 | 139 | return $this->executed->fetchAll($mode); |
137 | 140 | } |