Test Failed
Pull Request — master (#97)
by Christopher
08:39
created
tests/EdmxTest.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,6 +35,9 @@  discard block
 block discarded – undo
35 35
         $this->v3MetadataAgainstXSD($d);
36 36
     }
37 37
 
38
+    /**
39
+     * @param string $data
40
+     */
38 41
     public function v3MetadataAgainstXSD($data)
39 42
     {
40 43
         $ds = DIRECTORY_SEPARATOR;
@@ -59,7 +62,7 @@  discard block
 block discarded – undo
59 62
     }
60 63
 
61 64
     /**
62
-     * @param $ds
65
+     * @param string $ds
63 66
      * @param $edmx
64 67
      * @param $msg
65 68
      */
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use AlgoWeb\ODataMetadata\MetadataV3\edm\Schema;
6 6
 use AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx;
7
-
8 7
 use Illuminate\Support\Str;
9
-
10 8
 use AlgoWeb\ODataMetadata\MetadataV3\edmx\TDataServicesType;
11 9
 use AlgoWeb\ODataMetadata\MetadataV3\edmx\TEdmxType;
12 10
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $edmx = new Edmx();
27 27
         $this->assertTrue($edmx->isOK($msg), $msg);
28 28
         $this->assertNull($msg);
29
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
29
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
30 30
         $serializer =
31 31
             \JMS\Serializer\SerializerBuilder::create()
32 32
                 ->addMetadataDir($ymlDir)
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $ds = DIRECTORY_SEPARATOR;
41 41
 
42
-        $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
42
+        $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
43 43
         if (!file_exists($goodxsd)) {
44 44
             return true;
45 45
         }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     private function checkEdmxSerialiseDeserialiseRoundTrip($ds, $edmx, $msg)
67 67
     {
68
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
68
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
69 69
         $serializer =
70 70
             \JMS\Serializer\SerializerBuilder::create()
71 71
                 ->addMetadataDir($ymlDir)
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $this->assertNull($msg);
113 113
 
114 114
 
115
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
115
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
116 116
         $serializer =
117 117
             \JMS\Serializer\SerializerBuilder::create()
118 118
                 ->addMetadataDir($ymlDir)
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
         $ds = DIRECTORY_SEPARATOR;
145 145
         $msg = null;
146 146
 
147
-        $docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceDocument.xml";
147
+        $docLocation = dirname(__DIR__).$ds."tests".$ds."exampleV3ServiceDocument.xml";
148 148
         $document = file_get_contents($docLocation);
149 149
         $type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\TDataServicesType';
150
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
150
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
151 151
 
152 152
         $serializer =
153 153
             \JMS\Serializer\SerializerBuilder::create()
@@ -164,10 +164,10 @@  discard block
 block discarded – undo
164 164
         $ds = DIRECTORY_SEPARATOR;
165 165
         $msg = null;
166 166
 
167
-        $docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceMetadata.xml";
167
+        $docLocation = dirname(__DIR__).$ds."tests".$ds."exampleV3ServiceMetadata.xml";
168 168
         $document = file_get_contents($docLocation);
169 169
         $type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx';
170
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
170
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
171 171
 
172 172
         $serializer =
173 173
             \JMS\Serializer\SerializerBuilder::create()
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
         $ds = DIRECTORY_SEPARATOR;
186 186
         $msg = null;
187 187
 
188
-        $docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceMetadata.xml";
188
+        $docLocation = dirname(__DIR__).$ds."tests".$ds."exampleV3ServiceMetadata.xml";
189 189
         $document = file_get_contents($docLocation);
190 190
         $this->v3MetadataAgainstXSD($document);
191 191
         $type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx';
192
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
192
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
193 193
 
194 194
         $serializer =
195 195
             \JMS\Serializer\SerializerBuilder::create()
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         $this->assertNull($msg);
231 231
 
232 232
 
233
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
233
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
234 234
         $serializer =
235 235
             \JMS\Serializer\SerializerBuilder::create()
236 236
                 ->addMetadataDir($ymlDir)
Please login to merge, or discard this patch.
src/MetadataManager.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         if (!$this->V3Edmx->isOK($msg)) {
32 32
             throw new \Exception($msg);
33 33
         }
34
-        $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata";
34
+        $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata";
35 35
         $this->serializer =
36 36
             SerializerBuilder::create()
37 37
                 ->addMetadataDir($ymlDir)
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         if (0 == strlen(trim($namespace))) {
69 69
             $entityTypeName = $NewEntity->getName();
70 70
         } else {
71
-            $entityTypeName = $namespace . "." . $NewEntity->getName();
71
+            $entityTypeName = $namespace.".".$NewEntity->getName();
72 72
         }
73 73
         $entitySet->setEntityType($entityTypeName);
74 74
         $entitySet->setGetterAccess($accessType);
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
         $last_letter = strtolower($singular[strlen($singular) - 1]);
110 110
         switch ($last_letter) {
111 111
             case 'y':
112
-                return substr($singular, 0, -1) . 'ies';
112
+                return substr($singular, 0, -1).'ies';
113 113
             case 's':
114
-                return $singular . 'es';
114
+                return $singular.'es';
115 115
             default:
116
-                return $singular . 's';
116
+                return $singular.'s';
117 117
         }
118 118
     }
