@@ -98,7 +98,7 @@ |
||
98 | 98 | . (method_exists($entry, '__toString') ? |
99 | 99 | "": |
100 | 100 | " If you cannot find out which entity causes the problem" |
101 | - ." implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue.")); |
|
101 | + ." implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue.")); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | static public function scheduleInsertForManagedEntity($entity) |
36 | 36 | { |
37 | - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
37 | + return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | static public function scheduleInsertForRemovedEntity($entity) |
46 | 46 | { |
47 | - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
47 | + return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | static public function scheduleInsertTwice($entity) |
56 | 56 | { |
57 | - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); |
|
57 | + return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice."); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | static public function entityWithoutIdentity($className, $entity) |
67 | 67 | { |
68 | 68 | return new self( |
69 | - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . |
|
69 | + "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ". |
|
70 | 70 | "id values set. It cannot be added to the identity map." |
71 | 71 | ); |
72 | 72 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | static public function readOnlyRequiresManagedEntity($entity) |
80 | 80 | { |
81 | - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); |
|
81 | + return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not"); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -90,15 +90,14 @@ discard block |
||
90 | 90 | static public function newEntityFoundThroughRelationship(array $assoc, $entry) |
91 | 91 | { |
92 | 92 | return new self("A new entity was found through the relationship '" |
93 | - . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' that was not" |
|
94 | - . " configured to cascade persist operations for entity: " . self::objToStr($entry) . "." |
|
93 | + . $assoc['sourceEntity']."#".$assoc['fieldName']."' that was not" |
|
94 | + . " configured to cascade persist operations for entity: ".self::objToStr($entry)."." |
|
95 | 95 | . " To solve this issue: Either explicitly call EntityManager#persist()" |
96 | 96 | . " on this unknown entity or configure cascade persist " |
97 | 97 | . " this association in the mapping for example @ManyToOne(..,cascade={\"persist\"})." |
98 | 98 | . (method_exists($entry, '__toString') ? |
99 | - "": |
|
100 | - " If you cannot find out which entity causes the problem" |
|
101 | - ." implement '" . $assoc['targetEntity'] . "#__toString()' to get a clue.")); |
|
99 | + "" : " If you cannot find out which entity causes the problem" |
|
100 | + ." implement '".$assoc['targetEntity']."#__toString()' to get a clue.")); |
|
102 | 101 | } |
103 | 102 | |
104 | 103 | /** |
@@ -109,8 +108,8 @@ discard block |
||
109 | 108 | */ |
110 | 109 | static public function detachedEntityFoundThroughRelationship(array $assoc, $entry) |
111 | 110 | { |
112 | - return new self("A detached entity of type " . $assoc['targetEntity'] . " (" . self::objToStr($entry) . ") " |
|
113 | - . " was found through the relationship '" . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' " |
|
111 | + return new self("A detached entity of type ".$assoc['targetEntity']." (".self::objToStr($entry).") " |
|
112 | + . " was found through the relationship '".$assoc['sourceEntity']."#".$assoc['fieldName']."' " |
|
114 | 113 | . "during cascading a persist operation."); |
115 | 114 | } |
116 | 115 | |
@@ -121,7 +120,7 @@ discard block |
||
121 | 120 | */ |
122 | 121 | static public function entityNotManaged($entity) |
123 | 122 | { |
124 | - return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . |
|
123 | + return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ". |
|
125 | 124 | "from the database or registered as new through EntityManager#persist"); |
126 | 125 | } |
127 | 126 | |
@@ -133,7 +132,7 @@ discard block |
||
133 | 132 | */ |
134 | 133 | static public function entityHasNoIdentity($entity, $operation) |
135 | 134 | { |
136 | - return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
135 | + return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
137 | 136 | } |
138 | 137 | |
139 | 138 | /** |
@@ -144,7 +143,7 @@ discard block |
||
144 | 143 | */ |
145 | 144 | static public function entityIsRemoved($entity, $operation) |
146 | 145 | { |
147 | - return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
146 | + return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
148 | 147 | } |
149 | 148 | |
150 | 149 | /** |
@@ -155,7 +154,7 @@ discard block |
||
155 | 154 | */ |
156 | 155 | static public function detachedEntityCannot($entity, $operation) |
157 | 156 | { |
158 | - return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation); |
|
157 | + return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation); |
|
159 | 158 | } |
160 | 159 | |
161 | 160 | /** |
@@ -167,8 +166,8 @@ discard block |
||
167 | 166 | */ |
168 | 167 | public static function invalidObject($context, $given, $parameterIndex = 1) |
169 | 168 | { |
170 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
171 | - ' to be an entity object, '. gettype($given) . ' given.'); |
|
169 | + return new self($context.' expects parameter '.$parameterIndex. |
|
170 | + ' to be an entity object, '.gettype($given).' given.'); |
|
172 | 171 | } |
173 | 172 | |
174 | 173 | /** |
@@ -176,7 +175,7 @@ discard block |
||
176 | 175 | */ |
177 | 176 | public static function invalidCompositeIdentifier() |
178 | 177 | { |
179 | - return new self("Binding an entity with a composite primary key to a query is not supported. " . |
|
178 | + return new self("Binding an entity with a composite primary key to a query is not supported. ". |
|
180 | 179 | "You should split the parameter into the explicit fields and bind them separately."); |
181 | 180 | } |
182 | 181 | |
@@ -221,6 +220,6 @@ discard block |
||
221 | 220 | */ |
222 | 221 | private static function objToStr($obj) |
223 | 222 | { |
224 | - return method_exists($obj, '__toString') ? (string)$obj : get_class($obj).'@'.spl_object_hash($obj); |
|
223 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_hash($obj); |
|
225 | 224 | } |
226 | 225 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if ($this->count === null) { |
122 | 122 | try { |
123 | 123 | $this->count = array_sum(array_map('current', $this->getCountQuery()->getScalarResult())); |
124 | - } catch(NoResultException $e) { |
|
124 | + } catch (NoResultException $e) { |
|
125 | 125 | $this->count = 0; |
126 | 126 | } |
127 | 127 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | foreach ($parameters as $key => $parameter) { |
268 | 268 | $parameterName = $parameter->getName(); |
269 | 269 | |
270 | - if( ! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
270 | + if ( ! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
271 | 271 | unset($parameters[$key]); |
272 | 272 | } |
273 | 273 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function exportClassMetadata(ClassMetadataInfo $metadata) |
42 | 42 | { |
43 | 43 | $xml = new \SimpleXmlElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><doctrine-mapping ". |
44 | - "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" " . |
|
44 | + "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" ". |
|
45 | 45 | "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ". |
46 | 46 | "xsi:schemaLocation=\"http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd\" />"); |
47 | 47 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy); |
99 | 99 | |
100 | - if ( $trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
100 | + if ($trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
101 | 101 | $root->addChild('change-tracking-policy', $trackingPolicy); |
102 | 102 | } |
103 | 103 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $indexXml = $indexesXml->addChild('index'); |
109 | 109 | $indexXml->addAttribute('name', $name); |
110 | 110 | $indexXml->addAttribute('columns', implode(',', $index['columns'])); |
111 | - if(isset($index['flags'])) { |
|
111 | + if (isset($index['flags'])) { |
|
112 | 112 | $indexXml->addAttribute('flags', implode(',', $index['flags'])); |
113 | 113 | } |
114 | 114 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | if (count($cascade) === 5) { |
298 | - $cascade = array('cascade-all'); |
|
298 | + $cascade = array('cascade-all'); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | if ($cascade) { |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | } |
378 | 378 | } |
379 | 379 | |
380 | - if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) { |
|
380 | + if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) { |
|
381 | 381 | $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks'); |
382 | 382 | |
383 | 383 | foreach ($metadata->lifecycleCallbacks as $name => $methods) { |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | { |
427 | 427 | $sequenceDefinition = $metadata->sequenceGeneratorDefinition; |
428 | 428 | |
429 | - if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
429 | + if ( ! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
430 | 430 | return; |
431 | 431 | } |
432 | 432 |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | |
136 | 136 | foreach ($this->_metadata as $metadata) { |
137 | 137 | // In case output is returned, write it to a file, skip otherwise |
138 | - if($output = $this->exportClassMetadata($metadata)){ |
|
138 | + if ($output = $this->exportClassMetadata($metadata)) { |
|
139 | 139 | $path = $this->_generateOutputPath($metadata); |
140 | 140 | $dir = dirname($path); |
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(ClassMetadataInfo $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 | /** |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $inheritedKeyColumns[] = $columnName; |
223 | 223 | } |
224 | 224 | } |
225 | - if (!empty($inheritedKeyColumns)) { |
|
225 | + if ( ! empty($inheritedKeyColumns)) { |
|
226 | 226 | // Add a FK constraint on the ID column |
227 | 227 | $table->addForeignKeyConstraint( |
228 | 228 | $this->quoteStrategy->getTableName( |
@@ -265,11 +265,11 @@ discard block |
||
265 | 265 | |
266 | 266 | if (isset($class->table['indexes'])) { |
267 | 267 | foreach ($class->table['indexes'] as $indexName => $indexData) { |
268 | - if( ! isset($indexData['flags'])) { |
|
268 | + if ( ! isset($indexData['flags'])) { |
|
269 | 269 | $indexData['flags'] = array(); |
270 | 270 | } |
271 | 271 | |
272 | - $table->addIndex($indexData['columns'], is_numeric($indexName) ? null : $indexName, (array)$indexData['flags'], isset($indexData['options']) ? $indexData['options'] : array()); |
|
272 | + $table->addIndex($indexData['columns'], is_numeric($indexName) ? null : $indexName, (array) $indexData['flags'], isset($indexData['options']) ? $indexData['options'] : array()); |
|
273 | 273 | } |
274 | 274 | } |
275 | 275 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | } |
318 | 318 | |
319 | - if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas() ) { |
|
319 | + if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
320 | 320 | $schema->visit(new RemoveNamespacedAssets()); |
321 | 321 | } |
322 | 322 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | // For now, this is a hack required for single table inheritence, since this method is called |
392 | 392 | // twice by single table inheritence relations |
393 | - if (!$table->hasIndex('primary')) { |
|
393 | + if ( ! $table->hasIndex('primary')) { |
|
394 | 394 | //$table->setPrimaryKey($pkColumns); |
395 | 395 | } |
396 | 396 | } |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | if ( ! $definingClass) { |
627 | 627 | throw new \Doctrine\ORM\ORMException( |
628 | 628 | "Column name `".$joinColumn['referencedColumnName']."` referenced for relation from ". |
629 | - $mapping['sourceEntity'] . " towards ". $mapping['targetEntity'] . " does not exist." |
|
629 | + $mapping['sourceEntity']." towards ".$mapping['targetEntity']." does not exist." |
|
630 | 630 | ); |
631 | 631 | } |
632 | 632 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | $columnOptions = array('notnull' => false, 'columnDefinition' => $columnDef); |
659 | 659 | |
660 | 660 | if (isset($joinColumn['nullable'])) { |
661 | - $columnOptions['notnull'] = !$joinColumn['nullable']; |
|
661 | + $columnOptions['notnull'] = ! $joinColumn['nullable']; |
|
662 | 662 | } |
663 | 663 | |
664 | 664 | if (isset($fieldMapping['options'])) { |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | } |
706 | 706 | } |
707 | 707 | $blacklistedFks[$compositeName] = true; |
708 | - } elseif (!isset($blacklistedFks[$compositeName])) { |
|
708 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
709 | 709 | $addedFks[$compositeName] = array('foreignTableName' => $foreignTableName, 'foreignColumns' => $foreignColumns); |
710 | 710 | $theJoinTable->addUnnamedForeignKeyConstraint( |
711 | 711 | $foreignTableName, |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | if ($table->hasPrimaryKey()) { |
813 | 813 | $columns = $table->getPrimaryKey()->getColumns(); |
814 | 814 | if (count($columns) == 1) { |
815 | - $checkSequence = $table->getName() . "_" . $columns[0] . "_seq"; |
|
815 | + $checkSequence = $table->getName()."_".$columns[0]."_seq"; |
|
816 | 816 | if ($fullSchema->hasSequence($checkSequence)) { |
817 | 817 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
818 | 818 | } |
@@ -110,12 +110,12 @@ |
||
110 | 110 | |
111 | 111 | if ($numRepositories) { |
112 | 112 | // Outputting information message |
113 | - $output->writeln(PHP_EOL . sprintf('Repository classes generated to "<info>%s</INFO>"', $destPath) ); |
|
113 | + $output->writeln(PHP_EOL.sprintf('Repository classes generated to "<info>%s</INFO>"', $destPath)); |
|
114 | 114 | } else { |
115 | - $output->writeln('No Repository classes were found to be processed.' ); |
|
115 | + $output->writeln('No Repository classes were found to be processed.'); |
|
116 | 116 | } |
117 | 117 | } else { |
118 | - $output->writeln('No Metadata Classes to process.' ); |
|
118 | + $output->writeln('No Metadata Classes to process.'); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ->addArgument('entity-class', InputArgument::OPTIONAL, 'The entity name.') |
47 | 47 | ->addArgument('entity-id', InputArgument::OPTIONAL, 'The entity identifier.') |
48 | 48 | ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.') |
49 | - ->addOption('flush', null, InputOption::VALUE_NONE,'If defined, all cache entries will be flushed.'); |
|
49 | + ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.'); |
|
50 | 50 | |
51 | 51 | |
52 | 52 | $this->setHelp(<<<EOT |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | if ($input->getOption('flush')) { |
98 | - $entityRegion = $cache->getEntityCacheRegion($entityClass); |
|
98 | + $entityRegion = $cache->getEntityCacheRegion($entityClass); |
|
99 | 99 | |
100 | 100 | if ( ! $entityRegion instanceof DefaultRegion) { |
101 | 101 | throw new \InvalidArgumentException(sprintf( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | ->addArgument('association', InputArgument::OPTIONAL, 'The association collection name.') |
48 | 48 | ->addArgument('owner-id', InputArgument::OPTIONAL, 'The owner identifier.') |
49 | 49 | ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all entity regions will be deleted/invalidated.') |
50 | - ->addOption('flush', null, InputOption::VALUE_NONE,'If defined, all cache entries will be flushed.'); |
|
50 | + ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.'); |
|
51 | 51 | |
52 | 52 | |
53 | 53 | $this->setHelp(<<<EOT |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | throw new \InvalidArgumentException('No second-level cache is configured on the given EntityManager.'); |
93 | 93 | } |
94 | 94 | |
95 | - if ( (! $ownerClass || ! $assoc) && ! $input->getOption('all')) { |
|
95 | + if (( ! $ownerClass || ! $assoc) && ! $input->getOption('all')) { |
|
96 | 96 | throw new \InvalidArgumentException('Missing arguments "--owner-class" "--association"'); |
97 | 97 | } |
98 | 98 | |
99 | 99 | if ($input->getOption('flush')) { |
100 | - $collectionRegion = $cache->getCollectionCacheRegion($ownerClass, $assoc); |
|
100 | + $collectionRegion = $cache->getCollectionCacheRegion($ownerClass, $assoc); |
|
101 | 101 | |
102 | 102 | if ( ! $collectionRegion instanceof DefaultRegion) { |
103 | 103 | throw new \InvalidArgumentException(sprintf( |
@@ -45,7 +45,7 @@ |
||
45 | 45 | ->setDescription('Clear a second-level cache query region.') |
46 | 46 | ->addArgument('region-name', InputArgument::OPTIONAL, 'The query region to clear.') |
47 | 47 | ->addOption('all', null, InputOption::VALUE_NONE, 'If defined, all query regions will be deleted/invalidated.') |
48 | - ->addOption('flush', null, InputOption::VALUE_NONE,'If defined, all cache entries will be flushed.'); |
|
48 | + ->addOption('flush', null, InputOption::VALUE_NONE, 'If defined, all cache entries will be flushed.'); |
|
49 | 49 | |
50 | 50 | |
51 | 51 | $this->setHelp(<<<EOT |