@@ -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 | } |
@@ -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; |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | protected function _validateAndCompleteFieldMapping(array &$mapping) |
1384 | 1384 | { |
1385 | 1385 | // Check mandatory fields |
1386 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1386 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1387 | 1387 | throw MappingException::missingFieldName($this->name); |
1388 | 1388 | } |
1389 | 1389 | |
@@ -1496,14 +1496,14 @@ discard block |
||
1496 | 1496 | $this->isIdentifierComposite = true; |
1497 | 1497 | } |
1498 | 1498 | |
1499 | - if ($this->cache && !isset($mapping['cache'])) { |
|
1499 | + if ($this->cache && ! isset($mapping['cache'])) { |
|
1500 | 1500 | throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']); |
1501 | 1501 | } |
1502 | 1502 | } |
1503 | 1503 | |
1504 | 1504 | // Mandatory attributes for both sides |
1505 | 1505 | // Mandatory: fieldName, targetEntity |
1506 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1506 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1507 | 1507 | throw MappingException::missingFieldName($this->name); |
1508 | 1508 | } |
1509 | 1509 | |
@@ -1625,7 +1625,7 @@ discard block |
||
1625 | 1625 | throw new RuntimeException("ClassMetadata::setTable() has to be called before defining a one to one relationship."); |
1626 | 1626 | } |
1627 | 1627 | |
1628 | - $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [ |
|
1628 | + $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [ |
|
1629 | 1629 | 'columns' => $uniqueConstraintColumns |
1630 | 1630 | ]; |
1631 | 1631 | } |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | unset($mapping['unique']); |
1641 | 1641 | } |
1642 | 1642 | |
1643 | - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { |
|
1643 | + if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) { |
|
1644 | 1644 | throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); |
1645 | 1645 | } |
1646 | 1646 | |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | } |
1695 | 1695 | |
1696 | 1696 | $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity'] |
1697 | - && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1697 | + && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1698 | 1698 | |
1699 | 1699 | if ( ! isset($mapping['joinTable']['joinColumns'])) { |
1700 | 1700 | $mapping['joinTable']['joinColumns'] = [ |
@@ -1887,7 +1887,7 @@ discard block |
||
1887 | 1887 | |
1888 | 1888 | // Association defined as Id field |
1889 | 1889 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
1890 | - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1890 | + $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1891 | 1891 | |
1892 | 1892 | $columnNames = array_merge($columnNames, $assocColumnNames); |
1893 | 1893 | } |
@@ -2068,7 +2068,7 @@ discard block |
||
2068 | 2068 | public function getTemporaryIdTableName() |
2069 | 2069 | { |
2070 | 2070 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
2071 | - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); |
|
2071 | + return str_replace('.', '_', $this->getTableName().'_id_tmp'); |
|
2072 | 2072 | } |
2073 | 2073 | |
2074 | 2074 | /** |
@@ -2405,7 +2405,7 @@ discard block |
||
2405 | 2405 | */ |
2406 | 2406 | public function addNamedQuery(array $queryMapping) |
2407 | 2407 | { |
2408 | - if (!isset($queryMapping['name'])) { |
|
2408 | + if ( ! isset($queryMapping['name'])) { |
|
2409 | 2409 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2410 | 2410 | } |
2411 | 2411 | |
@@ -2413,7 +2413,7 @@ discard block |
||
2413 | 2413 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2414 | 2414 | } |
2415 | 2415 | |
2416 | - if (!isset($queryMapping['query'])) { |
|
2416 | + if ( ! isset($queryMapping['query'])) { |
|
2417 | 2417 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2418 | 2418 | } |
2419 | 2419 | |
@@ -2440,7 +2440,7 @@ discard block |
||
2440 | 2440 | */ |
2441 | 2441 | public function addNamedNativeQuery(array $queryMapping) |
2442 | 2442 | { |
2443 | - if (!isset($queryMapping['name'])) { |
|
2443 | + if ( ! isset($queryMapping['name'])) { |
|
2444 | 2444 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2445 | 2445 | } |
2446 | 2446 | |
@@ -2448,11 +2448,11 @@ discard block |
||
2448 | 2448 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2449 | 2449 | } |
2450 | 2450 | |
2451 | - if (!isset($queryMapping['query'])) { |
|
2451 | + if ( ! isset($queryMapping['query'])) { |
|
2452 | 2452 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2453 | 2453 | } |
2454 | 2454 | |
2455 | - if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) { |
|
2455 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
2456 | 2456 | throw MappingException::missingQueryMapping($this->name, $queryMapping['name']); |
2457 | 2457 | } |
2458 | 2458 | |
@@ -2484,7 +2484,7 @@ discard block |
||
2484 | 2484 | */ |
2485 | 2485 | public function addSqlResultSetMapping(array $resultMapping) |
2486 | 2486 | { |
2487 | - if (!isset($resultMapping['name'])) { |
|
2487 | + if ( ! isset($resultMapping['name'])) { |
|
2488 | 2488 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
2489 | 2489 | } |
2490 | 2490 | |
@@ -2494,7 +2494,7 @@ discard block |
||
2494 | 2494 | |
2495 | 2495 | if (isset($resultMapping['entities'])) { |
2496 | 2496 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
2497 | - if (!isset($entityResult['entityClass'])) { |
|
2497 | + if ( ! isset($entityResult['entityClass'])) { |
|
2498 | 2498 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
2499 | 2499 | } |
2500 | 2500 | |
@@ -2513,11 +2513,11 @@ discard block |
||
2513 | 2513 | |
2514 | 2514 | if (isset($entityResult['fields'])) { |
2515 | 2515 | foreach ($entityResult['fields'] as $k => $field) { |
2516 | - if (!isset($field['name'])) { |
|
2516 | + if ( ! isset($field['name'])) { |
|
2517 | 2517 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
2518 | 2518 | } |
2519 | 2519 | |
2520 | - if (!isset($field['column'])) { |
|
2520 | + if ( ! isset($field['column'])) { |
|
2521 | 2521 | $fieldName = $field['name']; |
2522 | 2522 | if (strpos($fieldName, '.')) { |
2523 | 2523 | list(, $fieldName) = explode('.', $fieldName); |
@@ -3008,7 +3008,7 @@ discard block |
||
3008 | 3008 | } |
3009 | 3009 | |
3010 | 3010 | if ($definition['sequenceName'][0] == '`') { |
3011 | - $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3011 | + $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3012 | 3012 | $definition['quoted'] = true; |
3013 | 3013 | } |
3014 | 3014 | |
@@ -3108,7 +3108,7 @@ discard block |
||
3108 | 3108 | public function getAssociationTargetClass($assocName) |
3109 | 3109 | { |
3110 | 3110 | if ( ! isset($this->associationMappings[$assocName])) { |
3111 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
3111 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
3112 | 3112 | } |
3113 | 3113 | |
3114 | 3114 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3147,7 +3147,7 @@ discard block |
||
3147 | 3147 | // Association defined as Id field |
3148 | 3148 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
3149 | 3149 | $assocQuotedColumnNames = array_map( |
3150 | - function ($joinColumn) use ($platform) { |
|
3150 | + function($joinColumn) use ($platform) { |
|
3151 | 3151 | return isset($joinColumn['quoted']) |
3152 | 3152 | ? $platform->quoteIdentifier($joinColumn['name']) |
3153 | 3153 | : $joinColumn['name']; |
@@ -3258,7 +3258,7 @@ discard block |
||
3258 | 3258 | } |
3259 | 3259 | |
3260 | 3260 | if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
3261 | - return $this->namespace . '\\' . $className; |
|
3261 | + return $this->namespace.'\\'.$className; |
|
3262 | 3262 | } |
3263 | 3263 | |
3264 | 3264 | return $className; |
@@ -3310,13 +3310,13 @@ discard block |
||
3310 | 3310 | foreach ($embeddable->fieldMappings as $fieldMapping) { |
3311 | 3311 | $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name; |
3312 | 3312 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
3313 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
3313 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
3314 | 3314 | : $property; |
3315 | 3315 | $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName']; |
3316 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
3316 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
3317 | 3317 | |
3318 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3319 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
3318 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3319 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
3320 | 3320 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
3321 | 3321 | $fieldMapping['columnName'] = $this->namingStrategy |
3322 | 3322 | ->embeddedFieldToColumnName( |
@@ -3357,7 +3357,7 @@ discard block |
||
3357 | 3357 | { |
3358 | 3358 | $sequencePrefix = $this->getSequencePrefix($platform); |
3359 | 3359 | $columnName = $this->getSingleIdentifierColumnName(); |
3360 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
3360 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
3361 | 3361 | |
3362 | 3362 | return $sequenceName; |
3363 | 3363 | } |
@@ -3377,10 +3377,10 @@ discard block |
||
3377 | 3377 | |
3378 | 3378 | // Prepend the schema name to the table name if there is one |
3379 | 3379 | if ($schemaName = $this->getSchemaName()) { |
3380 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
3380 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
3381 | 3381 | |
3382 | 3382 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
3383 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
3383 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
3384 | 3384 | } |
3385 | 3385 | } |
3386 | 3386 | |
@@ -3392,8 +3392,8 @@ discard block |
||
3392 | 3392 | */ |
3393 | 3393 | private function assertMappingOrderBy(array $mapping) |
3394 | 3394 | { |
3395 | - if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) { |
|
3396 | - throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy'])); |
|
3395 | + if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { |
|
3396 | + throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); |
|
3397 | 3397 | } |
3398 | 3398 | } |
3399 | 3399 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $schema = []; |
76 | 76 | foreach ($this->from as $path) { |
77 | 77 | if (is_dir($path)) { |
78 | - $files = glob($path . '/*.yml'); |
|
78 | + $files = glob($path.'/*.yml'); |
|
79 | 79 | foreach ($files as $file) { |
80 | 80 | $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($file))); |
81 | 81 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_SEQUENCE); |
239 | 239 | |
240 | 240 | $definition = [ |
241 | - 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name']:$column['sequence'] |
|
241 | + 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name'] : $column['sequence'] |
|
242 | 242 | ]; |
243 | 243 | |
244 | 244 | if (isset($column['sequence']['size'])) { |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | */ |
367 | 367 | public function writeEntityClass(ClassMetadata $metadata, $outputDirectory) |
368 | 368 | { |
369 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension; |
|
369 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension; |
|
370 | 370 | $dir = dirname($path); |
371 | 371 | |
372 | 372 | if ( ! is_dir($dir)) { |
@@ -382,8 +382,8 @@ discard block |
||
382 | 382 | } |
383 | 383 | |
384 | 384 | if ($this->backupExisting && file_exists($path)) { |
385 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
386 | - if (!copy($path, $backupPath)) { |
|
385 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
386 | + if ( ! copy($path, $backupPath)) { |
|
387 | 387 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
388 | 388 | } |
389 | 389 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $body = str_replace('<spaces>', $this->spaces, $body); |
445 | 445 | $last = strrpos($currentCode, '}'); |
446 | 446 | |
447 | - return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n"; |
|
447 | + return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n"; |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | /** |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | public function setFieldVisibility($visibility) |
509 | 509 | { |
510 | 510 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
511 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
511 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | $this->fieldVisibility = $visibility; |
@@ -605,11 +605,11 @@ discard block |
||
605 | 605 | */ |
606 | 606 | protected function generateEntityNamespace(ClassMetadata $metadata) |
607 | 607 | { |
608 | - if (! $this->hasNamespace($metadata)) { |
|
608 | + if ( ! $this->hasNamespace($metadata)) { |
|
609 | 609 | return ''; |
610 | 610 | } |
611 | 611 | |
612 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
612 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | /** |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | */ |
618 | 618 | protected function generateEntityUse() |
619 | 619 | { |
620 | - if (! $this->generateAnnotations) { |
|
620 | + if ( ! $this->generateAnnotations) { |
|
621 | 621 | return ''; |
622 | 622 | } |
623 | 623 | |
@@ -631,8 +631,8 @@ discard block |
||
631 | 631 | */ |
632 | 632 | protected function generateEntityClassName(ClassMetadata $metadata) |
633 | 633 | { |
634 | - return 'class ' . $this->getClassName($metadata) . |
|
635 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
634 | + return 'class '.$this->getClassName($metadata). |
|
635 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | /** |
@@ -734,13 +734,13 @@ discard block |
||
734 | 734 | $fieldMappings = array_merge($requiredFields, $optionalFields); |
735 | 735 | |
736 | 736 | foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) { |
737 | - $paramType = '\\' . ltrim($embeddedClass['class'], '\\'); |
|
738 | - $paramVariable = '$' . $fieldName; |
|
737 | + $paramType = '\\'.ltrim($embeddedClass['class'], '\\'); |
|
738 | + $paramVariable = '$'.$fieldName; |
|
739 | 739 | |
740 | 740 | $paramTypes[] = $paramType; |
741 | 741 | $paramVariables[] = $paramVariable; |
742 | - $params[] = $paramType . ' ' . $paramVariable; |
|
743 | - $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';'; |
|
742 | + $params[] = $paramType.' '.$paramVariable; |
|
743 | + $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';'; |
|
744 | 744 | } |
745 | 745 | |
746 | 746 | foreach ($fieldMappings as $fieldMapping) { |
@@ -748,27 +748,27 @@ discard block |
||
748 | 748 | continue; |
749 | 749 | } |
750 | 750 | |
751 | - $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : ''); |
|
752 | - $param = '$' . $fieldMapping['fieldName']; |
|
751 | + $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : ''); |
|
752 | + $param = '$'.$fieldMapping['fieldName']; |
|
753 | 753 | $paramVariables[] = $param; |
754 | 754 | |
755 | 755 | if ($fieldMapping['type'] === 'datetime') { |
756 | - $param = $this->getType($fieldMapping['type']) . ' ' . $param; |
|
756 | + $param = $this->getType($fieldMapping['type']).' '.$param; |
|
757 | 757 | } |
758 | 758 | |
759 | - if (!empty($fieldMapping['nullable'])) { |
|
759 | + if ( ! empty($fieldMapping['nullable'])) { |
|
760 | 760 | $param .= ' = null'; |
761 | 761 | } |
762 | 762 | |
763 | 763 | $params[] = $param; |
764 | 764 | |
765 | - $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';'; |
|
765 | + $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';'; |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
769 | 769 | $paramTags = array_map( |
770 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
771 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
770 | + function($type, $variable) use ($maxParamTypeLength) { |
|
771 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
772 | 772 | }, |
773 | 773 | $paramTypes, |
774 | 774 | $paramVariables |
@@ -776,8 +776,8 @@ discard block |
||
776 | 776 | |
777 | 777 | // Generate multi line constructor if the signature exceeds 120 characters. |
778 | 778 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
779 | - $delimiter = "\n" . $this->spaces; |
|
780 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
779 | + $delimiter = "\n".$this->spaces; |
|
780 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
781 | 781 | } else { |
782 | 782 | $params = implode(', ', $params); |
783 | 783 | } |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | $replacements = [ |
786 | 786 | '<paramTags>' => implode("\n * ", $paramTags), |
787 | 787 | '<params>' => $params, |
788 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
788 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
789 | 789 | ]; |
790 | 790 | |
791 | 791 | $constructor = str_replace( |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | |
831 | 831 | if ($inClass) { |
832 | 832 | $inClass = false; |
833 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
833 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
834 | 834 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
835 | 835 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
836 | 836 | } |
@@ -838,16 +838,16 @@ discard block |
||
838 | 838 | if (T_NAMESPACE === $token[0]) { |
839 | 839 | $lastSeenNamespace = ''; |
840 | 840 | $inNamespace = true; |
841 | - } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) { |
|
841 | + } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) { |
|
842 | 842 | $inClass = true; |
843 | 843 | } elseif (T_FUNCTION === $token[0]) { |
844 | - if (T_STRING === $tokens[$i+2][0]) { |
|
845 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
846 | - } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) { |
|
847 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
844 | + if (T_STRING === $tokens[$i + 2][0]) { |
|
845 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
846 | + } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) { |
|
847 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
848 | 848 | } |
849 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) { |
|
850 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
849 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) { |
|
850 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
851 | 851 | } |
852 | 852 | } |
853 | 853 | } |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | */ |
861 | 861 | protected function hasProperty($property, ClassMetadata $metadata) |
862 | 862 | { |
863 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
863 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
864 | 864 | // don't generate property if its already on the base class. |
865 | 865 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
866 | 866 | if ($reflClass->hasProperty($property)) { |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | */ |
890 | 890 | protected function hasMethod($method, ClassMetadata $metadata) |
891 | 891 | { |
892 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
892 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
893 | 893 | // don't generate method if its already on the base class. |
894 | 894 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
895 | 895 | |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | */ |
921 | 921 | protected function getTraits(ClassMetadata $metadata) |
922 | 922 | { |
923 | - if (! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
923 | + if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
924 | 924 | return []; |
925 | 925 | } |
926 | 926 | |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | { |
971 | 971 | $refl = new \ReflectionClass($this->getClassToExtend()); |
972 | 972 | |
973 | - return '\\' . $refl->getName(); |
|
973 | + return '\\'.$refl->getName(); |
|
974 | 974 | } |
975 | 975 | |
976 | 976 | /** |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | { |
1004 | 1004 | $lines = []; |
1005 | 1005 | $lines[] = '/**'; |
1006 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
1006 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
1007 | 1007 | |
1008 | 1008 | if ($this->generateAnnotations) { |
1009 | 1009 | $lines[] = ' *'; |
@@ -1019,12 +1019,12 @@ discard block |
||
1019 | 1019 | |
1020 | 1020 | foreach ($methods as $method) { |
1021 | 1021 | if ($code = $this->$method($metadata)) { |
1022 | - $lines[] = ' * ' . $code; |
|
1022 | + $lines[] = ' * '.$code; |
|
1023 | 1023 | } |
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
1027 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
1027 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
1028 | 1028 | } |
1029 | 1029 | } |
1030 | 1030 | |
@@ -1040,17 +1040,17 @@ discard block |
||
1040 | 1040 | */ |
1041 | 1041 | protected function generateEntityAnnotation(ClassMetadata $metadata) |
1042 | 1042 | { |
1043 | - $prefix = '@' . $this->annotationsPrefix; |
|
1043 | + $prefix = '@'.$this->annotationsPrefix; |
|
1044 | 1044 | |
1045 | 1045 | if ($metadata->isEmbeddedClass) { |
1046 | - return $prefix . 'Embeddable'; |
|
1046 | + return $prefix.'Embeddable'; |
|
1047 | 1047 | } |
1048 | 1048 | |
1049 | 1049 | $customRepository = $metadata->customRepositoryClassName |
1050 | - ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")' |
|
1050 | + ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")' |
|
1051 | 1051 | : ''; |
1052 | 1052 | |
1053 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
1053 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
1054 | 1054 | } |
1055 | 1055 | |
1056 | 1056 | /** |
@@ -1067,28 +1067,28 @@ discard block |
||
1067 | 1067 | $table = []; |
1068 | 1068 | |
1069 | 1069 | if (isset($metadata->table['schema'])) { |
1070 | - $table[] = 'schema="' . $metadata->table['schema'] . '"'; |
|
1070 | + $table[] = 'schema="'.$metadata->table['schema'].'"'; |
|
1071 | 1071 | } |
1072 | 1072 | |
1073 | 1073 | if (isset($metadata->table['name'])) { |
1074 | - $table[] = 'name="' . $metadata->table['name'] . '"'; |
|
1074 | + $table[] = 'name="'.$metadata->table['name'].'"'; |
|
1075 | 1075 | } |
1076 | 1076 | |
1077 | 1077 | if (isset($metadata->table['options']) && $metadata->table['options']) { |
1078 | - $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}'; |
|
1078 | + $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}'; |
|
1079 | 1079 | } |
1080 | 1080 | |
1081 | 1081 | if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { |
1082 | 1082 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); |
1083 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
1083 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
1084 | 1084 | } |
1085 | 1085 | |
1086 | 1086 | if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { |
1087 | 1087 | $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']); |
1088 | - $table[] = 'indexes={' . $constraints . '}'; |
|
1088 | + $table[] = 'indexes={'.$constraints.'}'; |
|
1089 | 1089 | } |
1090 | 1090 | |
1091 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
1091 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | /** |
@@ -1103,9 +1103,9 @@ discard block |
||
1103 | 1103 | foreach ($constraints as $name => $constraint) { |
1104 | 1104 | $columns = []; |
1105 | 1105 | foreach ($constraint['columns'] as $column) { |
1106 | - $columns[] = '"' . $column . '"'; |
|
1106 | + $columns[] = '"'.$column.'"'; |
|
1107 | 1107 | } |
1108 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
1108 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | return implode(', ', $annotations); |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | return ''; |
1123 | 1123 | } |
1124 | 1124 | |
1125 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1125 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1126 | 1126 | } |
1127 | 1127 | |
1128 | 1128 | /** |
@@ -1137,11 +1137,11 @@ discard block |
||
1137 | 1137 | } |
1138 | 1138 | |
1139 | 1139 | $discrColumn = $metadata->discriminatorColumn; |
1140 | - $columnDefinition = 'name="' . $discrColumn['name'] |
|
1141 | - . '", type="' . $discrColumn['type'] |
|
1142 | - . '", length=' . $discrColumn['length']; |
|
1140 | + $columnDefinition = 'name="'.$discrColumn['name'] |
|
1141 | + . '", type="'.$discrColumn['type'] |
|
1142 | + . '", length='.$discrColumn['length']; |
|
1143 | 1143 | |
1144 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
1144 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
1145 | 1145 | } |
1146 | 1146 | |
1147 | 1147 | /** |
@@ -1158,10 +1158,10 @@ discard block |
||
1158 | 1158 | $inheritanceClassMap = []; |
1159 | 1159 | |
1160 | 1160 | foreach ($metadata->discriminatorMap as $type => $class) { |
1161 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
1161 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
1162 | 1162 | } |
1163 | 1163 | |
1164 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
1164 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
1165 | 1165 | } |
1166 | 1166 | |
1167 | 1167 | /** |
@@ -1180,8 +1180,8 @@ discard block |
||
1180 | 1180 | |
1181 | 1181 | $nullableField = $this->nullableFieldExpression($fieldMapping); |
1182 | 1182 | |
1183 | - if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable) |
|
1184 | - && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadata::GENERATOR_TYPE_NONE) |
|
1183 | + if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
1184 | + && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadata::GENERATOR_TYPE_NONE) |
|
1185 | 1185 | && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField) |
1186 | 1186 | ) { |
1187 | 1187 | $methods[] = $code; |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | foreach ($joinColumns as $joinColumn) { |
1255 | - if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) { |
|
1255 | + if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) { |
|
1256 | 1256 | return false; |
1257 | 1257 | } |
1258 | 1258 | } |
@@ -1297,8 +1297,8 @@ discard block |
||
1297 | 1297 | } |
1298 | 1298 | |
1299 | 1299 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1300 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
|
1301 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1300 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName'] |
|
1301 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n"; |
|
1302 | 1302 | } |
1303 | 1303 | |
1304 | 1304 | return implode("\n", $lines); |
@@ -1322,8 +1322,8 @@ discard block |
||
1322 | 1322 | } |
1323 | 1323 | |
1324 | 1324 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1325 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
|
1326 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1325 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'] |
|
1326 | + . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n"; |
|
1327 | 1327 | } |
1328 | 1328 | |
1329 | 1329 | return implode("\n", $lines); |
@@ -1344,7 +1344,7 @@ discard block |
||
1344 | 1344 | } |
1345 | 1345 | |
1346 | 1346 | $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass); |
1347 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n"; |
|
1347 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n"; |
|
1348 | 1348 | } |
1349 | 1349 | |
1350 | 1350 | return implode("\n", $lines); |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | */ |
1362 | 1362 | protected function generateEntityStubMethod(ClassMetadata $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
1363 | 1363 | { |
1364 | - $methodName = $type . Inflector::classify($fieldName); |
|
1364 | + $methodName = $type.Inflector::classify($fieldName); |
|
1365 | 1365 | $variableName = Inflector::camelize($fieldName); |
1366 | 1366 | if (in_array($type, ["add", "remove"])) { |
1367 | 1367 | $methodName = Inflector::singularize($methodName); |
@@ -1381,18 +1381,18 @@ discard block |
||
1381 | 1381 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
1382 | 1382 | |
1383 | 1383 | if ($typeHint && ! isset($types[$typeHint])) { |
1384 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
1385 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
1384 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
1385 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
1386 | 1386 | } |
1387 | 1387 | |
1388 | 1388 | $replacements = [ |
1389 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1389 | + '<description>' => ucfirst($type).' '.$variableName.'.', |
|
1390 | 1390 | '<methodTypeHint>' => $methodTypeHint, |
1391 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1391 | + '<variableType>' => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''), |
|
1392 | 1392 | '<variableName>' => $variableName, |
1393 | 1393 | '<methodName>' => $methodName, |
1394 | 1394 | '<fieldName>' => $fieldName, |
1395 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1395 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
1396 | 1396 | '<entity>' => $this->getClassName($metadata) |
1397 | 1397 | ]; |
1398 | 1398 | |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | $this->staticReflection[$metadata->name]['methods'][] = $methodName; |
1422 | 1422 | |
1423 | 1423 | $replacements = [ |
1424 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
1424 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
1425 | 1425 | '<methodName>' => $methodName, |
1426 | 1426 | ]; |
1427 | 1427 | |
@@ -1444,30 +1444,30 @@ discard block |
||
1444 | 1444 | $joinColumnAnnot = []; |
1445 | 1445 | |
1446 | 1446 | if (isset($joinColumn['name'])) { |
1447 | - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; |
|
1447 | + $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"'; |
|
1448 | 1448 | } |
1449 | 1449 | |
1450 | 1450 | if (isset($joinColumn['referencedColumnName'])) { |
1451 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; |
|
1451 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"'; |
|
1452 | 1452 | } |
1453 | 1453 | |
1454 | 1454 | if (isset($joinColumn['unique']) && $joinColumn['unique']) { |
1455 | - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); |
|
1455 | + $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false'); |
|
1456 | 1456 | } |
1457 | 1457 | |
1458 | 1458 | if (isset($joinColumn['nullable'])) { |
1459 | - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); |
|
1459 | + $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false'); |
|
1460 | 1460 | } |
1461 | 1461 | |
1462 | 1462 | if (isset($joinColumn['onDelete'])) { |
1463 | - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); |
|
1463 | + $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"'); |
|
1464 | 1464 | } |
1465 | 1465 | |
1466 | 1466 | if (isset($joinColumn['columnDefinition'])) { |
1467 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; |
|
1467 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"'; |
|
1468 | 1468 | } |
1469 | 1469 | |
1470 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
1470 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
1471 | 1471 | } |
1472 | 1472 | |
1473 | 1473 | /** |
@@ -1479,22 +1479,22 @@ discard block |
||
1479 | 1479 | protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadata $metadata) |
1480 | 1480 | { |
1481 | 1481 | $lines = []; |
1482 | - $lines[] = $this->spaces . '/**'; |
|
1482 | + $lines[] = $this->spaces.'/**'; |
|
1483 | 1483 | |
1484 | 1484 | if ($associationMapping['type'] & ClassMetadata::TO_MANY) { |
1485 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
1485 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
1486 | 1486 | } else { |
1487 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\'); |
|
1487 | + $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\'); |
|
1488 | 1488 | } |
1489 | 1489 | |
1490 | 1490 | if ($this->generateAnnotations) { |
1491 | - $lines[] = $this->spaces . ' *'; |
|
1491 | + $lines[] = $this->spaces.' *'; |
|
1492 | 1492 | |
1493 | 1493 | if (isset($associationMapping['id']) && $associationMapping['id']) { |
1494 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1494 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1495 | 1495 | |
1496 | 1496 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1497 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1497 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1498 | 1498 | } |
1499 | 1499 | } |
1500 | 1500 | |
@@ -1516,15 +1516,15 @@ discard block |
||
1516 | 1516 | $typeOptions = []; |
1517 | 1517 | |
1518 | 1518 | if (isset($associationMapping['targetEntity'])) { |
1519 | - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; |
|
1519 | + $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"'; |
|
1520 | 1520 | } |
1521 | 1521 | |
1522 | 1522 | if (isset($associationMapping['inversedBy'])) { |
1523 | - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; |
|
1523 | + $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"'; |
|
1524 | 1524 | } |
1525 | 1525 | |
1526 | 1526 | if (isset($associationMapping['mappedBy'])) { |
1527 | - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; |
|
1527 | + $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"'; |
|
1528 | 1528 | } |
1529 | 1529 | |
1530 | 1530 | if ($associationMapping['cascade']) { |
@@ -1540,11 +1540,11 @@ discard block |
||
1540 | 1540 | $cascades = ['"all"']; |
1541 | 1541 | } |
1542 | 1542 | |
1543 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
1543 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
1544 | 1544 | } |
1545 | 1545 | |
1546 | 1546 | if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { |
1547 | - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1547 | + $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1548 | 1548 | } |
1549 | 1549 | |
1550 | 1550 | if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadata::FETCH_LAZY) { |
@@ -1553,71 +1553,71 @@ discard block |
||
1553 | 1553 | ClassMetadata::FETCH_EAGER => 'EAGER', |
1554 | 1554 | ]; |
1555 | 1555 | |
1556 | - $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"'; |
|
1556 | + $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"'; |
|
1557 | 1557 | } |
1558 | 1558 | |
1559 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
1559 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
1560 | 1560 | |
1561 | 1561 | if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { |
1562 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
1562 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
1563 | 1563 | |
1564 | 1564 | $joinColumnsLines = []; |
1565 | 1565 | |
1566 | 1566 | foreach ($associationMapping['joinColumns'] as $joinColumn) { |
1567 | 1567 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
1568 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
1568 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
1569 | 1569 | } |
1570 | 1570 | } |
1571 | 1571 | |
1572 | 1572 | $lines[] = implode(",\n", $joinColumnsLines); |
1573 | - $lines[] = $this->spaces . ' * })'; |
|
1573 | + $lines[] = $this->spaces.' * })'; |
|
1574 | 1574 | } |
1575 | 1575 | |
1576 | 1576 | if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { |
1577 | 1577 | $joinTable = []; |
1578 | - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; |
|
1578 | + $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"'; |
|
1579 | 1579 | |
1580 | 1580 | if (isset($associationMapping['joinTable']['schema'])) { |
1581 | - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; |
|
1581 | + $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"'; |
|
1582 | 1582 | } |
1583 | 1583 | |
1584 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; |
|
1585 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
1584 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).','; |
|
1585 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
1586 | 1586 | |
1587 | 1587 | $joinColumnsLines = []; |
1588 | 1588 | |
1589 | 1589 | foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { |
1590 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1590 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1591 | 1591 | } |
1592 | 1592 | |
1593 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
1594 | - $lines[] = $this->spaces . ' * },'; |
|
1595 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
1593 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
1594 | + $lines[] = $this->spaces.' * },'; |
|
1595 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
1596 | 1596 | |
1597 | 1597 | $inverseJoinColumnsLines = []; |
1598 | 1598 | |
1599 | 1599 | foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { |
1600 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1600 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1601 | 1601 | } |
1602 | 1602 | |
1603 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
1604 | - $lines[] = $this->spaces . ' * }'; |
|
1605 | - $lines[] = $this->spaces . ' * )'; |
|
1603 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
1604 | + $lines[] = $this->spaces.' * }'; |
|
1605 | + $lines[] = $this->spaces.' * )'; |
|
1606 | 1606 | } |
1607 | 1607 | |
1608 | 1608 | if (isset($associationMapping['orderBy'])) { |
1609 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
1609 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
1610 | 1610 | |
1611 | 1611 | foreach ($associationMapping['orderBy'] as $name => $direction) { |
1612 | - $lines[] = $this->spaces . ' * "' . $name . '"="' . $direction . '",'; |
|
1612 | + $lines[] = $this->spaces.' * "'.$name.'"="'.$direction.'",'; |
|
1613 | 1613 | } |
1614 | 1614 | |
1615 | 1615 | $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); |
1616 | - $lines[] = $this->spaces . ' * })'; |
|
1616 | + $lines[] = $this->spaces.' * })'; |
|
1617 | 1617 | } |
1618 | 1618 | } |
1619 | 1619 | |
1620 | - $lines[] = $this->spaces . ' */'; |
|
1620 | + $lines[] = $this->spaces.' */'; |
|
1621 | 1621 | |
1622 | 1622 | return implode("\n", $lines); |
1623 | 1623 | } |
@@ -1631,43 +1631,43 @@ discard block |
||
1631 | 1631 | protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadata $metadata) |
1632 | 1632 | { |
1633 | 1633 | $lines = []; |
1634 | - $lines[] = $this->spaces . '/**'; |
|
1635 | - $lines[] = $this->spaces . ' * @var ' |
|
1634 | + $lines[] = $this->spaces.'/**'; |
|
1635 | + $lines[] = $this->spaces.' * @var ' |
|
1636 | 1636 | . $this->getType($fieldMapping['type']) |
1637 | 1637 | . ($this->nullableFieldExpression($fieldMapping) ? '|null' : ''); |
1638 | 1638 | |
1639 | 1639 | if ($this->generateAnnotations) { |
1640 | - $lines[] = $this->spaces . ' *'; |
|
1640 | + $lines[] = $this->spaces.' *'; |
|
1641 | 1641 | |
1642 | 1642 | $column = []; |
1643 | 1643 | if (isset($fieldMapping['columnName'])) { |
1644 | - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; |
|
1644 | + $column[] = 'name="'.$fieldMapping['columnName'].'"'; |
|
1645 | 1645 | } |
1646 | 1646 | |
1647 | 1647 | if (isset($fieldMapping['type'])) { |
1648 | - $column[] = 'type="' . $fieldMapping['type'] . '"'; |
|
1648 | + $column[] = 'type="'.$fieldMapping['type'].'"'; |
|
1649 | 1649 | } |
1650 | 1650 | |
1651 | 1651 | if (isset($fieldMapping['length'])) { |
1652 | - $column[] = 'length=' . $fieldMapping['length']; |
|
1652 | + $column[] = 'length='.$fieldMapping['length']; |
|
1653 | 1653 | } |
1654 | 1654 | |
1655 | 1655 | if (isset($fieldMapping['precision'])) { |
1656 | - $column[] = 'precision=' . $fieldMapping['precision']; |
|
1656 | + $column[] = 'precision='.$fieldMapping['precision']; |
|
1657 | 1657 | } |
1658 | 1658 | |
1659 | 1659 | if (isset($fieldMapping['scale'])) { |
1660 | - $column[] = 'scale=' . $fieldMapping['scale']; |
|
1660 | + $column[] = 'scale='.$fieldMapping['scale']; |
|
1661 | 1661 | } |
1662 | 1662 | |
1663 | 1663 | if (isset($fieldMapping['nullable'])) { |
1664 | - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); |
|
1664 | + $column[] = 'nullable='.var_export($fieldMapping['nullable'], true); |
|
1665 | 1665 | } |
1666 | 1666 | |
1667 | 1667 | $options = []; |
1668 | 1668 | |
1669 | 1669 | if (isset($fieldMapping['options']['default']) && $fieldMapping['options']['default']) { |
1670 | - $options[] = '"default"="' . $fieldMapping['options']['default'] .'"'; |
|
1670 | + $options[] = '"default"="'.$fieldMapping['options']['default'].'"'; |
|
1671 | 1671 | } |
1672 | 1672 | |
1673 | 1673 | if (isset($fieldMapping['options']['unsigned']) && $fieldMapping['options']['unsigned']) { |
@@ -1679,15 +1679,15 @@ discard block |
||
1679 | 1679 | } |
1680 | 1680 | |
1681 | 1681 | if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) { |
1682 | - $options[] = '"comment"="' . $fieldMapping['options']['comment'] .'"'; |
|
1682 | + $options[] = '"comment"="'.$fieldMapping['options']['comment'].'"'; |
|
1683 | 1683 | } |
1684 | 1684 | |
1685 | 1685 | if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) { |
1686 | - $options[] = '"collation"="' . $fieldMapping['options']['collation'] .'"'; |
|
1686 | + $options[] = '"collation"="'.$fieldMapping['options']['collation'].'"'; |
|
1687 | 1687 | } |
1688 | 1688 | |
1689 | 1689 | if (isset($fieldMapping['options']['check']) && $fieldMapping['options']['check']) { |
1690 | - $options[] = '"check"="' . $fieldMapping['options']['check'] .'"'; |
|
1690 | + $options[] = '"check"="'.$fieldMapping['options']['check'].'"'; |
|
1691 | 1691 | } |
1692 | 1692 | |
1693 | 1693 | if ($options) { |
@@ -1695,47 +1695,47 @@ discard block |
||
1695 | 1695 | } |
1696 | 1696 | |
1697 | 1697 | if (isset($fieldMapping['columnDefinition'])) { |
1698 | - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; |
|
1698 | + $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"'; |
|
1699 | 1699 | } |
1700 | 1700 | |
1701 | 1701 | if (isset($fieldMapping['unique'])) { |
1702 | - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); |
|
1702 | + $column[] = 'unique='.var_export($fieldMapping['unique'], true); |
|
1703 | 1703 | } |
1704 | 1704 | |
1705 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
1705 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
1706 | 1706 | |
1707 | 1707 | if (isset($fieldMapping['id']) && $fieldMapping['id']) { |
1708 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1708 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1709 | 1709 | |
1710 | 1710 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1711 | - $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1711 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1712 | 1712 | } |
1713 | 1713 | |
1714 | 1714 | if ($metadata->sequenceGeneratorDefinition) { |
1715 | 1715 | $sequenceGenerator = []; |
1716 | 1716 | |
1717 | 1717 | if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { |
1718 | - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; |
|
1718 | + $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"'; |
|
1719 | 1719 | } |
1720 | 1720 | |
1721 | 1721 | if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { |
1722 | - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1722 | + $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1723 | 1723 | } |
1724 | 1724 | |
1725 | 1725 | if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { |
1726 | - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; |
|
1726 | + $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue']; |
|
1727 | 1727 | } |
1728 | 1728 | |
1729 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; |
|
1729 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')'; |
|
1730 | 1730 | } |
1731 | 1731 | } |
1732 | 1732 | |
1733 | 1733 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
1734 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
1734 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
1735 | 1735 | } |
1736 | 1736 | } |
1737 | 1737 | |
1738 | - $lines[] = $this->spaces . ' */'; |
|
1738 | + $lines[] = $this->spaces.' */'; |
|
1739 | 1739 | |
1740 | 1740 | return implode("\n", $lines); |
1741 | 1741 | } |
@@ -1748,27 +1748,27 @@ discard block |
||
1748 | 1748 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass) |
1749 | 1749 | { |
1750 | 1750 | $lines = []; |
1751 | - $lines[] = $this->spaces . '/**'; |
|
1752 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
1751 | + $lines[] = $this->spaces.'/**'; |
|
1752 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
1753 | 1753 | |
1754 | 1754 | if ($this->generateAnnotations) { |
1755 | - $lines[] = $this->spaces . ' *'; |
|
1755 | + $lines[] = $this->spaces.' *'; |
|
1756 | 1756 | |
1757 | - $embedded = ['class="' . $embeddedClass['class'] . '"']; |
|
1757 | + $embedded = ['class="'.$embeddedClass['class'].'"']; |
|
1758 | 1758 | |
1759 | 1759 | if (isset($embeddedClass['columnPrefix'])) { |
1760 | 1760 | if (is_string($embeddedClass['columnPrefix'])) { |
1761 | - $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"'; |
|
1761 | + $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"'; |
|
1762 | 1762 | } else { |
1763 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
1763 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
1764 | 1764 | } |
1765 | 1765 | } |
1766 | 1766 | |
1767 | - $lines[] = $this->spaces . ' * @' . |
|
1768 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
1767 | + $lines[] = $this->spaces.' * @'. |
|
1768 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
1769 | 1769 | } |
1770 | 1770 | |
1771 | - $lines[] = $this->spaces . ' */'; |
|
1771 | + $lines[] = $this->spaces.' */'; |
|
1772 | 1772 | |
1773 | 1773 | return implode("\n", $lines); |
1774 | 1774 | } |
@@ -1782,13 +1782,13 @@ discard block |
||
1782 | 1782 | $processedClasses = []; |
1783 | 1783 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
1784 | 1784 | foreach ($eventListeners as $eventListener) { |
1785 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
1785 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
1786 | 1786 | } |
1787 | 1787 | } |
1788 | 1788 | |
1789 | 1789 | return \sprintf( |
1790 | 1790 | '%s%s({%s})', |
1791 | - '@' . $this->annotationsPrefix, |
|
1791 | + '@'.$this->annotationsPrefix, |
|
1792 | 1792 | 'EntityListeners', |
1793 | 1793 | \implode(',', \array_unique($processedClasses)) |
1794 | 1794 | ); |
@@ -1806,7 +1806,7 @@ discard block |
||
1806 | 1806 | |
1807 | 1807 | foreach ($lines as $key => $value) { |
1808 | 1808 | if ( ! empty($value)) { |
1809 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1809 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1810 | 1810 | } |
1811 | 1811 | } |
1812 | 1812 | |
@@ -1888,9 +1888,9 @@ discard block |
||
1888 | 1888 | |
1889 | 1889 | foreach ($options as $name => $option) { |
1890 | 1890 | if (is_array($option)) { |
1891 | - $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}'; |
|
1891 | + $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}'; |
|
1892 | 1892 | } else { |
1893 | - $optionsStr[] = '"' . $name . '"="' . (string) $option . '"'; |
|
1893 | + $optionsStr[] = '"'.$name.'"="'.(string) $option.'"'; |
|
1894 | 1894 | } |
1895 | 1895 | } |
1896 | 1896 |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function exportClassMetadata(ClassMetadata $metadata) |
43 | 43 | { |
44 | - $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping ' . |
|
45 | - 'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" ' . |
|
46 | - 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . |
|
44 | + $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping '. |
|
45 | + 'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" '. |
|
46 | + 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '. |
|
47 | 47 | 'xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd" />'); |
48 | 48 | |
49 | 49 | if ($metadata->isMappedSuperclass) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy); |
100 | 100 | |
101 | - if ( $trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
101 | + if ($trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
102 | 102 | $root->addChild('change-tracking-policy', $trackingPolicy); |
103 | 103 | } |
104 | 104 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | if (count($cascade) === 5) { |
300 | - $cascade = ['cascade-all']; |
|
300 | + $cascade = ['cascade-all']; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | if ($cascade) { |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | } |
380 | 380 | } |
381 | 381 | |
382 | - if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) { |
|
382 | + if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) { |
|
383 | 383 | $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks'); |
384 | 384 | |
385 | 385 | foreach ($metadata->lifecycleCallbacks as $name => $methods) { |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | { |
431 | 431 | $sequenceDefinition = $metadata->sequenceGeneratorDefinition; |
432 | 432 | |
433 | - if (! ($metadata->generatorType === ClassMetadata::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
433 | + if ( ! ($metadata->generatorType === ClassMetadata::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
434 | 434 | return; |
435 | 435 | } |
436 | 436 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | protected function _generateOutputPath(ClassMetadata $metadata) |
67 | 67 | { |
68 | - return $this->_outputDir . '/' . str_replace('\\', '/', $metadata->name) . $this->_extension; |
|
68 | + return $this->_outputDir.'/'.str_replace('\\', '/', $metadata->name).$this->_extension; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -51,27 +51,27 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($metadata->inheritanceType) { |
54 | - $lines[] = '$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_' . $this->_getInheritanceTypeString($metadata->inheritanceType) . ');'; |
|
54 | + $lines[] = '$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_'.$this->_getInheritanceTypeString($metadata->inheritanceType).');'; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if ($metadata->customRepositoryClassName) { |
58 | - $lines[] = "\$metadata->customRepositoryClassName = '" . $metadata->customRepositoryClassName . "';"; |
|
58 | + $lines[] = "\$metadata->customRepositoryClassName = '".$metadata->customRepositoryClassName."';"; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if ($metadata->table) { |
62 | - $lines[] = '$metadata->setPrimaryTable(' . $this->_varExport($metadata->table) . ');'; |
|
62 | + $lines[] = '$metadata->setPrimaryTable('.$this->_varExport($metadata->table).');'; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if ($metadata->discriminatorColumn) { |
66 | - $lines[] = '$metadata->setDiscriminatorColumn(' . $this->_varExport($metadata->discriminatorColumn) . ');'; |
|
66 | + $lines[] = '$metadata->setDiscriminatorColumn('.$this->_varExport($metadata->discriminatorColumn).');'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | if ($metadata->discriminatorMap) { |
70 | - $lines[] = '$metadata->setDiscriminatorMap(' . $this->_varExport($metadata->discriminatorMap) . ');'; |
|
70 | + $lines[] = '$metadata->setDiscriminatorMap('.$this->_varExport($metadata->discriminatorMap).');'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if ($metadata->changeTrackingPolicy) { |
74 | - $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_' . $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy) . ');'; |
|
74 | + $lines[] = '$metadata->setChangeTrackingPolicy(ClassMetadata::CHANGETRACKING_'.$this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy).');'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | if ($metadata->lifecycleCallbacks) { |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | $lines = array_merge($lines, $this->processEntityListeners($metadata)); |
86 | 86 | |
87 | 87 | foreach ($metadata->fieldMappings as $fieldMapping) { |
88 | - $lines[] = '$metadata->mapField(' . $this->_varExport($fieldMapping) . ');'; |
|
88 | + $lines[] = '$metadata->mapField('.$this->_varExport($fieldMapping).');'; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | if ( ! $metadata->isIdentifierComposite && $generatorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { |
92 | - $lines[] = '$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_' . $generatorType . ');'; |
|
92 | + $lines[] = '$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_'.$generatorType.');'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | foreach ($metadata->associationMappings as $associationMapping) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray); |
156 | 156 | } |
157 | 157 | |
158 | - $lines[] = '$metadata->' . $method . '(' . $this->_varExport($associationMappingArray) . ');'; |
|
158 | + $lines[] = '$metadata->'.$method.'('.$this->_varExport($associationMappingArray).');'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return implode("\n", $lines); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | protected function _varExport($var) |
170 | 170 | { |
171 | 171 | $export = var_export($var, true); |
172 | - $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export); |
|
172 | + $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export); |
|
173 | 173 | $export = str_replace(' ', ' ', $export); |
174 | 174 | $export = str_replace('array (', 'array(', $export); |
175 | 175 | $export = str_replace('array( ', 'array(', $export); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if ( ! is_dir($dir)) { |
142 | 142 | mkdir($dir, 0775, true); |
143 | 143 | } |
144 | - if (file_exists($path) && !$this->_overwriteExistingFiles) { |
|
144 | + if (file_exists($path) && ! $this->_overwriteExistingFiles) { |
|
145 | 145 | throw ExportException::attemptOverwriteExistingFile($path); |
146 | 146 | } |
147 | 147 | file_put_contents($path, $output); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | protected function _generateOutputPath(ClassMetadata $metadata) |
161 | 161 | { |
162 | - return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension; |
|
162 | + return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -89,66 +89,66 @@ discard block |
||
89 | 89 | $cmf = $this->em->getMetadataFactory(); |
90 | 90 | |
91 | 91 | foreach ($class->fieldMappings as $fieldName => $mapping) { |
92 | - if (!Type::hasType($mapping['type'])) { |
|
93 | - $ce[] = "The field '" . $class->name . "#" . $fieldName."' uses a non-existent type '" . $mapping['type'] . "'."; |
|
92 | + if ( ! Type::hasType($mapping['type'])) { |
|
93 | + $ce[] = "The field '".$class->name."#".$fieldName."' uses a non-existent type '".$mapping['type']."'."; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | 97 | foreach ($class->associationMappings as $fieldName => $assoc) { |
98 | - if (!class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
99 | - $ce[] = "The target entity '" . $assoc['targetEntity'] . "' specified on " . $class->name . '#' . $fieldName . ' is unknown or not an entity.'; |
|
98 | + if ( ! class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
99 | + $ce[] = "The target entity '".$assoc['targetEntity']."' specified on ".$class->name.'#'.$fieldName.' is unknown or not an entity.'; |
|
100 | 100 | |
101 | 101 | return $ce; |
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($assoc['mappedBy'] && $assoc['inversedBy']) { |
105 | - $ce[] = "The association " . $class . "#" . $fieldName . " cannot be defined as both inverse and owning."; |
|
105 | + $ce[] = "The association ".$class."#".$fieldName." cannot be defined as both inverse and owning."; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | $targetMetadata = $cmf->getMetadataFor($assoc['targetEntity']); |
109 | 109 | |
110 | 110 | if (isset($assoc['id']) && $targetMetadata->containsForeignIdentifier) { |
111 | - $ce[] = "Cannot map association '" . $class->name. "#". $fieldName ." as identifier, because " . |
|
112 | - "the target entity '". $targetMetadata->name . "' also maps an association as identifier."; |
|
111 | + $ce[] = "Cannot map association '".$class->name."#".$fieldName." as identifier, because ". |
|
112 | + "the target entity '".$targetMetadata->name."' also maps an association as identifier."; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if ($assoc['mappedBy']) { |
116 | 116 | if ($targetMetadata->hasField($assoc['mappedBy'])) { |
117 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
118 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which is not defined as association, but as field."; |
|
117 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
118 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which is not defined as association, but as field."; |
|
119 | 119 | } |
120 | - if (!$targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
121 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
122 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which does not exist."; |
|
120 | + if ( ! $targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
121 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
122 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which does not exist."; |
|
123 | 123 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] == null) { |
124 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the inverse side of a ". |
|
124 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the inverse side of a ". |
|
125 | 125 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
126 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
127 | - "'inversedBy=\"" . $fieldName . "\"' attribute."; |
|
126 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
127 | + "'inversedBy=\"".$fieldName."\"' attribute."; |
|
128 | 128 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] != $fieldName) { |
129 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
130 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " are ". |
|
129 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
130 | + $assoc['targetEntity']."#".$assoc['mappedBy']." are ". |
|
131 | 131 | "inconsistent with each other."; |
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($assoc['inversedBy']) { |
136 | 136 | if ($targetMetadata->hasField($assoc['inversedBy'])) { |
137 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
138 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which is not defined as association."; |
|
137 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
138 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which is not defined as association."; |
|
139 | 139 | } |
140 | 140 | |
141 | - if (!$targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
142 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
143 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which does not exist."; |
|
141 | + if ( ! $targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
142 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
143 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which does not exist."; |
|
144 | 144 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] == null) { |
145 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the owning side of a ". |
|
145 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the owning side of a ". |
|
146 | 146 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
147 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
147 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
148 | 148 | "'inversedBy' attribute."; |
149 | 149 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] != $fieldName) { |
150 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
151 | - $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " are ". |
|
150 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
151 | + $assoc['targetEntity']."#".$assoc['inversedBy']." are ". |
|
152 | 152 | "inconsistent with each other."; |
153 | 153 | } |
154 | 154 | |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | if (array_key_exists($assoc['inversedBy'], $targetMetadata->associationMappings)) { |
157 | 157 | $targetAssoc = $targetMetadata->associationMappings[$assoc['inversedBy']]; |
158 | 158 | if ($assoc['type'] == ClassMetadata::ONE_TO_ONE && $targetAssoc['type'] !== ClassMetadata::ONE_TO_ONE) { |
159 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is one-to-one, then the inversed " . |
|
160 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-one as well."; |
|
159 | + $ce[] = "If association ".$class->name."#".$fieldName." is one-to-one, then the inversed ". |
|
160 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-one as well."; |
|
161 | 161 | } elseif ($assoc['type'] == ClassMetadata::MANY_TO_ONE && $targetAssoc['type'] !== ClassMetadata::ONE_TO_MANY) { |
162 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-one, then the inversed " . |
|
163 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-many."; |
|
162 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-one, then the inversed ". |
|
163 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-many."; |
|
164 | 164 | } elseif ($assoc['type'] == ClassMetadata::MANY_TO_MANY && $targetAssoc['type'] !== ClassMetadata::MANY_TO_MANY) { |
165 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-many, then the inversed " . |
|
166 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be many-to-many as well."; |
|
165 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-many, then the inversed ". |
|
166 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be many-to-many as well."; |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | if ($assoc['type'] == ClassMetadata::MANY_TO_MANY) { |
173 | 173 | $identifierColumns = $class->getIdentifierColumnNames(); |
174 | 174 | foreach ($assoc['joinTable']['joinColumns'] as $joinColumn) { |
175 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
176 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
175 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
176 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
177 | 177 | "has to be a primary key column on the target entity class '".$class->name."'."; |
178 | 178 | break; |
179 | 179 | } |
@@ -181,32 +181,32 @@ discard block |
||
181 | 181 | |
182 | 182 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
183 | 183 | foreach ($assoc['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { |
184 | - if (!in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
185 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
184 | + if ( ! in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
185 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
186 | 186 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
187 | 187 | break; |
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | 191 | if (count($targetMetadata->getIdentifierColumnNames()) != count($assoc['joinTable']['inverseJoinColumns'])) { |
192 | - $ce[] = "The inverse join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
193 | - "have to contain to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
194 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))) . |
|
192 | + $ce[] = "The inverse join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
193 | + "have to contain to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
194 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))). |
|
195 | 195 | "' are missing."; |
196 | 196 | } |
197 | 197 | |
198 | 198 | if (count($class->getIdentifierColumnNames()) != count($assoc['joinTable']['joinColumns'])) { |
199 | - $ce[] = "The join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
200 | - "have to contain to ALL identifier columns of the source entity '". $class->name . "', " . |
|
201 | - "however '" . implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))) . |
|
199 | + $ce[] = "The join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
200 | + "have to contain to ALL identifier columns of the source entity '".$class->name."', ". |
|
201 | + "however '".implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))). |
|
202 | 202 | "' are missing."; |
203 | 203 | } |
204 | 204 | |
205 | 205 | } elseif ($assoc['type'] & ClassMetadata::TO_ONE) { |
206 | 206 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
207 | 207 | foreach ($assoc['joinColumns'] as $joinColumn) { |
208 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
209 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
208 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
209 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
210 | 210 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
211 | 211 | } |
212 | 212 | } |
@@ -218,9 +218,9 @@ discard block |
||
218 | 218 | $ids[] = $joinColumn['name']; |
219 | 219 | } |
220 | 220 | |
221 | - $ce[] = "The join columns of the association '" . $assoc['fieldName'] . "' " . |
|
222 | - "have to match to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
223 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)) . |
|
221 | + $ce[] = "The join columns of the association '".$assoc['fieldName']."' ". |
|
222 | + "have to match to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
223 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)). |
|
224 | 224 | "' are missing."; |
225 | 225 | } |
226 | 226 | } |
@@ -228,19 +228,19 @@ discard block |
||
228 | 228 | |
229 | 229 | if (isset($assoc['orderBy']) && $assoc['orderBy'] !== null) { |
230 | 230 | foreach ($assoc['orderBy'] as $orderField => $orientation) { |
231 | - if (!$targetMetadata->hasField($orderField) && !$targetMetadata->hasAssociation($orderField)) { |
|
232 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a foreign field " . |
|
233 | - $orderField . " that is not a field on the target entity " . $targetMetadata->name . "."; |
|
231 | + if ( ! $targetMetadata->hasField($orderField) && ! $targetMetadata->hasAssociation($orderField)) { |
|
232 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a foreign field ". |
|
233 | + $orderField." that is not a field on the target entity ".$targetMetadata->name."."; |
|
234 | 234 | continue; |
235 | 235 | } |
236 | 236 | if ($targetMetadata->isCollectionValuedAssociation($orderField)) { |
237 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
238 | - $orderField . " on " . $targetMetadata->name . " that is a collection-valued association."; |
|
237 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
238 | + $orderField." on ".$targetMetadata->name." that is a collection-valued association."; |
|
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | if ($targetMetadata->isAssociationInverseSide($orderField)) { |
242 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
243 | - $orderField . " on " . $targetMetadata->name . " that is the inverse side of an association."; |
|
242 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
243 | + $orderField." on ".$targetMetadata->name." that is the inverse side of an association."; |
|
244 | 244 | continue; |
245 | 245 | } |
246 | 246 | } |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | } |
249 | 249 | |
250 | 250 | foreach ($class->subClasses as $subClass) { |
251 | - if (!in_array($class->name, class_parents($subClass))) { |
|
252 | - $ce[] = "According to the discriminator map class '" . $subClass . "' has to be a child ". |
|
253 | - "of '" . $class->name . "' but these entities are not related through inheritance."; |
|
251 | + if ( ! in_array($class->name, class_parents($subClass))) { |
|
252 | + $ce[] = "According to the discriminator map class '".$subClass."' has to be a child ". |
|
253 | + "of '".$class->name."' but these entities are not related through inheritance."; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $methods = []; |
36 | 36 | |
37 | 37 | foreach ($class->getMethods() as $method) { |
38 | - if ($method->isConstructor() || $method->isStatic() || !$method->isPublic() || $method->getName() === 'getHydrator') { |
|
38 | + if ($method->isConstructor() || $method->isStatic() || ! $method->isPublic() || $method->getName() === 'getHydrator') { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters) |
74 | 74 | { |
75 | - $return = !in_array($method, self::VOID_METHODS) ? 'INNER VALUE FROM ' . $method : null; |
|
75 | + $return = ! in_array($method, self::VOID_METHODS) ? 'INNER VALUE FROM '.$method : null; |
|
76 | 76 | |
77 | 77 | $this->wrapped->expects($this->once()) |
78 | 78 | ->method($method) |