@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ); |
84 | 84 | } |
85 | 85 | |
86 | - if (! $associationMetadata->isOwningSide()) { |
|
86 | + if ( ! $associationMetadata->isOwningSide()) { |
|
87 | 87 | throw Mapping\MappingException::illegalInverseIdentifierAssociation( |
88 | 88 | $this->componentMetadata->getClassName(), |
89 | 89 | $this->fieldName |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // @todo guilhermeblanco The below block of code modifies component metadata properties, and it should be moved |
101 | 101 | // to the component metadata builder instead of here. |
102 | 102 | |
103 | - if (! \in_array($this->fieldName, $this->componentMetadata->identifier, true)) { |
|
103 | + if ( ! \in_array($this->fieldName, $this->componentMetadata->identifier, true)) { |
|
104 | 104 | $this->componentMetadata->identifier[] = $this->fieldName; |
105 | 105 | } |
106 | 106 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function register($object) |
44 | 44 | { |
45 | - if (! \is_object($object)) { |
|
45 | + if ( ! \is_object($object)) { |
|
46 | 46 | throw new InvalidArgumentException(\sprintf('An object was expected, but got "%s".', \gettype($object))); |
47 | 47 | } |
48 | 48 |
@@ -23,24 +23,24 @@ |
||
23 | 23 | /** @var TableMetadata $value */ |
24 | 24 | $variableExporter = new VariableExporter(); |
25 | 25 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
26 | - $objectReference = $indentation . self::VARIABLE; |
|
26 | + $objectReference = $indentation.self::VARIABLE; |
|
27 | 27 | $lines = []; |
28 | 28 | |
29 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
29 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
30 | 30 | |
31 | - if (! empty($value->getSchema())) { |
|
32 | - $lines[] = $objectReference . '->setSchema("' . $value->getSchema() . '");'; |
|
31 | + if ( ! empty($value->getSchema())) { |
|
32 | + $lines[] = $objectReference.'->setSchema("'.$value->getSchema().'");'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | foreach ($value->getIndexes() as $index) { |
36 | - $lines[] = $objectReference . '->addIndex(' . \ltrim($variableExporter->export($index, $indentationLevel + 1)) . ');'; |
|
36 | + $lines[] = $objectReference.'->addIndex('.\ltrim($variableExporter->export($index, $indentationLevel + 1)).');'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | foreach ($value->getUniqueConstraints() as $uniqueConstraint) { |
40 | - $lines[] = $objectReference . '->addUniqueConstraint(' . \ltrim($variableExporter->export($uniqueConstraint, $indentationLevel + 1)) . ');'; |
|
40 | + $lines[] = $objectReference.'->addUniqueConstraint('.\ltrim($variableExporter->export($uniqueConstraint, $indentationLevel + 1)).');'; |
|
41 | 41 | } |
42 | 42 | |
43 | - $lines[] = $objectReference . '->setOptions(' . \ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)) . ');'; |
|
43 | + $lines[] = $objectReference.'->setOptions('.\ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)).');'; |
|
44 | 44 | |
45 | 45 | return \implode(PHP_EOL, $lines); |
46 | 46 | } |
@@ -24,30 +24,30 @@ |
||
24 | 24 | */ |
25 | 25 | public function export($value, int $indentationLevel = 0) : string |
26 | 26 | { |
27 | - if (! \is_array($value)) { |
|
27 | + if ( ! \is_array($value)) { |
|
28 | 28 | return \var_export($value, true); |
29 | 29 | } |
30 | 30 | |
31 | 31 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
32 | - $longestKey = \array_reduce(\array_keys($value), static function ($k, $v) { |
|
32 | + $longestKey = \array_reduce(\array_keys($value), static function($k, $v) { |
|
33 | 33 | return (string) (\strlen((string) $k) > \strlen((string) $v) ? $k : $v); |
34 | 34 | }); |
35 | 35 | $maxKeyLength = \strlen($longestKey) + (\is_numeric($longestKey) ? 0 : 2); |
36 | 36 | |
37 | 37 | $lines = []; |
38 | 38 | |
39 | - $lines[] = $indentation . '['; |
|
39 | + $lines[] = $indentation.'['; |
|
40 | 40 | |
41 | 41 | foreach ($value as $entryKey => $entryValue) { |
42 | 42 | $lines[] = \sprintf( |
43 | 43 | '%s%s => %s,', |
44 | - $indentation . self::INDENTATION, |
|
44 | + $indentation.self::INDENTATION, |
|
45 | 45 | \str_pad(\var_export($entryKey, true), $maxKeyLength), |
46 | 46 | \ltrim($this->export($entryValue, $indentationLevel + 1)) |
47 | 47 | ); |
48 | 48 | } |
49 | 49 | |
50 | - $lines[] = $indentation . ']'; |
|
50 | + $lines[] = $indentation.']'; |
|
51 | 51 | |
52 | 52 | return \implode(PHP_EOL, $lines); |
53 | 53 | } |
@@ -19,9 +19,9 @@ |
||
19 | 19 | { |
20 | 20 | /** @var TransientMetadata $value */ |
21 | 21 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
22 | - $objectReference = $indentation . self::VARIABLE; |
|
22 | + $objectReference = $indentation.self::VARIABLE; |
|
23 | 23 | |
24 | - return $objectReference . ' = ' . $this->exportInstantiation($value); |
|
24 | + return $objectReference.' = '.$this->exportInstantiation($value); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | protected function exportInstantiation(TransientMetadata $metadata) : string |
@@ -25,11 +25,11 @@ |
||
25 | 25 | /** @var FieldMetadata $value */ |
26 | 26 | $variableExporter = new VariableExporter(); |
27 | 27 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
28 | - $objectReference = $indentation . self::VARIABLE; |
|
28 | + $objectReference = $indentation.self::VARIABLE; |
|
29 | 29 | |
30 | 30 | $lines = []; |
31 | 31 | $lines[] = parent::export($value, $indentationLevel); |
32 | - $lines[] = $objectReference . '->setVersioned(' . \ltrim($variableExporter->export($value->isVersioned(), $indentationLevel + 1)) . ');'; |
|
32 | + $lines[] = $objectReference.'->setVersioned('.\ltrim($variableExporter->export($value->isVersioned(), $indentationLevel + 1)).');'; |
|
33 | 33 | |
34 | 34 | return \implode(PHP_EOL, $lines); |
35 | 35 | } |
@@ -23,13 +23,13 @@ |
||
23 | 23 | { |
24 | 24 | /** @var JoinColumnMetadata $value */ |
25 | 25 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
26 | - $objectReference = $indentation . self::VARIABLE; |
|
26 | + $objectReference = $indentation.self::VARIABLE; |
|
27 | 27 | $lines = []; |
28 | 28 | |
29 | 29 | $lines[] = parent::export($value, $indentationLevel); |
30 | - $lines[] = $objectReference . '->setReferencedColumnName("' . $value->getReferencedColumnName() . '");'; |
|
31 | - $lines[] = $objectReference . '->setAliasedName("' . $value->getAliasedName() . '");'; |
|
32 | - $lines[] = $objectReference . '->setOnDelete("' . $value->getOnDelete() . '");'; |
|
30 | + $lines[] = $objectReference.'->setReferencedColumnName("'.$value->getReferencedColumnName().'");'; |
|
31 | + $lines[] = $objectReference.'->setAliasedName("'.$value->getAliasedName().'");'; |
|
32 | + $lines[] = $objectReference.'->setOnDelete("'.$value->getOnDelete().'");'; |
|
33 | 33 | |
34 | 34 | return \implode(PHP_EOL, $lines); |
35 | 35 | } |
@@ -22,20 +22,20 @@ |
||
22 | 22 | /** @var ColumnMetadata $value */ |
23 | 23 | $variableExporter = new VariableExporter(); |
24 | 24 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
25 | - $objectReference = $indentation . self::VARIABLE; |
|
25 | + $objectReference = $indentation.self::VARIABLE; |
|
26 | 26 | $lines = []; |
27 | 27 | |
28 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
28 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
29 | 29 | |
30 | - if (! empty($value->getColumnDefinition())) { |
|
31 | - $lines[] = $objectReference . '->setColumnDefinition("' . $value->getColumnDefinition() . '");'; |
|
30 | + if ( ! empty($value->getColumnDefinition())) { |
|
31 | + $lines[] = $objectReference.'->setColumnDefinition("'.$value->getColumnDefinition().'");'; |
|
32 | 32 | } |
33 | 33 | |
34 | - $lines[] = $objectReference . '->setTableName("' . $value->getTableName() . '");'; |
|
35 | - $lines[] = $objectReference . '->setOptions(' . \ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)) . ');'; |
|
36 | - $lines[] = $objectReference . '->setPrimaryKey(' . \ltrim($variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1)) . ');'; |
|
37 | - $lines[] = $objectReference . '->setNullable(' . \ltrim($variableExporter->export($value->isNullable(), $indentationLevel + 1)) . ');'; |
|
38 | - $lines[] = $objectReference . '->setUnique(' . \ltrim($variableExporter->export($value->isUnique(), $indentationLevel + 1)) . ');'; |
|
34 | + $lines[] = $objectReference.'->setTableName("'.$value->getTableName().'");'; |
|
35 | + $lines[] = $objectReference.'->setOptions('.\ltrim($variableExporter->export($value->getOptions(), $indentationLevel + 1)).');'; |
|
36 | + $lines[] = $objectReference.'->setPrimaryKey('.\ltrim($variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1)).');'; |
|
37 | + $lines[] = $objectReference.'->setNullable('.\ltrim($variableExporter->export($value->isNullable(), $indentationLevel + 1)).');'; |
|
38 | + $lines[] = $objectReference.'->setUnique('.\ltrim($variableExporter->export($value->isUnique(), $indentationLevel + 1)).');'; |
|
39 | 39 | |
40 | 40 | return \implode(PHP_EOL, $lines); |
41 | 41 | } |
@@ -24,33 +24,33 @@ |
||
24 | 24 | $cacheExporter = new CacheMetadataExporter(); |
25 | 25 | $variableExporter = new VariableExporter(); |
26 | 26 | $indentation = \str_repeat(self::INDENTATION, $indentationLevel); |
27 | - $objectReference = $indentation . self::VARIABLE; |
|
27 | + $objectReference = $indentation.self::VARIABLE; |
|
28 | 28 | $cascade = $this->resolveCascade($value->getCascade()); |
29 | 29 | $lines = []; |
30 | 30 | |
31 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
31 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
32 | 32 | |
33 | - if (! empty($value->getCache())) { |
|
33 | + if ( ! empty($value->getCache())) { |
|
34 | 34 | $lines[] = $cacheExporter->export($value->getCache(), $indentationLevel); |
35 | 35 | $lines[] = null; |
36 | - $lines[] = $objectReference . '->setCache(' . $cacheExporter::VARIABLE . ');'; |
|
36 | + $lines[] = $objectReference.'->setCache('.$cacheExporter::VARIABLE.');'; |
|
37 | 37 | } |
38 | 38 | |
39 | - if (! empty($value->getMappedBy())) { |
|
40 | - $lines[] = $objectReference . '->setMappedBy("' . $value->getMappedBy() . '");'; |
|
41 | - $lines[] = $objectReference . '->setOwningSide(false);'; |
|
39 | + if ( ! empty($value->getMappedBy())) { |
|
40 | + $lines[] = $objectReference.'->setMappedBy("'.$value->getMappedBy().'");'; |
|
41 | + $lines[] = $objectReference.'->setOwningSide(false);'; |
|
42 | 42 | } |
43 | 43 | |
44 | - if (! empty($value->getInversedBy())) { |
|
45 | - $lines[] = $objectReference . '->setInversedBy("' . $value->getInversedBy() . '");'; |
|
44 | + if ( ! empty($value->getInversedBy())) { |
|
45 | + $lines[] = $objectReference.'->setInversedBy("'.$value->getInversedBy().'");'; |
|
46 | 46 | } |
47 | 47 | |
48 | - $lines[] = $objectReference . '->setSourceEntity("' . $value->getSourceEntity() . '");'; |
|
49 | - $lines[] = $objectReference . '->setTargetEntity("' . $value->getTargetEntity() . '");'; |
|
50 | - $lines[] = $objectReference . '->setFetchMode(Mapping\FetchMode::' . \strtoupper($value->getFetchMode()) . '");'; |
|
51 | - $lines[] = $objectReference . '->setCascade(' . $variableExporter->export($cascade, $indentationLevel + 1) . ');'; |
|
52 | - $lines[] = $objectReference . '->setOrphanRemoval(' . $variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1) . ');'; |
|
53 | - $lines[] = $objectReference . '->setPrimaryKey(' . $variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1) . ');'; |
|
48 | + $lines[] = $objectReference.'->setSourceEntity("'.$value->getSourceEntity().'");'; |
|
49 | + $lines[] = $objectReference.'->setTargetEntity("'.$value->getTargetEntity().'");'; |
|
50 | + $lines[] = $objectReference.'->setFetchMode(Mapping\FetchMode::'.\strtoupper($value->getFetchMode()).'");'; |
|
51 | + $lines[] = $objectReference.'->setCascade('.$variableExporter->export($cascade, $indentationLevel + 1).');'; |
|
52 | + $lines[] = $objectReference.'->setOrphanRemoval('.$variableExporter->export($value->isOrphanRemoval(), $indentationLevel + 1).');'; |
|
53 | + $lines[] = $objectReference.'->setPrimaryKey('.$variableExporter->export($value->isPrimaryKey(), $indentationLevel + 1).');'; |
|
54 | 54 | |
55 | 55 | return \implode(PHP_EOL, $lines); |
56 | 56 | } |