@@ -164,7 +164,7 @@ |
||
164 | 164 | */ |
165 | 165 | public static function unescape($value) |
166 | 166 | { |
167 | - $callback = function ($matches) { |
|
167 | + $callback = function($matches) { |
|
168 | 168 | return chr(hexdec($matches[1])); |
169 | 169 | }; |
170 | 170 |
@@ -350,11 +350,11 @@ |
||
350 | 350 | |
351 | 351 | |
352 | 352 | |
353 | - /** |
|
354 | - * Destructor. |
|
355 | - * |
|
356 | - * Closes the current LDAP connection if it exists. |
|
357 | - */ |
|
353 | + /** |
|
354 | + * Destructor. |
|
355 | + * |
|
356 | + * Closes the current LDAP connection if it exists. |
|
357 | + */ |
|
358 | 358 | //public function __destruct(); |
359 | 359 | |
360 | 360 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | $this->resource = ldap_connect($hostname, $port); |
151 | 151 | |
152 | - if(!$this->resource){ |
|
152 | + if (!$this->resource) { |
|
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | throw new LdapException($this->getLastError(), $this->getErrNo()); |
257 | 257 | } |
258 | 258 | |
259 | - if(is_resource($result)){ |
|
259 | + if (is_resource($result)) { |
|
260 | 260 | return new DataReader($this, $result); |
261 | 261 | } |
262 | 262 |
@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | public function build($condition) |
65 | 65 | { |
66 | - if (!is_array($condition)) { |
|
66 | + if (!is_array($condition)) { |
|
67 | 67 | return (string) $condition; |
68 | 68 | } elseif (empty($condition)) { |
69 | 69 | return ''; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $parts[] = "$column=$value"; |
99 | 99 | } |
100 | 100 | } |
101 | - return count($parts) === 1 ? '('.$parts[0].')' : '$(' . implode(') (', $parts) . ')'; |
|
101 | + return count($parts) === 1 ? '('.$parts[0].')' : '$('.implode(') (', $parts).')'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | } |
117 | 117 | if ($operand !== '' && !is_numeric($key)) { |
118 | 118 | $parts[] = $key.'='.$operand; |
119 | - }elseif($operand !== ''){ |
|
119 | + }elseif ($operand !== '') { |
|
120 | 120 | $other[] = $operand; |
121 | 121 | } |
122 | 122 | } |
123 | 123 | if (!empty($parts)) { |
124 | - return '('.$this->operator[$operator].'(' . implode(") (", $parts) . ')'.implode($other).' )'; |
|
124 | + return '('.$this->operator[$operator].'('.implode(") (", $parts).')'.implode($other).' )'; |
|
125 | 125 | } else { |
126 | 126 | return ''; |
127 | 127 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return ''; |
150 | 150 | } |
151 | 151 | |
152 | - return '('.$this->operator['NOT'].'('.key($operands) .'='.$operand.'))'; |
|
152 | + return '('.$this->operator['NOT'].'('.key($operands).'='.$operand.'))'; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -208,10 +208,10 @@ discard block |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | if (count($sqlValues) > 1) { |
211 | - return "$column $operator (" . implode(', ', $sqlValues) . ')'; |
|
211 | + return "$column $operator (".implode(', ', $sqlValues).')'; |
|
212 | 212 | } else { |
213 | 213 | $operator = $operator === 'IN' ? '=' : '<>'; |
214 | - return $column . $operator . reset($sqlValues); |
|
214 | + return $column.$operator.reset($sqlValues); |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $columns[$i] = $this->db->quoteColumnName($col); |
233 | 233 | } |
234 | 234 | } |
235 | - return '(' . implode(', ', $columns) . ") $operator ($sql)"; |
|
235 | + return '('.implode(', ', $columns).") $operator ($sql)"; |
|
236 | 236 | } else { |
237 | 237 | if (strpos($columns, '(') === false) { |
238 | 238 | $columns = $this->db->quoteColumnName($columns); |
@@ -256,14 +256,14 @@ discard block |
||
256 | 256 | $vs = []; |
257 | 257 | foreach ($columns as $column) { |
258 | 258 | if (isset($value[$column])) { |
259 | - $phName = self::PARAM_PREFIX . count($params); |
|
259 | + $phName = self::PARAM_PREFIX.count($params); |
|
260 | 260 | $params[$phName] = $value[$column]; |
261 | 261 | $vs[] = $phName; |
262 | 262 | } else { |
263 | 263 | $vs[] = 'NULL'; |
264 | 264 | } |
265 | 265 | } |
266 | - $vss[] = '(' . implode(', ', $vs) . ')'; |
|
266 | + $vss[] = '('.implode(', ', $vs).')'; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | if (empty($vss)) { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $sqlColumns[] = strpos($column, '(') === false ? $this->db->quoteColumnName($column) : $column; |
276 | 276 | } |
277 | 277 | |
278 | - return '(' . implode(', ', $sqlColumns) . ") $operator (" . implode(', ', $vss) . ')'; |
|
278 | + return '('.implode(', ', $sqlColumns).") $operator (".implode(', ', $vss).')'; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -323,15 +323,15 @@ discard block |
||
323 | 323 | return $not ? '' : '0=1'; |
324 | 324 | } |
325 | 325 | |
326 | - $not = ($operator == 'NOT LIKE') ? '(' . $this->operator['NOT'] : false; |
|
326 | + $not = ($operator == 'NOT LIKE') ? '('.$this->operator['NOT'] : false; |
|
327 | 327 | |
328 | 328 | $parts = []; |
329 | 329 | foreach ($values as $value) { |
330 | 330 | $value = empty($escape) ? $value : strtr($value, $escape); |
331 | - $parts[] = $not . '(' . $column .'=*'.$value . '*)' . ($not? ')':''); |
|
331 | + $parts[] = $not.'('.$column.'=*'.$value.'*)'.($not ? ')' : ''); |
|
332 | 332 | } |
333 | 333 | |
334 | - return '('.$this->operator[trim($andor)] . implode($parts). ')'; |
|
334 | + return '('.$this->operator[trim($andor)].implode($parts).')'; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -116,7 +116,7 @@ |
||
116 | 116 | } |
117 | 117 | if ($operand !== '' && !is_numeric($key)) { |
118 | 118 | $parts[] = $key.'='.$operand; |
119 | - }elseif($operand !== ''){ |
|
119 | + } elseif($operand !== ''){ |
|
120 | 120 | $other[] = $operand; |
121 | 121 | } |
122 | 122 | } |