@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Doctrine\Tests; |
4 | 4 | |
5 | 5 | use Doctrine\Common\Cache\ArrayCache; |
6 | -use Doctrine\DBAL\Driver\PDOSqlite\Driver as SqliteDriver; |
|
7 | 6 | use Doctrine\DBAL\Logging\DebugStack; |
8 | 7 | use Doctrine\DBAL\Types\Type; |
9 | 8 | use Doctrine\ORM\Cache\CacheConfiguration; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
77 | 77 | } |
78 | 78 | |
79 | - return $sql . ' AS ' . $columnAlias; |
|
79 | + return $sql.' AS '.$columnAlias; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -94,6 +94,6 @@ discard block |
||
94 | 94 | |
95 | 95 | $this->currentPersisterContext->rsm->addMetaResult('r', $columnAlias, $joinColumnName, false, $type); |
96 | 96 | |
97 | - return $tableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
97 | + return $tableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
98 | 98 | } |
99 | 99 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $inheritedKeyColumns[] = $columnName; |
224 | 224 | } |
225 | 225 | } |
226 | - if (!empty($inheritedKeyColumns)) { |
|
226 | + if ( ! empty($inheritedKeyColumns)) { |
|
227 | 227 | // Add a FK constraint on the ID column |
228 | 228 | $table->addForeignKeyConstraint( |
229 | 229 | $this->quoteStrategy->getTableName( |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | } |
332 | 332 | |
333 | - if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas() ) { |
|
333 | + if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
334 | 334 | $schema->visit(new RemoveNamespacedAssets()); |
335 | 335 | } |
336 | 336 | |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | if ( ! $definingClass) { |
636 | 636 | throw new \Doctrine\ORM\ORMException( |
637 | 637 | "Column name `".$joinColumn['referencedColumnName']."` referenced for relation from ". |
638 | - $mapping['sourceEntity'] . " towards ". $mapping['targetEntity'] . " does not exist." |
|
638 | + $mapping['sourceEntity']." towards ".$mapping['targetEntity']." does not exist." |
|
639 | 639 | ); |
640 | 640 | } |
641 | 641 | |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | $columnOptions = ['notnull' => false, 'columnDefinition' => $columnDef]; |
668 | 668 | |
669 | 669 | if (isset($joinColumn['nullable'])) { |
670 | - $columnOptions['notnull'] = !$joinColumn['nullable']; |
|
670 | + $columnOptions['notnull'] = ! $joinColumn['nullable']; |
|
671 | 671 | } |
672 | 672 | |
673 | 673 | if (isset($fieldMapping['options'])) { |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | } |
715 | 715 | } |
716 | 716 | $blacklistedFks[$compositeName] = true; |
717 | - } elseif (!isset($blacklistedFks[$compositeName])) { |
|
717 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
718 | 718 | $addedFks[$compositeName] = ['foreignTableName' => $foreignTableName, 'foreignColumns' => $foreignColumns]; |
719 | 719 | $theJoinTable->addUnnamedForeignKeyConstraint( |
720 | 720 | $foreignTableName, |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | if ($table->hasPrimaryKey()) { |
822 | 822 | $columns = $table->getPrimaryKey()->getColumns(); |
823 | 823 | if (count($columns) == 1) { |
824 | - $checkSequence = $table->getName() . "_" . $columns[0] . "_seq"; |
|
824 | + $checkSequence = $table->getName()."_".$columns[0]."_seq"; |
|
825 | 825 | if ($fullSchema->hasSequence($checkSequence)) { |
826 | 826 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
827 | 827 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // Evaluate named native queries |
109 | 109 | if (isset($element['namedNativeQueries'])) { |
110 | 110 | foreach ($element['namedNativeQueries'] as $name => $mappingElement) { |
111 | - if (!isset($mappingElement['name'])) { |
|
111 | + if ( ! isset($mappingElement['name'])) { |
|
112 | 112 | $mappingElement['name'] = $name; |
113 | 113 | } |
114 | 114 | $metadata->addNamedNativeQuery( |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | // Evaluate sql result set mappings |
126 | 126 | if (isset($element['sqlResultSetMappings'])) { |
127 | 127 | foreach ($element['sqlResultSetMappings'] as $name => $resultSetMapping) { |
128 | - if (!isset($resultSetMapping['name'])) { |
|
128 | + if ( ! isset($resultSetMapping['name'])) { |
|
129 | 129 | $resultSetMapping['name'] = $name; |
130 | 130 | } |
131 | 131 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | if (isset($element['inheritanceType'])) { |
175 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType']))); |
|
175 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.strtoupper($element['inheritanceType']))); |
|
176 | 176 | |
177 | 177 | if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { |
178 | 178 | // Evaluate discriminatorColumn |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | } |
362 | 362 | |
363 | 363 | if (isset($oneToOneElement['fetch'])) { |
364 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']); |
|
364 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToOneElement['fetch']); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | if (isset($oneToOneElement['mappedBy'])) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ]; |
416 | 416 | |
417 | 417 | if (isset($oneToManyElement['fetch'])) { |
418 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']); |
|
418 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToManyElement['fetch']); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | if (isset($oneToManyElement['cascade'])) { |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | } |
458 | 458 | |
459 | 459 | if (isset($manyToOneElement['fetch'])) { |
460 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']); |
|
460 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToOneElement['fetch']); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | if (isset($manyToOneElement['inversedBy'])) { |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | ]; |
503 | 503 | |
504 | 504 | if (isset($manyToManyElement['fetch'])) { |
505 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']); |
|
505 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToManyElement['fetch']); |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | if (isset($manyToManyElement['mappedBy'])) { |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | if (isset($element['associationOverride']) && is_array($element['associationOverride'])) { |
573 | 573 | |
574 | 574 | foreach ($element['associationOverride'] as $fieldName => $associationOverrideElement) { |
575 | - $override = []; |
|
575 | + $override = []; |
|
576 | 576 | |
577 | 577 | // Check for joinColumn |
578 | 578 | if (isset($associationOverrideElement['joinColumn'])) { |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | if (isset($associationOverrideElement['joinTable'])) { |
591 | 591 | |
592 | 592 | $joinTableElement = $associationOverrideElement['joinTable']; |
593 | - $joinTable = [ |
|
593 | + $joinTable = [ |
|
594 | 594 | 'name' => $joinTableElement['name'] |
595 | 595 | ]; |
596 | 596 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | if (isset($element['lifecycleCallbacks'])) { |
640 | 640 | foreach ($element['lifecycleCallbacks'] as $type => $methods) { |
641 | 641 | foreach ($methods as $method) { |
642 | - $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type)); |
|
642 | + $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::'.$type)); |
|
643 | 643 | } |
644 | 644 | } |
645 | 645 | } |
@@ -781,12 +781,12 @@ discard block |
||
781 | 781 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
782 | 782 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
783 | 783 | |
784 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
784 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
785 | 785 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
786 | 786 | } |
787 | 787 | |
788 | 788 | if ($usage) { |
789 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
789 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
790 | 790 | } |
791 | 791 | |
792 | 792 | return [ |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | */ |
801 | 801 | protected function loadMappingFile($file) |
802 | 802 | { |
803 | - if (defined(Yaml::class . '::PARSE_KEYS_AS_STRINGS')) { |
|
803 | + if (defined(Yaml::class.'::PARSE_KEYS_AS_STRINGS')) { |
|
804 | 804 | return Yaml::parse(file_get_contents($file), Yaml::PARSE_KEYS_AS_STRINGS); |
805 | 805 | } |
806 | 806 |
@@ -110,6 +110,10 @@ |
||
110 | 110 | /** @Column(type = "string") */ |
111 | 111 | private $value; |
112 | 112 | |
113 | + /** |
|
114 | + * @param string $name |
|
115 | + * @param string $value |
|
116 | + */ |
|
113 | 117 | public function __construct($name, $value) |
114 | 118 | { |
115 | 119 | $this->name = $name; |
@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * @return Cache|null |
|
55 | + * @return Cache |
|
56 | 56 | */ |
57 | 57 | private function createRegionCache() |
58 | 58 | { |