Completed
Push — dev ( 867b7a...526cfa )
by Андрей
02:26
created
src/ObjectManager/Exception/InvalidObjectManagerNameException.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
src/Utils/DoctrineOrmModuleConfigInterface.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
src/Utils/DoctrineOrmModuleConfig.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @var array
30 30
      */
31
-    protected $doctrineConfig = [];
31
+    protected $doctrineConfig = [ ];
32 32
 
33 33
     /**
34 34
      * Ключем является имя ObjectManager'a значением либо массив содержащий имена неймспейсов в которых расположены
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @var array
39 39
      */
40
-    protected $namespacesByObjectManagerCache = [];
40
+    protected $namespacesByObjectManagerCache = [ ];
41 41
 
42 42
     /**
43 43
      * Опции модуля
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @param array                  $doctrineConfig
53 53
      * @param ModuleOptionsInterface $moduleOptions
54 54
      */
55
-    public function __construct(array $doctrineConfig = [], ModuleOptionsInterface $moduleOptions)
55
+    public function __construct(array $doctrineConfig = [ ], ModuleOptionsInterface $moduleOptions)
56 56
     {
57 57
         $this->setDoctrineConfig($doctrineConfig);
58 58
         $this->setModuleOptions($moduleOptions);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      *
77 77
      * @return $this
78 78
      */
79
-    public function setDoctrineConfig(array $doctrineConfig = [])
79
+    public function setDoctrineConfig(array $doctrineConfig = [ ])
80 80
     {
81 81
         $this->doctrineConfig = $doctrineConfig;
82 82
 
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
     public function hasNamespacesByObjectManager($objectManagerServiceName)
94 94
     {
95 95
         if (array_key_exists($objectManagerServiceName, $this->namespacesByObjectManagerCache)) {
96
-            return false !== $this->namespacesByObjectManagerCache[$objectManagerServiceName];
96
+            return false !== $this->namespacesByObjectManagerCache[ $objectManagerServiceName ];
97 97
         }
98 98
 
99 99
         if (!$this->isValidDoctrineOrmModuleConfig()) {
100
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
100
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
101 101
             return false;
102 102
         }
103 103
 
104 104
         if (0 !== strpos($objectManagerServiceName, static::DOCTRINE_PREFIX)) {
105
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
105
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
106 106
             return false;
107 107
         }
108 108
 
@@ -110,49 +110,49 @@  discard block
 block discarded – undo
110 110
 
111 111
         $doctrineConfig = $this->getDoctrineConfig();
112 112
 
113
-        if (!array_key_exists($objectManagerName, $doctrineConfig['entitymanager'])) {
114
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
113
+        if (!array_key_exists($objectManagerName, $doctrineConfig[ 'entitymanager' ])) {
114
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
115 115
             return false;
116 116
         }
117 117
 
118
-        $omConfig = $doctrineConfig['entitymanager'][$objectManagerName];
118
+        $omConfig = $doctrineConfig[ 'entitymanager' ][ $objectManagerName ];
119 119
 
120
-        if (!is_array($omConfig) || !array_key_exists('configuration', $omConfig) || !is_string($omConfig['configuration'])) {
121
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
120
+        if (!is_array($omConfig) || !array_key_exists('configuration', $omConfig) || !is_string($omConfig[ 'configuration' ])) {
121
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
122 122
             return false;
123 123
         }
124 124
 
125
-        $confName = $omConfig['configuration'];
125
+        $confName = $omConfig[ 'configuration' ];
126 126
 
127
-        if (!array_key_exists($confName, $doctrineConfig['configuration']) || !is_array($doctrineConfig['configuration'][$confName])) {
128
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
127
+        if (!array_key_exists($confName, $doctrineConfig[ 'configuration' ]) || !is_array($doctrineConfig[ 'configuration' ][ $confName ])) {
128
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
129 129
             return false;
130 130
         }
131 131
 
132
-        $omConfiguration = $doctrineConfig['configuration'][$confName];
132
+        $omConfiguration = $doctrineConfig[ 'configuration' ][ $confName ];
133 133
 
134
-        if (!array_key_exists('driver', $omConfiguration) || !is_string($omConfiguration['driver'])) {
135
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
134
+        if (!array_key_exists('driver', $omConfiguration) || !is_string($omConfiguration[ 'driver' ])) {
135
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
136 136
             return false;
137 137
         }
138 138
 
139
-        $driverName = $omConfiguration['driver'];
139
+        $driverName = $omConfiguration[ 'driver' ];
140 140
 
141
-        if (!array_key_exists($driverName, $doctrineConfig['driver']) || !is_array($doctrineConfig['driver'][$driverName])) {
142
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
141
+        if (!array_key_exists($driverName, $doctrineConfig[ 'driver' ]) || !is_array($doctrineConfig[ 'driver' ][ $driverName ])) {
142
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
143 143
             return false;
144 144
         }
145 145
 
146
-        $driverConfig = $doctrineConfig['driver'][$driverName];
146
+        $driverConfig = $doctrineConfig[ 'driver' ][ $driverName ];
147 147
 
148
-        if (!array_key_exists('drivers', $driverConfig) || !is_array($driverConfig['drivers'])) {
149
-            $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false;
148
+        if (!array_key_exists('drivers', $driverConfig) || !is_array($driverConfig[ 'drivers' ])) {
149
+            $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false;
150 150
             return false;
151 151
         }
152 152
 
153
-        $this->namespacesByObjectManagerCache[$objectManagerServiceName] = $this->buildIndexNamespaces($driverConfig['drivers']);
153
+        $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = $this->buildIndexNamespaces($driverConfig[ 'drivers' ]);
154 154
 
155
-        return false !== $this->namespacesByObjectManagerCache[$objectManagerServiceName];
155
+        return false !== $this->namespacesByObjectManagerCache[ $objectManagerServiceName ];
156 156
     }
157 157
 
158 158
     /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $moduleOptions = $this->getModuleOptions();
172 172
         $entitySeparator = $moduleOptions->getEntitySeparator();
173 173
 
174
-        $index = [];
174
+        $index = [ ];
175 175
         foreach ($listNamespaces as $currentNamespace) {
176 176
             $prepareNamespace = rtrim($currentNamespace, '\\');
177 177
             $normalizeNamespace = $prepareNamespace . '\\';
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             $normalizeNamespaceStack = explode($entitySeparator, $normalizeNamespace);
180 180
 
181 181
             $namespacePrefix = array_shift($normalizeNamespaceStack);
182
-            $index[$currentNamespace] = $namespacePrefix . $entitySeparator;
182
+            $index[ $currentNamespace ] = $namespacePrefix . $entitySeparator;
183 183
         }
184 184
 
185 185
         return $index;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             throw new Exception\EntityNamespacesNotFoundException($errMsh);
202 202
         }
203 203
 
204
-        return $this->namespacesByObjectManagerCache[$objectManagerServiceName];
204
+        return $this->namespacesByObjectManagerCache[ $objectManagerServiceName ];
205 205
     }
206 206
 
207 207
     /**
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
     {
215 215
         $doctrineConfig = $this->getDoctrineConfig();
216 216
 
217
-        return array_key_exists('entitymanager', $doctrineConfig) && is_array($doctrineConfig['entitymanager'])
218
-               && array_key_exists('configuration', $doctrineConfig) && is_array($doctrineConfig['configuration'])
219
-               && array_key_exists('driver', $doctrineConfig) && is_array($doctrineConfig['driver']);
217
+        return array_key_exists('entitymanager', $doctrineConfig) && is_array($doctrineConfig[ 'entitymanager' ])
218
+               && array_key_exists('configuration', $doctrineConfig) && is_array($doctrineConfig[ 'configuration' ])
219
+               && array_key_exists('driver', $doctrineConfig) && is_array($doctrineConfig[ 'driver' ]);
220 220
     }
221 221
 
222 222
     /**
Please login to merge, or discard this patch.
src/Utils/Exception/DomainException.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
src/Utils/Exception/EntityNamespacesNotFoundException.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
src/Utils/Exception/ExceptionInterface.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
src/Utils/DoctrineOrmModuleConfigFactory.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     {
31 31
         /** @var array  $appConfig */
32 32
         $appConfig = $serviceLocator->get('config');
33
-        $doctrineConfig = array_key_exists('doctrine', $appConfig) ? $appConfig['doctrine'] : [];
33
+        $doctrineConfig = array_key_exists('doctrine', $appConfig) ? $appConfig[ 'doctrine' ] : [ ];
34 34
 
35 35
         /** @var ModuleOptionsPluginManagerInterface $moduleOptionsManager */
36 36
         $moduleOptionsManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
src/EntityManager/Exception/ErrorBuildEntityPostfixException.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.
src/EntityManager/Exception/ErrorBuildEntityClassNameException.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @link    https://github.com/nnx-framework/doctrine
4
- * @author  Malofeykin Andrey  <[email protected]>
5
- */
3
+     * @link    https://github.com/nnx-framework/doctrine
4
+     * @author  Malofeykin Andrey  <[email protected]>
5
+     */
6 6
 namespace Nnx\Doctrine;
7 7
 
8 8
 use Nnx\Doctrine\ObjectManager\DoctrineObjectManager;
Please login to merge, or discard this patch.