@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
382 | 382 | $className = $class->getClassName(); |
383 | 383 | |
384 | - if (! is_array($id)) { |
|
384 | + if ( ! is_array($id)) { |
|
385 | 385 | if ($class->isIdentifierComposite()) { |
386 | 386 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
387 | 387 | } |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | */ |
801 | 801 | public function isOpen() |
802 | 802 | { |
803 | - return (!$this->closed); |
|
803 | + return ( ! $this->closed); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | /** |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | sprintf( |
912 | 912 | 'Invalid $connection argument of type %s given%s.', |
913 | 913 | is_object($connection) ? get_class($connection) : gettype($connection), |
914 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
914 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
915 | 915 | ) |
916 | 916 | ); |
917 | 917 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory; |
7 | 7 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function setPlaceholder($name, $placeholder) |
152 | 152 | { |
153 | - if (! is_string($placeholder) && ! is_callable($placeholder)) { |
|
153 | + if ( ! is_string($placeholder) && ! is_callable($placeholder)) { |
|
154 | 154 | throw new \InvalidArgumentException( |
155 | 155 | sprintf('Provided placeholder for "%s" must be either a string or a valid callable', $name) |
156 | 156 | ); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | $classMetadata = $definition->entityClassMetadata; |
516 | 516 | $reflectionClass = $classMetadata->getReflectionClass(); |
517 | 517 | $reflectionMethods = $reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC); |
518 | - $filteredMethods = array_filter($reflectionMethods, function (\ReflectionMethod $reflectionMethod) use ($classMetadata) { |
|
518 | + $filteredMethods = array_filter($reflectionMethods, function(\ReflectionMethod $reflectionMethod) use ($classMetadata) { |
|
519 | 519 | // Do not consider static or constructor |
520 | 520 | if ($reflectionMethod->isConstructor() || $reflectionMethod->isStatic()) { |
521 | 521 | return false; |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | } |
540 | 540 | |
541 | 541 | // Do not consider magic methods |
542 | - $skippedMethods = [ |
|
542 | + $skippedMethods = [ |
|
543 | 543 | '__clone' => true, |
544 | 544 | '__get' => true, |
545 | 545 | '__isset' => true, |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | return ! isset($skippedMethods[strtolower($reflectionMethod->getName())]); |
552 | 552 | }); |
553 | 553 | |
554 | - $methodList = []; |
|
554 | + $methodList = []; |
|
555 | 555 | |
556 | 556 | /** @var \ReflectionMethod $reflectionMethod */ |
557 | 557 | foreach ($filteredMethods as $reflectionMethod) { |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | $parameterDefinition = ''; |
606 | 606 | |
607 | 607 | if ($parameterType = $this->getParameterType($method, $param)) { |
608 | - $parameterDefinition .= $parameterType . ' '; |
|
608 | + $parameterDefinition .= $parameterType.' '; |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | if ($param->isPassedByReference()) { |
@@ -616,10 +616,10 @@ discard block |
||
616 | 616 | $parameterDefinition .= '...'; |
617 | 617 | } |
618 | 618 | |
619 | - $parameterDefinition .= '$' . $param->getName(); |
|
619 | + $parameterDefinition .= '$'.$param->getName(); |
|
620 | 620 | |
621 | 621 | if ($param->isDefaultValueAvailable()) { |
622 | - $parameterDefinition .= ' = ' . var_export($param->getDefaultValue(), true); |
|
622 | + $parameterDefinition .= ' = '.var_export($param->getDefaultValue(), true); |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | $parameterDefinitions[] = $parameterDefinition; |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | private function getParameterType(\ReflectionMethod $method, \ReflectionParameter $parameter) |
638 | 638 | { |
639 | 639 | if (method_exists($parameter, 'hasType')) { |
640 | - if (! $parameter->hasType()) { |
|
640 | + if ( ! $parameter->hasType()) { |
|
641 | 641 | return ''; |
642 | 642 | } |
643 | 643 | |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | $parameterClass = $parameter->getClass(); |
658 | 658 | |
659 | 659 | if ($parameterClass) { |
660 | - return '\\' . $parameterClass->getName(); |
|
660 | + return '\\'.$parameterClass->getName(); |
|
661 | 661 | } |
662 | 662 | } catch (\ReflectionException $previous) { |
663 | 663 | throw new \UnexpectedValueException( |
@@ -683,14 +683,14 @@ discard block |
||
683 | 683 | private function getParameterNamesForInvocation(array $parameters) |
684 | 684 | { |
685 | 685 | return array_map( |
686 | - function (\ReflectionParameter $parameter) { |
|
686 | + function(\ReflectionParameter $parameter) { |
|
687 | 687 | $name = ''; |
688 | 688 | |
689 | 689 | if ($parameter->isVariadic()) { |
690 | 690 | $name .= '...'; |
691 | 691 | } |
692 | 692 | |
693 | - $name .= '$' . $parameter->getName(); |
|
693 | + $name .= '$'.$parameter->getName(); |
|
694 | 694 | |
695 | 695 | return $name; |
696 | 696 | }, |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | private function getMethodReturnType(\ReflectionMethod $method) |
707 | 707 | { |
708 | 708 | return $method->hasReturnType() |
709 | - ? ': ' . $this->formatType($method->getReturnType(), $method) |
|
709 | + ? ': '.$this->formatType($method->getReturnType(), $method) |
|
710 | 710 | : '' |
711 | 711 | ; |
712 | 712 | } |
@@ -770,14 +770,14 @@ discard block |
||
770 | 770 | ); |
771 | 771 | } |
772 | 772 | |
773 | - if (! $type->isBuiltin()) { |
|
774 | - $name = '\\' . $name; |
|
773 | + if ( ! $type->isBuiltin()) { |
|
774 | + $name = '\\'.$name; |
|
775 | 775 | } |
776 | 776 | |
777 | 777 | if ($type->allowsNull() |
778 | 778 | && (null === $parameter || ! $parameter->isDefaultValueAvailable() || null !== $parameter->getDefaultValue()) |
779 | 779 | ) { |
780 | - $name = '?' . $name; |
|
780 | + $name = '?'.$name; |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | return $name; |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | continue; |
805 | 805 | } |
806 | 806 | |
807 | - $callable = $placeholders[$tagName] ?? [$this, 'generate' . ucfirst($tagName)]; |
|
807 | + $callable = $placeholders[$tagName] ?? [$this, 'generate'.ucfirst($tagName)]; |
|
808 | 808 | |
809 | 809 | $replacements[$tag] = call_user_func($callable, $definition); |
810 | 810 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory\Strategy; |
7 | 7 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory\Strategy; |
7 | 7 | |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function generate(string $filePath, ProxyDefinition $definition): void |
16 | 16 | { |
17 | - if (! file_exists($filePath)) { |
|
17 | + if ( ! file_exists($filePath)) { |
|
18 | 18 | parent::generate($filePath, $definition); |
19 | 19 | |
20 | 20 | return; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory\Strategy; |
7 | 7 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $this->ensureDirectoryIsReady(dirname($filePath)); |
36 | 36 | |
37 | - $tmpFileName = $filePath . '.' . uniqid('', true); |
|
37 | + $tmpFileName = $filePath.'.'.uniqid('', true); |
|
38 | 38 | |
39 | 39 | file_put_contents($tmpFileName, $sourceCode); |
40 | 40 | @chmod($tmpFileName, 0664); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | */ |
51 | 51 | private function ensureDirectoryIsReady(string $directory) |
52 | 52 | { |
53 | - if (! is_dir($directory) && (false === @mkdir($directory, 0775, true))) { |
|
53 | + if ( ! is_dir($directory) && (false === @mkdir($directory, 0775, true))) { |
|
54 | 54 | throw new \RuntimeException(sprintf('Your proxy directory "%s" must be writable', $directory)); |
55 | 55 | } |
56 | 56 | |
57 | - if (! is_writable($directory)) { |
|
57 | + if ( ! is_writable($directory)) { |
|
58 | 58 | throw new \RuntimeException(sprintf('Your proxy directory "%s" must be writable', $directory)); |
59 | 59 | } |
60 | 60 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory; |
7 | 7 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $existingProperties = get_object_vars($proxy); // Do not override properties manually set. |
80 | 80 | |
81 | 81 | foreach ($lazyPropertyList as $propertyName => $defaultValue) { |
82 | - if (! array_key_exists($propertyName, $existingProperties)) { |
|
82 | + if ( ! array_key_exists($propertyName, $existingProperties)) { |
|
83 | 83 | $proxy->$propertyName = $defaultValue; |
84 | 84 | } |
85 | 85 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $propertyName = $reflectionProperty->getName(); |
179 | 179 | $property = $this->entityClassMetadata->getProperty($propertyName); |
180 | 180 | |
181 | - if (! $property || $property instanceof TransientMetadata || $property->isPrimaryKey()) { |
|
181 | + if ( ! $property || $property instanceof TransientMetadata || $property->isPrimaryKey()) { |
|
182 | 182 | continue; |
183 | 183 | } |
184 | 184 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory; |
7 | 7 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory; |
7 | 7 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | private function getOrCreateProxyDefinition(string $className) : ProxyDefinition |
119 | 119 | { |
120 | - if (! isset($this->definitions[$className])) { |
|
120 | + if ( ! isset($this->definitions[$className])) { |
|
121 | 121 | $classMetadata = $this->entityManager->getClassMetadata($className); |
122 | 122 | |
123 | 123 | $this->definitions[$className] = $this->definitionFactory->build($classMetadata); |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory; |
7 | 7 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | // remove namespace separators from remaining class name |
44 | 44 | $fileName = str_replace('\\', '', $classNameRelativeToProxyNamespace); |
45 | 45 | |
46 | - return $proxyDir . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
46 | + return $proxyDir.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $proxyNamespace = ltrim($proxyNamespace, '\\'); |
67 | 67 | |
68 | - if (! (null === $notFoundCallback || is_callable($notFoundCallback))) { |
|
68 | + if ( ! (null === $notFoundCallback || is_callable($notFoundCallback))) { |
|
69 | 69 | $type = is_object($notFoundCallback) ? get_class($notFoundCallback) : gettype($notFoundCallback); |
70 | 70 | |
71 | 71 | throw new InvalidArgumentException( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ); |
74 | 74 | } |
75 | 75 | |
76 | - $autoloader = function ($className) use ($proxyDir, $proxyNamespace, $notFoundCallback) { |
|
76 | + $autoloader = function($className) use ($proxyDir, $proxyNamespace, $notFoundCallback) { |
|
77 | 77 | if (0 === strpos($className, $proxyNamespace)) { |
78 | 78 | $file = Autoloader::resolveFile($proxyDir, $proxyNamespace, $className); |
79 | 79 |