@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | public function getSingleIdReflectionProperty() |
| 697 | 697 | { |
| 698 | 698 | if ($this->isIdentifierComposite) { |
| 699 | - throw new BadMethodCallException("Class " . $this->name . " has a composite identifier."); |
|
| 699 | + throw new BadMethodCallException("Class ".$this->name." has a composite identifier."); |
|
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | return $this->reflFields[$this->identifier[0]]; |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | */ |
| 792 | 792 | public function __toString() |
| 793 | 793 | { |
| 794 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
| 794 | + return __CLASS__.'@'.spl_object_hash($this); |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | /** |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | public function validateAssociations() |
| 1026 | 1026 | { |
| 1027 | 1027 | foreach ($this->associationMappings as $mapping) { |
| 1028 | - if ( ! ClassLoader::classExists($mapping['targetEntity']) ) { |
|
| 1028 | + if ( ! ClassLoader::classExists($mapping['targetEntity'])) { |
|
| 1029 | 1029 | throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']); |
| 1030 | 1030 | } |
| 1031 | 1031 | } |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | */ |
| 1086 | 1086 | public function enableAssociationCache($fieldName, array $cache) |
| 1087 | 1087 | { |
| 1088 | - $this->associationMappings[$fieldName]['cache'] = $this->getAssociationCacheDefaults ($fieldName, $cache); |
|
| 1088 | + $this->associationMappings[$fieldName]['cache'] = $this->getAssociationCacheDefaults($fieldName, $cache); |
|
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | /** |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | if ( ! isset($cache['region'])) { |
| 1106 | - $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName; |
|
| 1106 | + $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName; |
|
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | return $cache; |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | $this->isIdentifierComposite = true; |
| 1505 | 1505 | } |
| 1506 | 1506 | |
| 1507 | - if ($this->cache && !isset($mapping['cache'])) { |
|
| 1507 | + if ($this->cache && ! isset($mapping['cache'])) { |
|
| 1508 | 1508 | throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']); |
| 1509 | 1509 | } |
| 1510 | 1510 | } |
@@ -1635,7 +1635,7 @@ discard block |
||
| 1635 | 1635 | throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | - $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = array( |
|
| 1638 | + $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = array( |
|
| 1639 | 1639 | 'columns' => $uniqueConstraintColumns |
| 1640 | 1640 | ); |
| 1641 | 1641 | } |
@@ -1650,7 +1650,7 @@ discard block |
||
| 1650 | 1650 | unset($mapping['unique']); |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { |
|
| 1653 | + if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) { |
|
| 1654 | 1654 | throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); |
| 1655 | 1655 | } |
| 1656 | 1656 | |
@@ -1704,7 +1704,7 @@ discard block |
||
| 1704 | 1704 | } |
| 1705 | 1705 | |
| 1706 | 1706 | $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity'] |
| 1707 | - && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
| 1707 | + && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
| 1708 | 1708 | |
| 1709 | 1709 | if ( ! isset($mapping['joinTable']['joinColumns'])) { |
| 1710 | 1710 | $mapping['joinTable']['joinColumns'] = array( |
@@ -1893,7 +1893,7 @@ discard block |
||
| 1893 | 1893 | |
| 1894 | 1894 | // Association defined as Id field |
| 1895 | 1895 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
| 1896 | - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
| 1896 | + $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
| 1897 | 1897 | |
| 1898 | 1898 | $columnNames = array_merge($columnNames, $assocColumnNames); |
| 1899 | 1899 | } |
@@ -2074,7 +2074,7 @@ discard block |
||
| 2074 | 2074 | public function getTemporaryIdTableName() |
| 2075 | 2075 | { |
| 2076 | 2076 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 2077 | - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); |
|
| 2077 | + return str_replace('.', '_', $this->getTableName().'_id_tmp'); |
|
| 2078 | 2078 | } |
| 2079 | 2079 | |
| 2080 | 2080 | /** |
@@ -2403,7 +2403,7 @@ discard block |
||
| 2403 | 2403 | */ |
| 2404 | 2404 | public function addNamedQuery(array $queryMapping) |
| 2405 | 2405 | { |
| 2406 | - if (!isset($queryMapping['name'])) { |
|
| 2406 | + if ( ! isset($queryMapping['name'])) { |
|
| 2407 | 2407 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
| 2408 | 2408 | } |
| 2409 | 2409 | |
@@ -2411,7 +2411,7 @@ discard block |
||
| 2411 | 2411 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
| 2412 | 2412 | } |
| 2413 | 2413 | |
| 2414 | - if (!isset($queryMapping['query'])) { |
|
| 2414 | + if ( ! isset($queryMapping['query'])) { |
|
| 2415 | 2415 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
| 2416 | 2416 | } |
| 2417 | 2417 | |
@@ -2438,7 +2438,7 @@ discard block |
||
| 2438 | 2438 | */ |
| 2439 | 2439 | public function addNamedNativeQuery(array $queryMapping) |
| 2440 | 2440 | { |
| 2441 | - if (!isset($queryMapping['name'])) { |
|
| 2441 | + if ( ! isset($queryMapping['name'])) { |
|
| 2442 | 2442 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
| 2443 | 2443 | } |
| 2444 | 2444 | |
@@ -2446,11 +2446,11 @@ discard block |
||
| 2446 | 2446 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
| 2447 | 2447 | } |
| 2448 | 2448 | |
| 2449 | - if (!isset($queryMapping['query'])) { |
|
| 2449 | + if ( ! isset($queryMapping['query'])) { |
|
| 2450 | 2450 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
| 2451 | 2451 | } |
| 2452 | 2452 | |
| 2453 | - if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) { |
|
| 2453 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 2454 | 2454 | throw MappingException::missingQueryMapping($this->name, $queryMapping['name']); |
| 2455 | 2455 | } |
| 2456 | 2456 | |
@@ -2482,7 +2482,7 @@ discard block |
||
| 2482 | 2482 | */ |
| 2483 | 2483 | public function addSqlResultSetMapping(array $resultMapping) |
| 2484 | 2484 | { |
| 2485 | - if (!isset($resultMapping['name'])) { |
|
| 2485 | + if ( ! isset($resultMapping['name'])) { |
|
| 2486 | 2486 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
| 2487 | 2487 | } |
| 2488 | 2488 | |
@@ -2492,7 +2492,7 @@ discard block |
||
| 2492 | 2492 | |
| 2493 | 2493 | if (isset($resultMapping['entities'])) { |
| 2494 | 2494 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 2495 | - if (!isset($entityResult['entityClass'])) { |
|
| 2495 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 2496 | 2496 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
| 2497 | 2497 | } |
| 2498 | 2498 | |
@@ -2511,11 +2511,11 @@ discard block |
||
| 2511 | 2511 | |
| 2512 | 2512 | if (isset($entityResult['fields'])) { |
| 2513 | 2513 | foreach ($entityResult['fields'] as $k => $field) { |
| 2514 | - if (!isset($field['name'])) { |
|
| 2514 | + if ( ! isset($field['name'])) { |
|
| 2515 | 2515 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
| 2516 | 2516 | } |
| 2517 | 2517 | |
| 2518 | - if (!isset($field['column'])) { |
|
| 2518 | + if ( ! isset($field['column'])) { |
|
| 2519 | 2519 | $fieldName = $field['name']; |
| 2520 | 2520 | if (strpos($fieldName, '.')) { |
| 2521 | 2521 | list(, $fieldName) = explode('.', $fieldName); |
@@ -3006,7 +3006,7 @@ discard block |
||
| 3006 | 3006 | } |
| 3007 | 3007 | |
| 3008 | 3008 | if ($definition['sequenceName'][0] == '`') { |
| 3009 | - $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
| 3009 | + $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
| 3010 | 3010 | $definition['quoted'] = true; |
| 3011 | 3011 | } |
| 3012 | 3012 | |
@@ -3098,7 +3098,7 @@ discard block |
||
| 3098 | 3098 | public function getAssociationTargetClass($assocName) |
| 3099 | 3099 | { |
| 3100 | 3100 | if ( ! isset($this->associationMappings[$assocName])) { |
| 3101 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
| 3101 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
| 3102 | 3102 | } |
| 3103 | 3103 | |
| 3104 | 3104 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3137,7 +3137,7 @@ discard block |
||
| 3137 | 3137 | // Association defined as Id field |
| 3138 | 3138 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
| 3139 | 3139 | $assocQuotedColumnNames = array_map( |
| 3140 | - function ($joinColumn) use ($platform) { |
|
| 3140 | + function($joinColumn) use ($platform) { |
|
| 3141 | 3141 | return isset($joinColumn['quoted']) |
| 3142 | 3142 | ? $platform->quoteIdentifier($joinColumn['name']) |
| 3143 | 3143 | : $joinColumn['name']; |
@@ -3248,7 +3248,7 @@ discard block |
||
| 3248 | 3248 | } |
| 3249 | 3249 | |
| 3250 | 3250 | if ($className !== null && strpos($className, '\\') === false && strlen($this->namespace) > 0) { |
| 3251 | - return $this->namespace . '\\' . $className; |
|
| 3251 | + return $this->namespace.'\\'.$className; |
|
| 3252 | 3252 | } |
| 3253 | 3253 | |
| 3254 | 3254 | return $className; |
@@ -3302,15 +3302,15 @@ discard block |
||
| 3302 | 3302 | ? $fieldMapping['originalClass'] |
| 3303 | 3303 | : $embeddable->name; |
| 3304 | 3304 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
| 3305 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
| 3305 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
| 3306 | 3306 | : $property; |
| 3307 | 3307 | $fieldMapping['originalField'] = isset($fieldMapping['originalField']) |
| 3308 | 3308 | ? $fieldMapping['originalField'] |
| 3309 | 3309 | : $fieldMapping['fieldName']; |
| 3310 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
| 3310 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
| 3311 | 3311 | |
| 3312 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
| 3313 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
| 3312 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
| 3313 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
| 3314 | 3314 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
| 3315 | 3315 | $fieldMapping['columnName'] = $this->namingStrategy |
| 3316 | 3316 | ->embeddedFieldToColumnName( |
@@ -3351,7 +3351,7 @@ discard block |
||
| 3351 | 3351 | { |
| 3352 | 3352 | $sequencePrefix = $this->getSequencePrefix($platform); |
| 3353 | 3353 | $columnName = $this->getSingleIdentifierColumnName(); |
| 3354 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
| 3354 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
| 3355 | 3355 | |
| 3356 | 3356 | return $sequenceName; |
| 3357 | 3357 | } |
@@ -3371,10 +3371,10 @@ discard block |
||
| 3371 | 3371 | |
| 3372 | 3372 | // Prepend the schema name to the table name if there is one |
| 3373 | 3373 | if ($schemaName = $this->getSchemaName()) { |
| 3374 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
| 3374 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
| 3375 | 3375 | |
| 3376 | 3376 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
| 3377 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
| 3377 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
| 3378 | 3378 | } |
| 3379 | 3379 | } |
| 3380 | 3380 | |
@@ -3386,8 +3386,8 @@ discard block |
||
| 3386 | 3386 | */ |
| 3387 | 3387 | private function assertMappingOrderBy(array $mapping) |
| 3388 | 3388 | { |
| 3389 | - if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) { |
|
| 3390 | - throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy'])); |
|
| 3389 | + if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { |
|
| 3390 | + throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); |
|
| 3391 | 3391 | } |
| 3392 | 3392 | } |
| 3393 | 3393 | } |