119 119
 
@@ -188,21 +188,21 @@  discard block
 block discarded – undo
188 188
         $this->startEdmxTransaction();
189 189
         $principalEntitySetName = Str::plural($principalType->getName(), 2);
190 190
         $dependentEntitySetName = Str::plural($dependentType->getName(), 2);
191
-        $relationName = $principalType->getName() . "_" . $principalProperty . "_"
192
-                        . $dependentType->getName() . "_" . $dependentProperty;
191
+        $relationName = $principalType->getName()."_".$principalProperty."_"
192
+                        . $dependentType->getName()."_".$dependentProperty;
193 193
         $relationName = trim($relationName, "_");
194 194
 
195 195
         $namespace = $this->V3Edmx->getDataServiceType()->getSchema()[0]->getNamespace();
196 196
         if (0 == strlen(trim($namespace))) {
197 197
             $relationFQName = $relationName;
198 198
         } else {
199
-            $relationFQName = $namespace . "." . $relationName;
199
+            $relationFQName = $namespace.".".$relationName;
200 200
         }
201 201
 
202 202
         $principalNavigationProperty = new TNavigationPropertyType();
203 203
         $principalNavigationProperty->setName($principalProperty);
204
-        $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_"));
205
-        $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty);
204
+        $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_"));
205
+        $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty);
206 206
         $principalNavigationProperty->setRelationship($relationFQName);
207 207
         $principalNavigationProperty->setGetterAccess($principalGetterAccess);
208 208
         $principalNavigationProperty->setSetterAccess($principalSetterAccess);
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
         if (!empty($dependentProperty)) {
218 218
             $dependentNavigationProperty = new TNavigationPropertyType();
219 219
             $dependentNavigationProperty->setName($dependentProperty);
220
-            $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty);
221
-            $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty);
220
+            $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty);
221
+            $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty);
222 222
             $dependentNavigationProperty->setRelationship($relationFQName);
223 223
             $dependentNavigationProperty->setGetterAccess($dependentGetterAccess);
224 224
             $dependentNavigationProperty->setSetterAccess($dependentSetterAccess);
@@ -289,8 +289,8 @@  discard block
 block discarded – undo
289 289
             $principalTypeFQName = $principalType->getName();
290 290
             $dependentTypeFQName = $dependentType->getName();
291 291
         } else {
292
-            $principalTypeFQName = $namespace . "." . $principalType->getName();
293
-            $dependentTypeFQName = $namespace . "." . $dependentType->getName();
292
+            $principalTypeFQName = $namespace.".".$principalType->getName();
293
+            $dependentTypeFQName = $namespace.".".$dependentType->getName();
294 294
         }
295 295
         $association = new TAssociationType();
296 296
         $relationship = $principalNavigationProperty->getRelationship();
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         if (0 == strlen(trim($namespace))) {
359 359
             $associationSetName = $association->getName();
360 360
         } else {
361
-            $associationSetName = $namespace . "." . $association->getName();
361
+            $associationSetName = $namespace.".".$association->getName();
362 362
         }
363 363
         $as->setAssociation($associationSetName);
364 364
         $end1 = new EndAnonymousType();
Please login to merge, or discard this patch.