@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | public function getSingleIdReflectionProperty() |
696 | 696 | { |
697 | 697 | if ($this->isIdentifierComposite) { |
698 | - throw new BadMethodCallException("Class " . $this->name . " has a composite identifier."); |
|
698 | + throw new BadMethodCallException("Class ".$this->name." has a composite identifier."); |
|
699 | 699 | } |
700 | 700 | |
701 | 701 | return $this->reflFields[$this->identifier[0]]; |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | */ |
791 | 791 | public function __toString() |
792 | 792 | { |
793 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
793 | + return __CLASS__.'@'.spl_object_hash($this); |
|
794 | 794 | } |
795 | 795 | |
796 | 796 | /** |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | } |
1107 | 1107 | |
1108 | 1108 | if ( ! isset($cache['region'])) { |
1109 | - $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName; |
|
1109 | + $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName; |
|
1110 | 1110 | } |
1111 | 1111 | |
1112 | 1112 | return $cache; |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | protected function _validateAndCompleteFieldMapping(array &$mapping) |
1387 | 1387 | { |
1388 | 1388 | // Check mandatory fields |
1389 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1389 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1390 | 1390 | throw MappingException::missingFieldName($this->name); |
1391 | 1391 | } |
1392 | 1392 | |
@@ -1499,14 +1499,14 @@ discard block |
||
1499 | 1499 | $this->isIdentifierComposite = true; |
1500 | 1500 | } |
1501 | 1501 | |
1502 | - if ($this->cache && !isset($mapping['cache'])) { |
|
1502 | + if ($this->cache && ! isset($mapping['cache'])) { |
|
1503 | 1503 | throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']); |
1504 | 1504 | } |
1505 | 1505 | } |
1506 | 1506 | |
1507 | 1507 | // Mandatory attributes for both sides |
1508 | 1508 | // Mandatory: fieldName, targetEntity |
1509 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1509 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1510 | 1510 | throw MappingException::missingFieldName($this->name); |
1511 | 1511 | } |
1512 | 1512 | |
@@ -1628,7 +1628,7 @@ discard block |
||
1628 | 1628 | throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); |
1629 | 1629 | } |
1630 | 1630 | |
1631 | - $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [ |
|
1631 | + $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [ |
|
1632 | 1632 | 'columns' => $uniqueConstraintColumns |
1633 | 1633 | ]; |
1634 | 1634 | } |
@@ -1643,7 +1643,7 @@ discard block |
||
1643 | 1643 | unset($mapping['unique']); |
1644 | 1644 | } |
1645 | 1645 | |
1646 | - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { |
|
1646 | + if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) { |
|
1647 | 1647 | throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); |
1648 | 1648 | } |
1649 | 1649 | |
@@ -1697,7 +1697,7 @@ discard block |
||
1697 | 1697 | } |
1698 | 1698 | |
1699 | 1699 | $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity'] |
1700 | - && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1700 | + && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1701 | 1701 | |
1702 | 1702 | if ( ! isset($mapping['joinTable']['joinColumns'])) { |
1703 | 1703 | $mapping['joinTable']['joinColumns'] = [ |
@@ -1890,7 +1890,7 @@ discard block |
||
1890 | 1890 | |
1891 | 1891 | // Association defined as Id field |
1892 | 1892 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
1893 | - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1893 | + $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1894 | 1894 | |
1895 | 1895 | $columnNames = array_merge($columnNames, $assocColumnNames); |
1896 | 1896 | } |
@@ -2071,7 +2071,7 @@ discard block |
||
2071 | 2071 | public function getTemporaryIdTableName() |
2072 | 2072 | { |
2073 | 2073 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
2074 | - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); |
|
2074 | + return str_replace('.', '_', $this->getTableName().'_id_tmp'); |
|
2075 | 2075 | } |
2076 | 2076 | |
2077 | 2077 | /** |
@@ -2408,7 +2408,7 @@ discard block |
||
2408 | 2408 | */ |
2409 | 2409 | public function addNamedQuery(array $queryMapping) |
2410 | 2410 | { |
2411 | - if (!isset($queryMapping['name'])) { |
|
2411 | + if ( ! isset($queryMapping['name'])) { |
|
2412 | 2412 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2413 | 2413 | } |
2414 | 2414 | |
@@ -2416,7 +2416,7 @@ discard block |
||
2416 | 2416 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2417 | 2417 | } |
2418 | 2418 | |
2419 | - if (!isset($queryMapping['query'])) { |
|
2419 | + if ( ! isset($queryMapping['query'])) { |
|
2420 | 2420 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2421 | 2421 | } |
2422 | 2422 | |
@@ -2443,7 +2443,7 @@ discard block |
||
2443 | 2443 | */ |
2444 | 2444 | public function addNamedNativeQuery(array $queryMapping) |
2445 | 2445 | { |
2446 | - if (!isset($queryMapping['name'])) { |
|
2446 | + if ( ! isset($queryMapping['name'])) { |
|
2447 | 2447 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2448 | 2448 | } |
2449 | 2449 | |
@@ -2451,11 +2451,11 @@ discard block |
||
2451 | 2451 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2452 | 2452 | } |
2453 | 2453 | |
2454 | - if (!isset($queryMapping['query'])) { |
|
2454 | + if ( ! isset($queryMapping['query'])) { |
|
2455 | 2455 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2456 | 2456 | } |
2457 | 2457 | |
2458 | - if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) { |
|
2458 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
2459 | 2459 | throw MappingException::missingQueryMapping($this->name, $queryMapping['name']); |
2460 | 2460 | } |
2461 | 2461 | |
@@ -2487,7 +2487,7 @@ discard block |
||
2487 | 2487 | */ |
2488 | 2488 | public function addSqlResultSetMapping(array $resultMapping) |
2489 | 2489 | { |
2490 | - if (!isset($resultMapping['name'])) { |
|
2490 | + if ( ! isset($resultMapping['name'])) { |
|
2491 | 2491 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
2492 | 2492 | } |
2493 | 2493 | |
@@ -2497,7 +2497,7 @@ discard block |
||
2497 | 2497 | |
2498 | 2498 | if (isset($resultMapping['entities'])) { |
2499 | 2499 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
2500 | - if (!isset($entityResult['entityClass'])) { |
|
2500 | + if ( ! isset($entityResult['entityClass'])) { |
|
2501 | 2501 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
2502 | 2502 | } |
2503 | 2503 | |
@@ -2516,11 +2516,11 @@ discard block |
||
2516 | 2516 | |
2517 | 2517 | if (isset($entityResult['fields'])) { |
2518 | 2518 | foreach ($entityResult['fields'] as $k => $field) { |
2519 | - if (!isset($field['name'])) { |
|
2519 | + if ( ! isset($field['name'])) { |
|
2520 | 2520 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
2521 | 2521 | } |
2522 | 2522 | |
2523 | - if (!isset($field['column'])) { |
|
2523 | + if ( ! isset($field['column'])) { |
|
2524 | 2524 | $fieldName = $field['name']; |
2525 | 2525 | if (strpos($fieldName, '.')) { |
2526 | 2526 | list(, $fieldName) = explode('.', $fieldName); |
@@ -3011,7 +3011,7 @@ discard block |
||
3011 | 3011 | } |
3012 | 3012 | |
3013 | 3013 | if ($definition['sequenceName'][0] == '`') { |
3014 | - $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3014 | + $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3015 | 3015 | $definition['quoted'] = true; |
3016 | 3016 | } |
3017 | 3017 | |
@@ -3111,7 +3111,7 @@ discard block |
||
3111 | 3111 | public function getAssociationTargetClass($assocName) |
3112 | 3112 | { |
3113 | 3113 | if ( ! isset($this->associationMappings[$assocName])) { |
3114 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
3114 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
3115 | 3115 | } |
3116 | 3116 | |
3117 | 3117 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3150,7 +3150,7 @@ discard block |
||
3150 | 3150 | // Association defined as Id field |
3151 | 3151 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
3152 | 3152 | $assocQuotedColumnNames = array_map( |
3153 | - function ($joinColumn) use ($platform) { |
|
3153 | + function($joinColumn) use ($platform) { |
|
3154 | 3154 | return isset($joinColumn['quoted']) |
3155 | 3155 | ? $platform->quoteIdentifier($joinColumn['name']) |
3156 | 3156 | : $joinColumn['name']; |
@@ -3261,7 +3261,7 @@ discard block |
||
3261 | 3261 | } |
3262 | 3262 | |
3263 | 3263 | if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
3264 | - return $this->namespace . '\\' . $className; |
|
3264 | + return $this->namespace.'\\'.$className; |
|
3265 | 3265 | } |
3266 | 3266 | |
3267 | 3267 | return $className; |
@@ -3313,13 +3313,13 @@ discard block |
||
3313 | 3313 | foreach ($embeddable->fieldMappings as $fieldMapping) { |
3314 | 3314 | $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name; |
3315 | 3315 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
3316 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
3316 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
3317 | 3317 | : $property; |
3318 | 3318 | $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName']; |
3319 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
3319 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
3320 | 3320 | |
3321 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3322 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
3321 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3322 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
3323 | 3323 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
3324 | 3324 | $fieldMapping['columnName'] = $this->namingStrategy |
3325 | 3325 | ->embeddedFieldToColumnName( |
@@ -3360,7 +3360,7 @@ discard block |
||
3360 | 3360 | { |
3361 | 3361 | $sequencePrefix = $this->getSequencePrefix($platform); |
3362 | 3362 | $columnName = $this->getSingleIdentifierColumnName(); |
3363 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
3363 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
3364 | 3364 | |
3365 | 3365 | return $sequenceName; |
3366 | 3366 | } |
@@ -3380,10 +3380,10 @@ discard block |
||
3380 | 3380 | |
3381 | 3381 | // Prepend the schema name to the table name if there is one |
3382 | 3382 | if ($schemaName = $this->getSchemaName()) { |
3383 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
3383 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
3384 | 3384 | |
3385 | 3385 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
3386 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
3386 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
3387 | 3387 | } |
3388 | 3388 | } |
3389 | 3389 | |
@@ -3395,8 +3395,8 @@ discard block |
||
3395 | 3395 | */ |
3396 | 3396 | private function assertMappingOrderBy(array $mapping) |
3397 | 3397 | { |
3398 | - if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) { |
|
3399 | - throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy'])); |
|
3398 | + if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { |
|
3399 | + throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); |
|
3400 | 3400 | } |
3401 | 3401 | } |
3402 | 3402 | } |