Test Failed
Pull Request — master (#104)
by Alex
04:42
created
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.
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.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         if (0 == strlen(trim($namespace))) {
70 70
             $entityTypeName = $NewEntity->getName();
71 71
         } else {
72
-            $entityTypeName = $namespace . "." . $NewEntity->getName();
72
+            $entityTypeName = $namespace.".".$NewEntity->getName();
73 73
         }
74 74
         $entitySet->setEntityType($entityTypeName);
75 75
         $entitySet->setGetterAccess($accessType);
@@ -190,21 +190,21 @@  discard block
 block discarded – undo
190 190
     ) {
191 191
         $principalEntitySetName = Str::plural($principalType->getName(), 2);
192 192
         $dependentEntitySetName = Str::plural($dependentType->getName(), 2);
193
-        $relationName = $principalType->getName() . "_" . $principalProperty . "_"
194
-                        . $dependentType->getName() . "_" . $dependentProperty;
193
+        $relationName = $principalType->getName()."_".$principalProperty."_"
194
+                        . $dependentType->getName()."_".$dependentProperty;
195 195
         $relationName = trim($relationName, "_");
196 196
 
197 197
         $namespace = $this->V3Edmx->getDataServiceType()->getSchema()[0]->getNamespace();
198 198
         if (0 == strlen(trim($namespace))) {
199 199
             $relationFQName = $relationName;
200 200
         } else {
201
-            $relationFQName = $namespace . "." . $relationName;
201
+            $relationFQName = $namespace.".".$relationName;
202 202
         }
203 203
 
204 204
         $principalNavigationProperty = new TNavigationPropertyType();
205 205
         $principalNavigationProperty->setName($principalProperty);
206
-        $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_"));
207
-        $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty);
206
+        $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_"));
207
+        $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty);
208 208
         $principalNavigationProperty->setRelationship($relationFQName);
209 209
         $principalNavigationProperty->setGetterAccess($principalGetterAccess);
210 210
         $principalNavigationProperty->setSetterAccess($principalSetterAccess);
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
         if (!empty($dependentProperty)) {
220 220
             $dependentNavigationProperty = new TNavigationPropertyType();
221 221
             $dependentNavigationProperty->setName($dependentProperty);
222
-            $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty);
223
-            $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty);
222
+            $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty);
223
+            $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty);
224 224
             $dependentNavigationProperty->setRelationship($relationFQName);
225 225
             $dependentNavigationProperty->setGetterAccess($dependentGetterAccess);
226 226
             $dependentNavigationProperty->setSetterAccess($dependentSetterAccess);
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         array $principalConstraintProperty = null,
272 272
         array $dependentConstraintProperty = null
273 273
     ) {
274
-        $multCombo = [ '*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']];
274
+        $multCombo = ['*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']];
275 275
         $multKeys = array_keys($multCombo);
276 276
         if (null != $dependentNavigationProperty) {
277 277
             if ($dependentNavigationProperty->getRelationship() != $principalNavigationProperty->getRelationship()) {
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         }
291 291
         if (!in_array($dependentMultiplicity, $multCombo[$principalMultiplicity])) {
292 292
             throw new \InvalidArgumentException(
293
-                "Invalid multiplicity combination - ". $principalMultiplicity . ' ' . $dependentMultiplicity
293
+                "Invalid multiplicity combination - ".$principalMultiplicity.' '.$dependentMultiplicity
294 294
             );
295 295
         }
296 296
 
@@ -300,8 +300,8 @@  discard block
 block discarded – undo
300 300
             $principalTypeFQName = $principalType->getName();
301 301
             $dependentTypeFQName = $dependentType->getName();
302 302
         } else {
303
-            $principalTypeFQName = $namespace . "." . $principalType->getName();
304
-            $dependentTypeFQName = $namespace . "." . $dependentType->getName();
303
+            $principalTypeFQName = $namespace.".".$principalType->getName();
304
+            $dependentTypeFQName = $namespace.".".$dependentType->getName();
305 305
         }
306 306
         $association = new TAssociationType();
307 307
         $relationship = $principalNavigationProperty->getRelationship();
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         if (0 == strlen(trim($namespace))) {
370 370
             $associationSetName = $association->getName();
371 371
         } else {
372
-            $associationSetName = $namespace . "." . $association->getName();
372
+            $associationSetName = $namespace.".".$association->getName();
373 373
         }
374 374
         $as->setAssociation($associationSetName);
375 375
         $end1 = new EndAnonymousType();
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
     private function initSerialiser()
437 437
     {
438
-        $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata";
438
+        $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata";
439 439
         $this->serializer =
440 440
             SerializerBuilder::create()
441 441
                 ->addMetadataDir($ymlDir)
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/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.
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 = implode($type) . " must be a valid TCommandText";
311
+                $msg = implode($type)." must be a valid TCommandText";
312 312
                 return false;
313 313
             }
314 314
         }
Please login to merge, or discard this patch.
tests/MetadataManagerTest.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,6 @@
 block discarded – undo
8 8
 use AlgoWeb\ODataMetadata\MetadataV3\edm\Schema;
9 9
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TAssociationType;
10 10
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityTypeType;
11
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType;
12
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionType;
13 11
 use AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx;
14 12
 use Mockery as m;
15 13
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $ds = DIRECTORY_SEPARATOR;
34 34
 
35
-        $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
35
+        $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
36 36
         if (!file_exists($goodxsd)) {
37 37
             return true;
38 38
         }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $result = null;
48 48
 
49 49
         list($eType, $result) = $metadataManager->addEntityType("Category");
50
-        $this->assertNotFalse($eType, "Etype is false not type " . $metadataManager->getLastError());
50
+        $this->assertNotFalse($eType, "Etype is false not type ".$metadataManager->getLastError());
51 51
         $metadataManager->addPropertyToEntityType($eType, "CategoryID", "Int32", null, false, true, "Identity");
52 52
         $metadataManager->addPropertyToEntityType($eType, "CategoryName", "String");
53 53
         $metadataManager->addPropertyToEntityType($eType, "Description", "String");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $result = null;
75 75
 
76 76
         list($CategoryType, $result) = $metadataManager->addEntityType("Category");
77
-        $this->assertNotFalse($CategoryType, "Etype is false not type " . $metadataManager->getLastError());
77
+        $this->assertNotFalse($CategoryType, "Etype is false not type ".$metadataManager->getLastError());
78 78
         $metadataManager->addPropertyToEntityType($CategoryType, "CategoryID", "Int32", null, false, true, "Identity");
79 79
         $metadataManager->addPropertyToEntityType($CategoryType, "CategoryName", "String");
80 80
         $metadataManager->addPropertyToEntityType($CategoryType, "Description", "String");
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
         $this->assertTrue($CategoryType->isOK($msg), $msg);
552 552
         $this->assertTrue($CustomerType->isOK($msg), $msg);
553 553
 
554
-        $expected =  "Invalid multiplicity combination - 1 1";
554
+        $expected = "Invalid multiplicity combination - 1 1";
555 555
         $actual = null;
556 556
 
557 557
         try {
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
         $this->assertTrue($CategoryType->isOK($msg), $msg);
581 581
         $this->assertTrue($CustomerType->isOK($msg), $msg);
582 582
 
583
-        $expected =  "Invalid multiplicity combination - * 0..1";
583
+        $expected = "Invalid multiplicity combination - * 0..1";
584 584
         $actual = null;
585 585
 
586 586
         try {
Please login to merge, or discard this patch.