@@ -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 (null !== ($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 | } |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | $rfToClass = new \ReflectionClass($toClass); |
| 51 | 51 | |
| 52 | 52 | foreach (get_object_vars($from) as $property => $value) { |
| 53 | - if (! strpos($property, '.')) { |
|
| 53 | + if (!strpos($property, '.')) { |
|
| 54 | 54 | continue; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | list ($toProperty, $column) = explode('.', $property); |
| 58 | 58 | |
| 59 | - if (! $rfToClass->hasProperty($toProperty)) { |
|
| 59 | + if (!$rfToClass->hasProperty($toProperty)) { |
|
| 60 | 60 | continue; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @throws OrmException |
| 93 | 93 | * @throws PDOException |
| 94 | 94 | */ |
| 95 | - private static function injectMappedBy(string $toClass, AbstractModel &$object, Orm $orm) |
|
| 95 | + private static function injectMappedBy(string $toClass, AbstractModel & $object, Orm $orm) |
|
| 96 | 96 | { |
| 97 | 97 | try { |
| 98 | 98 | $rfToClass = new \ReflectionClass($toClass); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | return true; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - if (! self::isPrimitive($type) && class_exists($type) && ! $value instanceof $type) { |
|
| 227 | + if (!self::isPrimitive($type) && class_exists($type) && !$value instanceof $type) { |
|
| 228 | 228 | return false; |
| 229 | 229 | } |
| 230 | 230 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $rfMethod->invoke($result, self::convertType($type, $value)); |
| 259 | 259 | } else { |
| 260 | 260 | foreach ($resultClass->getProperties() as $resultClassProperty) { |
| 261 | - if (! self::assignAnnotatedPropertyValue($result, $resultClassProperty, $resultClass, $propertyName, $value)) { |
|
| 261 | + if (!self::assignAnnotatedPropertyValue($result, $resultClassProperty, $resultClass, $propertyName, $value)) { |
|
| 262 | 262 | break; |
| 263 | 263 | } |
| 264 | 264 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $pkColumn => $id |
| 87 | 87 | )); |
| 88 | 88 | |
| 89 | - if (! $result || is_array($result)) { |
|
| 89 | + if (!$result || is_array($result)) { |
|
| 90 | 90 | throw new OrmException("More than one entity found (expected exactly one)"); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $placeHolder = str_replace('.', '_', $criterion); |
| 136 | 136 | $placeHolder = str_replace('OR ', 'OR_', $placeHolder); |
| 137 | 137 | $value = str_ireplace('LIKE ', '', $value); |
| 138 | - $statement->bindValue(":" . $placeHolder, $value); |
|
| 138 | + $statement->bindValue(":".$placeHolder, $value); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $statement->execute(); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $results[] = self::map($result, $class, $instance); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if (! $asList && count($results) == 1) { |
|
| 154 | + if (!$asList && count($results) == 1) { |
|
| 155 | 155 | $results = $results[0]; |
| 156 | 156 | } |
| 157 | 157 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $instance->getDbType()->lock($tableName, IType::LOCK_TYPE_WRITE, $instance); |
| 234 | 234 | $statement->execute(); |
| 235 | - if (! $primaryKeyValue) { |
|
| 235 | + if (!$primaryKeyValue) { |
|
| 236 | 236 | $pk = $connection->lastInsertId($instance->getDbType() |
| 237 | 237 | ->getSequenceNameForColumn($tableName, $primaryKeyCol, $instance)); |
| 238 | 238 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | unset($statement); |
| 242 | 242 | |
| 243 | - if (! $primaryKeyValue) { |
|
| 243 | + if (!$primaryKeyValue) { |
|
| 244 | 244 | $this->setPrimaryKey($class, $entity, $pk); |
| 245 | 245 | } |
| 246 | 246 | |