@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | $type = self::getAnnotatedPropertyType($toClass, $property->getName(), $namespace); |
153 | 153 | |
154 | - if ("" === $type || self::isPrimitive($type) || ! class_exists($type)) { |
|
154 | + if ("" === $type || self::isPrimitive($type) || !class_exists($type)) { |
|
155 | 155 | return array( |
156 | 156 | $type, |
157 | 157 | $value |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | foreach ($rfClass->getProperties() as $property) { |
244 | 244 | $docComment = $property->getDocComment(); |
245 | 245 | |
246 | - if (! self::isIdAnnotated($docComment)) { |
|
246 | + if (!self::isIdAnnotated($docComment)) { |
|
247 | 247 | continue; |
248 | 248 | } |
249 | 249 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | $primaryKey = $rfMethod->invoke($object); |
257 | 257 | |
258 | - if (! $onlyValue) { |
|
258 | + if (!$onlyValue) { |
|
259 | 259 | $primaryKey = array( |
260 | 260 | $columnName => $primaryKey |
261 | 261 | ); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | private static function getAnnotatedType(string $comment, string $namespace = null): string |
284 | 284 | { |
285 | 285 | $matches = array(); |
286 | - if (! preg_match('/@var ([\w\\\\]+)/', $comment, $matches)) { |
|
286 | + if (!preg_match('/@var ([\w\\\\]+)/', $comment, $matches)) { |
|
287 | 287 | return ""; |
288 | 288 | } |
289 | 289 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | $type = self::fullQualifiedName($namespace, $type); |
297 | 297 | |
298 | - if (! class_exists($type)) { |
|
298 | + if (!class_exists($type)) { |
|
299 | 299 | throw new OrmException("Annotated type {type} could not be found nor loaded", array( |
300 | 300 | 'type' => $matches[1] |
301 | 301 | )); |
@@ -280,7 +280,7 @@ |
||
280 | 280 | { |
281 | 281 | $mappingOptions = array(); |
282 | 282 | foreach (explode(',', $mappedBy) as $mappingOption) { |
283 | - if(empty($mappingOption)) continue; |
|
283 | + if(empty($mappingOption)) continue; |
|
284 | 284 | |
285 | 285 | list ($option, $value) = preg_split('/=/', $mappingOption); |
286 | 286 | $mappingOptions[$option] = $value; |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | $rfToClass = new \ReflectionClass($toClass); |
52 | 52 | |
53 | 53 | foreach (get_object_vars($from) as $property => $value) { |
54 | - if (! strpos($property, '.')) { |
|
54 | + if (!strpos($property, '.')) { |
|
55 | 55 | continue; |
56 | 56 | } |
57 | 57 | |
58 | 58 | list ($toProperty, $column) = explode('.', $property); |
59 | 59 | |
60 | - if (! $rfToClass->hasProperty($toProperty)) { |
|
60 | + if (!$rfToClass->hasProperty($toProperty)) { |
|
61 | 61 | continue; |
62 | 62 | } |
63 | 63 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @throws OrmException |
94 | 94 | * @throws PDOException |
95 | 95 | */ |
96 | - private static function injectMappedBy(string $toClass, AbstractModel &$object, Orm $orm) |
|
96 | + private static function injectMappedBy(string $toClass, AbstractModel & $object, Orm $orm) |
|
97 | 97 | { |
98 | 98 | try { |
99 | 99 | $rfToClass = new \ReflectionClass($toClass); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | return true; |
226 | 226 | } |
227 | 227 | |
228 | - if (! self::isPrimitive($type) && class_exists($type) && ! $value instanceof $type) { |
|
228 | + if (!self::isPrimitive($type) && class_exists($type) && !$value instanceof $type) { |
|
229 | 229 | return false; |
230 | 230 | } |
231 | 231 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $rfMethod->invoke($result, self::convertType($type, $value)); |
260 | 260 | } else { |
261 | 261 | foreach ($resultClass->getProperties() as $resultClassProperty) { |
262 | - if (! self::assignAnnotatedPropertyValue($result, $resultClassProperty, $resultClass, $propertyName, $value)) { |
|
262 | + if (!self::assignAnnotatedPropertyValue($result, $resultClassProperty, $resultClass, $propertyName, $value)) { |
|
263 | 263 | break; |
264 | 264 | } |
265 | 265 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | { |
281 | 281 | $mappingOptions = array(); |
282 | 282 | foreach (explode(',', $mappedBy) as $mappingOption) { |
283 | - if(empty($mappingOption)) continue; |
|
283 | + if (empty($mappingOption)) continue; |
|
284 | 284 | |
285 | 285 | list ($option, $value) = preg_split('/=/', $mappingOption); |
286 | 286 | $mappingOptions[$option] = $value; |
@@ -280,7 +280,9 @@ |
||
280 | 280 | { |
281 | 281 | $mappingOptions = array(); |
282 | 282 | foreach (explode(',', $mappedBy) as $mappingOption) { |
283 | - if(empty($mappingOption)) continue; |
|
283 | + if(empty($mappingOption)) { |
|
284 | + continue; |
|
285 | + } |
|
284 | 286 | |
285 | 287 | list ($option, $value) = preg_split('/=/', $mappingOption); |
286 | 288 | $mappingOptions[$option] = $value; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $limits = self::parseLimits($limit, $startFrom); |
47 | 47 | |
48 | - if ($orderBy && ! stristr($orderBy, 'ORDER BY ')) { |
|
48 | + if ($orderBy && !stristr($orderBy, 'ORDER BY ')) { |
|
49 | 49 | $orderBy = sprintf("ORDER BY %s%s%s", $escapeSign, $orderBy, $escapeSign); |
50 | 50 | } |
51 | 51 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } elseif (strtoupper(substr($criteria[$criterion], 0, 7)) == 'BETWEEN') { |
138 | 138 | $start = $end = null; |
139 | 139 | sscanf(strtoupper($criteria[$criterion]), "BETWEEN %s AND %s", $start, $end); |
140 | - if (! $start || ! $end) { |
|
140 | + if (!$start || !$end) { |
|
141 | 141 | throw new OrmException("Invalid range for between"); |
142 | 142 | } |
143 | 143 | $wheres[] = sprintf("%s BETWEEN %s AND %s", self::escapeCriterion($criterion, $escapeSign), $start, $end); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | if ($conditions) { |
167 | 167 | $and = substr($where, 0, 3) == 'OR ' ? " " : " AND "; |
168 | 168 | } |
169 | - $conditions .= $and . $where; |
|
169 | + $conditions .= $and.$where; |
|
170 | 170 | } |
171 | 171 | $wheres = sprintf("WHERE %s", $conditions); |
172 | 172 | } else { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | { |
261 | 261 | $class = new \ReflectionClass($className); |
262 | 262 | $simpleCriterion = self::getSimpleCriterionName($criterion); |
263 | - if (! $class->hasProperty($simpleCriterion)) { |
|
263 | + if (!$class->hasProperty($simpleCriterion)) { |
|
264 | 264 | return $criterion; |
265 | 265 | } |
266 | 266 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $propertyClass = ""; |
324 | 324 | // search the type of property value |
325 | 325 | if ("" !== ($type = self::getAnnotatedType($rfProperty->getDocComment(), $rf->getNamespaceName()))) { |
326 | - if (! self::isPrimitive($type) && class_exists($type)) { |
|
326 | + if (!self::isPrimitive($type) && class_exists($type)) { |
|
327 | 327 | $propertyClass = $type; |
328 | 328 | } |
329 | 329 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $toThrow = OrmException::fromPrevious($ex, $message, $code); |
33 | 33 | |
34 | 34 | try { |
35 | - if ($statement != null && $statement instanceof \PDOStatement) { |
|
35 | + if ($statement != null && $statement instanceof \PDOStatement) { |
|
36 | 36 | $statement->closeCursor(); |
37 | 37 | } |
38 | 38 | unset($statement); |