Completed
Pull Request — master (#101)
by Alex
158:08 queued 147:57
created
tests/EdmxTest.php 1 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 3 patches
Doc Comments   +17 added lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@  discard block
 block discarded – undo
49 49
         return $this->serializer->serialize($this->getEdmx(), "xml");
50 50
     }
51 51
 
52
+    /**
53
+     * @param string $name
54
+     */
52 55
     public function addEntityType($name, $accessType = "Public", $summary = null, $longDescription = null)
53 56
     {
54 57
         $NewEntity = new TEntityTypeType();
@@ -124,6 +127,11 @@  discard block
 block discarded – undo
124 127
         return $NewProperty;
125 128
     }
126 129
 
130
+    /**
131
+     * @param string $name
132
+     * @param string $type
133
+     * @param string $storeGeneratedPattern
134
+     */
127 135
     public function addPropertyToEntityType(
128 136
         $entityType,
129 137
         $name,
@@ -161,6 +169,11 @@  discard block
 block discarded – undo
161 169
         return $NewProperty;
162 170
     }
163 171
 
172
+    /**
173
+     * @param string $principalMultiplicity
174
+     * @param string $principalProperty
175
+     * @param string $dependentMultiplicity
176
+     */
164 177
     public function addNavigationPropertyToEntityType(
165 178
         TEntityTypeType $principalType,
166 179
         $principalMultiplicity,
@@ -337,6 +350,10 @@  discard block
 block discarded – undo
337 350
         return $association;
338 351
     }
339 352
 
353
+    /**
354
+     * @param string $principalEntitySetName
355
+     * @param string $dependentEntitySetName
356
+     */
340 357
     protected function createAssocationSetForAssocation(
341 358
         TAssociationType $association,
342 359
         $principalEntitySetName,
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         if (0 == strlen(trim($namespace))) {
65 65
             $entityTypeName = $NewEntity->getName();
66 66
         } else {
67
-            $entityTypeName = $namespace . "." . $NewEntity->getName();
67
+            $entityTypeName = $namespace.".".$NewEntity->getName();
68 68
         }
69 69
         $entitySet->setEntityType($entityTypeName);
70 70
         $entitySet->setGetterAccess($accessType);
@@ -181,21 +181,21 @@  discard block
 block discarded – undo
181 181
     ) {
182 182
         $principalEntitySetName = Str::plural($principalType->getName(), 2);
183 183
         $dependentEntitySetName = Str::plural($dependentType->getName(), 2);
184
-        $relationName = $principalType->getName() . "_" . $principalProperty . "_"
185
-                        . $dependentType->getName() . "_" . $dependentProperty;
184
+        $relationName = $principalType->getName()."_".$principalProperty."_"
185
+                        . $dependentType->getName()."_".$dependentProperty;
186 186
         $relationName = trim($relationName, "_");
187 187
 
188 188
         $namespace = $this->V3Edmx->getDataServiceType()->getSchema()[0]->getNamespace();
189 189
         if (0 == strlen(trim($namespace))) {
190 190
             $relationFQName = $relationName;
191 191
         } else {
192
-            $relationFQName = $namespace . "." . $relationName;
192
+            $relationFQName = $namespace.".".$relationName;
193 193
         }
194 194
 
195 195
         $principalNavigationProperty = new TNavigationPropertyType();
196 196
         $principalNavigationProperty->setName($principalProperty);
197
-        $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_"));
198
-        $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty);
197
+        $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_"));
198
+        $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty);
199 199
         $principalNavigationProperty->setRelationship($relationFQName);
200 200
         $principalNavigationProperty->setGetterAccess($principalGetterAccess);
201 201
         $principalNavigationProperty->setSetterAccess($principalSetterAccess);
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
         if (!empty($dependentProperty)) {
211 211
             $dependentNavigationProperty = new TNavigationPropertyType();
212 212
             $dependentNavigationProperty->setName($dependentProperty);
213
-            $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty);
214
-            $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty);
213
+            $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty);
214
+            $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty);
215 215
             $dependentNavigationProperty->setRelationship($relationFQName);
216 216
             $dependentNavigationProperty->setGetterAccess($dependentGetterAccess);
