Passed
Push — master ( 59ef72...ed809e )
by Gerrit
04:43
created
DataLoader/SimpleSelectDataLoader.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     }
71 71
 
72 72
     /**
73
-     * @param object $entity
73
+     * @param \Addiks\RDMBundle\Tests\Hydration\EntityExample $entity
74 74
      */
75 75
     public function loadDBALDataForEntity($entity, EntityManagerInterface $entityManager): array
76 76
     {
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     }
164 164
 
165 165
     /**
166
-     * @param object $entity
166
+     * @param \Addiks\RDMBundle\Tests\Hydration\EntityExample $entity
167 167
      */
168 168
     public function storeDBALDataForEntity($entity, EntityManagerInterface $entityManager): void
169 169
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@
 block discarded – undo
26 26
 use PDO;
27 27
 use Addiks\RDMBundle\Mapping\MappingInterface;
28 28
 use Addiks\RDMBundle\ValueResolver\ValueResolverInterface;
29
-use Doctrine\ORM\Proxy\Proxy;
30 29
 
31 30
 /**
32 31
  * A very simple loader that just executes one simple select statement for every entity to load the data for.
Please login to merge, or discard this patch.
Doctrine/EventListener.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -23,9 +23,6 @@
 block discarded – undo
23 23
 use Doctrine\ORM\UnitOfWork;
24 24
 use Doctrine\DBAL\Schema\Table;
25 25
 use Doctrine\DBAL\Schema\Column;
26
-use Doctrine\Common\EventArgs;
27
-use Doctrine\Common\Persistence\ObjectManager;
28
-use Doctrine\ORM\Event\OnFlushEventArgs;
29 26
 use Doctrine\ORM\Event\PostFlushEventArgs;
30 27
 use Doctrine\ORM\Proxy\Proxy;
31 28
 
Please login to merge, or discard this patch.
Exception/FailedRDMAssertionException.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 namespace Addiks\RDMBundle\Exception;
12 12
 
13 13
 use ErrorException;
14
-use ReflectionProperty;
15 14
 use ReflectionClass;
16 15
 use Addiks\RDMBundle\Exception\FailedRDMAssertionExceptionInterface;
17 16
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $actualDescription = null;
61 61
 
62 62
         if (is_object($actualService)) {
63
-            $actualDescription = get_class($actualService) . '#' . spl_object_hash($actualService);
63
+            $actualDescription = get_class($actualService).'#'.spl_object_hash($actualService);
64 64
 
65 65
         } else {
66 66
             $actualDescription = gettype($actualService);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $expectedDescription = null;
71 71
 
72 72
         if (is_object($expectedService)) {
73
-            $expectedDescription = get_class($expectedService) . '#' . spl_object_hash($expectedService);
73
+            $expectedDescription = get_class($expectedService).'#'.spl_object_hash($expectedService);
74 74
 
75 75
         } else {
76 76
             $expectedDescription = gettype($expectedService);
Please login to merge, or discard this patch.
Hydration/EntityHydrator.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -13,13 +13,10 @@
 block discarded – undo
13 13
 use ReflectionClass;
14 14
 use ReflectionProperty;
15 15
 use Doctrine\Common\Util\ClassUtils;
16
-use Doctrine\DBAL\Schema\Column;
17 16
 use Addiks\RDMBundle\Mapping\Drivers\MappingDriverInterface;
18 17
 use Addiks\RDMBundle\Mapping\EntityMappingInterface;
19 18
 use Addiks\RDMBundle\Mapping\MappingInterface;
20
-use Addiks\RDMBundle\Mapping\ServiceMapping;
21 19
 use Addiks\RDMBundle\Hydration\EntityHydratorInterface;
22
-use Addiks\RDMBundle\Exception\FailedRDMAssertionException;
23 20
 use Addiks\RDMBundle\ValueResolver\ValueResolverInterface;
24 21
 use Addiks\RDMBundle\DataLoader\DataLoaderInterface;
25 22
 use Doctrine\ORM\EntityManagerInterface;
Please login to merge, or discard this patch.
Mapping/Drivers/MappingPHPDriver.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
                 (
45 45
                     /**
46
-                     * @param mixed $rdmMapping
46
+                     * @param string $rdmMapping
47 47
                      */
48 48
                     function (&$rdmMapping) use ($mappingFile): void {
49 49
                         /** @psalm-suppress UnresolvableInclude */
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 
13 13
 use Doctrine\Common\Persistence\Mapping\Driver\FileLocator;
14 14
 use Addiks\RDMBundle\Mapping\Drivers\MappingDriverInterface;
15
-use Addiks\RDMBundle\Mapping\Annotation\RDMAnnotationInterface;
16 15
 use Addiks\RDMBundle\Mapping\EntityMappingInterface;
17 16
 
18 17
 final class MappingPHPDriver implements MappingDriverInterface
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
                     /**
46 46
                      * @param mixed $rdmMapping
47 47
                      */
48
-                    function (&$rdmMapping) use ($mappingFile): void {
48
+                    function(&$rdmMapping) use ($mappingFile): void {
49 49
                         /** @psalm-suppress UnresolvableInclude */
50 50
                         include $mappingFile;
51 51
                     }
Please login to merge, or discard this patch.
Mapping/Drivers/MappingXmlDriver.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 use Addiks\RDMBundle\Mapping\ServiceMapping;
21 21
 use Addiks\RDMBundle\Mapping\MappingInterface;
22 22
 use Addiks\RDMBundle\Mapping\ChoiceMapping;
23
-use Addiks\RDMBundle\Exception\InvalidMappingException;
24 23
 use DOMAttr;
25 24
 use Doctrine\DBAL\Schema\Column;
26 25
 use Doctrine\DBAL\Types\Type;
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     /** @var DOMNode $serviceNode */
81 81
 
82 82
                     /** @var string $fieldName */
83
-                    $fieldName = (string)$serviceNode->attributes->getNamedItem("field")->nodeValue;
83
+                    $fieldName = (string) $serviceNode->attributes->getNamedItem("field")->nodeValue;
84 84
 
85 85
                     $fieldMappings[$fieldName] = $this->readService($serviceNode, $mappingFile);
86 86
                 }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                     /** @var DOMNode $choiceNode */
90 90
 
91 91
                     /** @var string $fieldName */
92
-                    $fieldName = (string)$choiceNode->attributes->getNamedItem("field")->nodeValue;
92
+                    $fieldName = (string) $choiceNode->attributes->getNamedItem("field")->nodeValue;
93 93
 
94 94
                     $fieldMappings[$fieldName] = $this->readChoice($choiceNode, $mappingFile, $fieldName);
95 95
                 }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $column = $defaultColumnName;
112 112
 
113 113
         if (!is_null($choiceNode->attributes->getNamedItem("column"))) {
114
-            $column = (string)$choiceNode->attributes->getNamedItem("column")->nodeValue;
114
+            $column = (string) $choiceNode->attributes->getNamedItem("column")->nodeValue;
115 115
         }
116 116
 
117 117
         /** @var array<MappingInterface> $choiceMappings */
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
 
130 130
             if ($optionNode instanceof DOMNode) {
131 131
                 /** @var mixed $nodeName */
132
-                $nodeName = $optionNode->namespaceURI . ":" . $optionNode->localName;
132
+                $nodeName = $optionNode->namespaceURI.":".$optionNode->localName;
133 133
 
134
-                if ($nodeName === self::RDM_SCHEMA_URI . ":option") {
134
+                if ($nodeName === self::RDM_SCHEMA_URI.":option") {
135 135
                     /** @var string $determinator */
136
-                    $determinator = (string)$optionNode->attributes->getNamedItem("name")->nodeValue;
136
+                    $determinator = (string) $optionNode->attributes->getNamedItem("name")->nodeValue;
137 137
 
138 138
                     /** @var DOMNode $optionMappingNode */
139 139
                     $optionMappingNode = $optionNode->firstChild;
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
                         $optionMappingNode = $optionMappingNode->nextSibling;
143 143
                     }
144 144
 
145
-                    if ($optionMappingNode->nodeName === $optionMappingNode->prefix . ":service") {
145
+                    if ($optionMappingNode->nodeName === $optionMappingNode->prefix.":service") {
146 146
                         $choiceMappings[$determinator] = $this->readService($optionMappingNode, $mappingFile);
147 147
 
148
-                    } elseif ($optionMappingNode->nodeName === $optionMappingNode->prefix . ":choice") {
148
+                    } elseif ($optionMappingNode->nodeName === $optionMappingNode->prefix.":choice") {
149 149
                         $choiceMappings[$determinator] = $this->readChoice($optionMappingNode, $mappingFile, sprintf(
150 150
                             "%s_%s",
151 151
                             $defaultColumnName,
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
                         ));
154 154
                     }
155 155
 
156
-                } elseif ($nodeName === self::DOCTRINE_SCHEMA_URI . ":field") {
156
+                } elseif ($nodeName === self::DOCTRINE_SCHEMA_URI.":field") {
157 157
                     $column = $this->readDoctrineField($optionNode);
158 158
                 }
159 159
             }
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
         }