217 217
             $dependentNavigationProperty->setSetterAccess($dependentSetterAccess);
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
             $principalTypeFQName = $principalType->getName();
281 281
             $dependentTypeFQName = $dependentType->getName();
282 282
         } else {
283
-            $principalTypeFQName = $namespace . "." . $principalType->getName();
284
-            $dependentTypeFQName = $namespace . "." . $dependentType->getName();
283
+            $principalTypeFQName = $namespace.".".$principalType->getName();
284
+            $dependentTypeFQName = $namespace.".".$dependentType->getName();
285 285
         }
286 286
         $association = new TAssociationType();
287 287
         $relationship = $principalNavigationProperty->getRelationship();
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         if (0 == strlen(trim($namespace))) {
350 350
             $associationSetName = $association->getName();
351 351
         } else {
352
-            $associationSetName = $namespace . "." . $association->getName();
352
+            $associationSetName = $namespace.".".$association->getName();
353 353
         }
354 354
         $as->setAssociation($associationSetName);
355 355
         $end1 = new EndAnonymousType();
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 
371 371
     private function initSerialiser()
372 372
     {
373
-        $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata";
373
+        $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata";
374 374
         $this->serializer =
375 375
             SerializerBuilder::create()
376 376
                 ->addMetadataDir($ymlDir)
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,6 @@
 block discarded – undo
15 15
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityPropertyType;
16 16
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityTypeType;
17 17
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionImportReturnTypeType;
18
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType;
19
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionType;
20 18
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TNavigationPropertyType;
21 19
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TPropertyRefType;
22 20
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TReferentialConstraintRoleElementType;
Please login to merge, or discard this patch.
src/MetadataV3/edm/Groups/TFunctionImportAttributesTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     public function isTFunctionImportAttributesValid(&$msg)
266 266
     {
267 267
         if (!$this->isTSimpleIdentifierValid($this->name)) {
268
-            $msg = "Name must be a valid TSimpleIdentifier: " . get_class($this);
268
+            $msg = "Name must be a valid TSimpleIdentifier: ".get_class($this);
269 269
             return false;
270 270
         }
271 271
         if ($this->isComposable && $this->isSideEffecting) {
@@ -278,11 +278,11 @@  discard block
 block discarded – undo
278 278
             return false;
279 279
         }*/
280 280
         if (!$this->isObjectNullOrType('\AlgoWeb\ODataMetadata\MetadataV3\edm\TOperandType', $this->entitySet)) {
281
-            $msg = "Entity set must be either null or an instance of TOperandType: " . get_class($this);
281
+            $msg = "Entity set must be either null or an instance of TOperandType: ".get_class($this);
282 282
             return false;
283 283
         }
284 284
         if (null != $this->methodAccess && $this->isTAccessOk($this->methodAccess)) {
285
-            $msg = "Method access must be a valid TAccess: " . get_class($this);
285
+            $msg = "Method access must be a valid TAccess: ".get_class($this);
286 286
             return false;
287 287
         }
288 288
         if (!$this->isValidArrayOK(
Please login to merge, or discard this patch.
src/MetadataV3/edm/TFunctionType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -308,7 +308,7 @@
 block discarded – undo
308 308
         }
309 309
         foreach ($this->returnType as $type) {
310 310
             if (!is_string($type) || !$this->isTCommandTextValid($type)) {
311
-                $msg = var_dump($type) . " must be a valid TCommandText";
311
+                $msg = var_dump($type)." must be a valid TCommandText";
312 312
                 return false;
313 313
             }
314 314
         }
Please login to merge, or discard this patch.
src/MetadataV3/edm/EntityContainer/FunctionImportAnonymousType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@
 block discarded – undo
138 138
         }
139 139
 
140 140
         $numParms = count($this->parameter);
141
-        for ($i = 0; $i < $numParms -2; $i++) {
141
+        for ($i = 0; $i < $numParms - 2; $i++) {
142 142
             $outName = $this->parameter[$i]->getName();
143 143
             for ($j = $i + 1; $j < $numParms - 1; $j++) {
144 144
                 $inName = $this->parameter[$j]->getName();
Please login to merge, or discard this patch.