176 176
 
177 177
         /** @var string $serviceId */
178
-        $serviceId = (string)$serviceNode->attributes->getNamedItem("id")->nodeValue;
178
+        $serviceId = (string) $serviceNode->attributes->getNamedItem("id")->nodeValue;
179 179
 
180 180
         if (!is_bool($lax)) {
181
-            $lax = (strtolower((string)$lax) === 'true');
181
+            $lax = (strtolower((string) $lax) === 'true');
182 182
         }
183 183
 
184 184
         return new ServiceMapping($serviceId, $lax, sprintf(
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         foreach ($fieldNode->attributes as $key => $attribute) {
213 213
             /** @var DOMAttr $attribute */
214 214
 
215
-            $attributeValue = (string)$attribute->nodeValue;
215
+            $attributeValue = (string) $attribute->nodeValue;
216 216
 
217 217
             if ($key === 'name') {
218 218
                 $columnName = $attributeValue;
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                     $attributeValue = ($attributeValue === 'false');
227 227
                 }
228 228
 
229
-                $attributes[$keyMap[$key]] = (string)$attribute->nodeValue;
229
+                $attributes[$keyMap[$key]] = (string) $attribute->nodeValue;
230 230
             }
231 231
         }
232 232
 
Please login to merge, or discard this patch.
Mapping/Drivers/MappingYamlDriver.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,6 @@
 block discarded – undo
19 19
 use Addiks\RDMBundle\Mapping\EntityMapping;
20 20
 use Addiks\RDMBundle\Mapping\ServiceMapping;
21 21
 use Addiks\RDMBundle\Mapping\ChoiceMapping;
22
-use Doctrine\DBAL\Schema\Column;
23
-use Doctrine\DBAL\Types\Type;
24 22
 
25 23
 final class MappingYamlDriver implements MappingDriverInterface
26 24
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
         $determinatorColumnName = $fieldName;
115 115
 
116 116
         if ($choiceYaml['column']) {
117
-            $determinatorColumnName = (string)$choiceYaml['column'];
117
+            $determinatorColumnName = (string) $choiceYaml['column'];
118 118
         }
119 119
 
120 120
         foreach ($choiceYaml['choices'] as $determinator => $choiceYaml) {
Please login to merge, or discard this patch.
Symfony/FormType/ServiceFormType.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
             $builder->addModelTransformer(new CallbackTransformer(
45 45
                 /**
46
-                 * @param object $service
46
+                 * @param FormBuilderInterface $service
47 47
                  */
48 48
                 function ($service) use ($container, $options): ?string {
49 49
                     /** @var ?string $serviceId */
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 use Symfony\Component\OptionsResolver\OptionsResolverInterface;
18 18
 use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
19 19
 use Symfony\Component\DependencyInjection\ContainerInterface;
20
-use Symfony\Component\Form\FormConfigBuilder;
21 20
 use Symfony\Component\Form\FormConfigBuilderInterface;
22 21
 use Symfony\Component\Form\CallbackTransformer;
23 22
 use Symfony\Component\OptionsResolver\OptionsResolver;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 /**
46 46
                  * @param object $service
47 47
                  */
48
-                function ($service) use ($container, $options): ?string {
48
+                function($service) use ($container, $options): ?string {
49 49
                     /** @var ?string $serviceId */
50 50
                     $serviceId = null;
51 51
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                 /**
67 67
                  * @return ?object
68 68
                  */
69
-                function (string $serviceId) use ($container) {
69
+                function(string $serviceId) use ($container) {
70 70
                     /** @var ?object $service */
71 71
                     $service = null;
72 72
 
Please login to merge, or discard this patch.
Tests/DataLoader/ChoosingDataLoaderFactoryTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 
13 13
 use PHPUnit\Framework\TestCase;
14 14
 use Addiks\RDMBundle\DataLoader\ChoosingDataLoaderFactory;
15
-use Addiks\RDMBundle\Tests\Hydration\ServiceExample;
16 15
 use Symfony\Component\DependencyInjection\ContainerInterface;
17 16
 use Addiks\RDMBundle\DataLoader\DataLoaderInterface;
18 17
 
Please login to merge, or discard this patch.