Passed
Push — master ( 317eb4...7e3691 )
by Alex
04:52
created
src/MetadataV4/edm/IsOKTraits/TSimpleIdentifierTrait.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
 {
9 9
     use xsdRestrictions;
10 10
 
11
+    /**
12
+     * @param string $TSimpleIdentifier
13
+     */
11 14
     protected function isTSimpleIdentifierValid($TSimpleIdentifier)
12 15
     {
13 16
         if (!$this->isNCName($TSimpleIdentifier)) {
Please login to merge, or discard this patch.
src/MetadataV3/edm/TEntityTypeType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -467,20 +467,20 @@
 block discarded – undo
467 467
         $pArray = [];
468 468
         foreach ($this->getProperty() as $prop) {
469 469
             if (in_array($prop->getName(), $pArray)) {
470
-                $msg = "Property Names, and Navigation Property Must Be Unique " . __CLASS__;
470
+                $msg = "Property Names, and Navigation Property Must Be Unique ".__CLASS__;
471 471
                 return false;
472 472
             }
473 473
             $pArray[] = $prop->getName();
474 474
         }
475 475
         foreach ($this->getNavigationProperty() as $prop) {
476 476
             if (in_array($prop->getName(), $pArray)) {
477
-                $msg = "Property Names, and Navigation Property Must Be Unique " . __CLASS__;
477
+                $msg = "Property Names, and Navigation Property Must Be Unique ".__CLASS__;
478 478
                 return false;
479 479
             }
480 480
             $pArray[] = $prop->getName();
481 481
         }
482 482
         if (in_array($this->getName(), $pArray)) {
483
-            $msg = "entity types can not contain a property with the same name " . __CLASS__;
483
+            $msg = "entity types can not contain a property with the same name ".__CLASS__;
484 484
             return false;
485 485
         }
486 486
         return true;
Please login to merge, or discard this patch.
tests/MetadataManagerTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -29,6 +29,9 @@
 block discarded – undo
29 29
         $this->v3MetadataAgainstXSD($d);
30 30
     }
31 31
 
32
+    /**
33
+     * @param string $data
34
+     */
32 35
     public function v3MetadataAgainstXSD($data)
33 36
     {
34 37
         $ds = DIRECTORY_SEPARATOR;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $ds = DIRECTORY_SEPARATOR;
31 31
 
32
-        $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
32
+        $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd";
33 33
         if (!file_exists($goodxsd)) {
34 34
             return true;
35 35
         }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $metadataManager = new MetadataManager();
44 44
 
45 45
         $eType = $metadataManager->addEntityType("Category");
46
-        $this->assertNotFalse($eType, "Etype is false not type " . $metadataManager->getLastError());
46
+        $this->assertNotFalse($eType, "Etype is false not type ".$metadataManager->getLastError());
47 47
         $metadataManager->addPropertyToEntityType($eType, "CategoryID", "Int32", null, false, true, "Identity");
48 48
         $metadataManager->addPropertyToEntityType($eType, "CategoryName", "String");
49 49
         $metadataManager->addPropertyToEntityType($eType, "Description", "String");
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $metadataManager = new MetadataManager();
70 70
 
71 71
         $CategoryType = $metadataManager->addEntityType("Category");
72
-        $this->assertNotFalse($CategoryType, "Etype is false not type " . $metadataManager->getLastError());
72
+        $this->assertNotFalse($CategoryType, "Etype is false not type ".$metadataManager->getLastError());
73 73
         $metadataManager->addPropertyToEntityType($CategoryType, "CategoryID", "Int32", null, false, true, "Identity");
74 74
         $metadataManager->addPropertyToEntityType($CategoryType, "CategoryName", "String");
75 75
         $metadataManager->addPropertyToEntityType($CategoryType, "Description", "String");
Please login to merge, or discard this patch.
src/MetadataV3/edm/IsOKTraits/TPropertyTypeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         $regex = "/[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}(\.[\p{L}\p{Nl}][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}){0,}/";
14 14
 
15 15
         if (!is_string($string)) {
16
-            $msg = "Input must be a string: ". get_class($this);
16
+            $msg = "Input must be a string: ".get_class($this);
17 17
             throw new \InvalidArgumentException($msg);
18 18
         }
19 19
         if ($this->isEDMSimpleTypeValid($string)) {
Please login to merge, or discard this patch.
MetadataV3/edm/IsOKTraits/TFunctionImportParameterAndReturnTypeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         $regex = "/Collection\([^ \t]{1,}(\.[^ \t]{1,}){0,}\)/";
18 18
 
19 19
         if (!is_string($string)) {
20
-            $msg = "Input must be a string: ". get_class($this);
20
+            $msg = "Input must be a string: ".get_class($this);
21 21
             throw new \InvalidArgumentException($msg);
22 22
         }
23 23
         if ($this->isEDMSimpleTypeValid($string)) {
Please login to merge, or discard this patch.
src/MetadataV3/edm/IsOKTraits/TUnwrappedFunctionTypeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         $regex = '/[^ \t]{1,}(\.[^ \t]{1,}){0,}/';
18 18
 
19 19
         if (!is_string($string)) {
20
-            $msg = "Input must be a string: ". get_class($this);
20
+            $msg = "Input must be a string: ".get_class($this);
21 21
             throw new \InvalidArgumentException($msg);
22 22
         }
23 23
         if ($this->isTQualifiedNameValid($string)) {
Please login to merge, or discard this patch.
src/MetadataV3/edm/IsOKTraits/TWrappedFunctionTypeTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
         $regex = '/(Collection|Ref)\([^ \t]{1,}(\.[^ \t]{1,}){0,}\/)';
18 18
 
19 19
         if (!is_string($string)) {
20
-            $msg = "Input must be a string: ". get_class($this);
20
+            $msg = "Input must be a string: ".get_class($this);
21 21
             throw new \InvalidArgumentException($msg);
22 22
         }
23 23
         if ($this->isTQualifiedNameValid($string)) {
Please login to merge, or discard this patch.
src/MetadataV3/edm/EntityContainer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function setName($name)
83 83
     {
84 84
         if (!$this->isTSimpleIdentifierValid($name)) {
85
-            $msg = "Name(" . $name . ") must be a valid TSimpleIdentifier";
85
+            $msg = "Name(".$name.") must be a valid TSimpleIdentifier";
86 86
             throw new \InvalidArgumentException($msg);
87 87
         }
88 88
         $this->name = $name;
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
     public function isOK(&$msg = null)
398 398
     {
399 399
         if (!$this->isTSimpleIdentifierValid($this->name)) {
400
-            $msg = "Name(" . $this->name . ") must be a valid TSimpleIdentifier " . __FILE__ . ":" . __LINE__;
400
+            $msg = "Name(".$this->name.") must be a valid TSimpleIdentifier ".__FILE__.":".__LINE__;
401 401
             return false;
402 402
         }
403 403
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         }
451 451
         foreach ($this->associationSet as $assocationSet) {
452 452
             if (!in_array($assocationSet->getEnd()[0]->getEntitySet(), $entityNames)) {
453
-                $msg = "The entitysets for assocations must have a valid entity set. " . $assocationSet->getName() . " Does not";
453
+                $msg = "The entitysets for assocations must have a valid entity set. ".$assocationSet->getName()." Does not";
454 454
                 return false;
455 455
             }
456 456
         }
Please login to merge, or discard this patch.
src/MetadataManager.php 2 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
         $this->startEdmxTransaction();
@@ -126,6 +129,11 @@  discard block
 block discarded – undo
126 129
         //$this->oldEdmx = null;
127 130
     }
128 131
 
132
+    /**
133
+     * @param string $name
134
+     * @param string $type
135
+     * @param string $storeGeneratedPattern
136
+     */
129 137
     public function addPropertyToEntityType(
130 138
         $entityType,
131 139
         $name,
@@ -166,6 +174,11 @@  discard block
 block discarded – undo
166 174
         return $NewProperty;
167 175
     }
168 176
 
177
+    /**
178
+     * @param string $principalMultiplicity
179
+     * @param string $principalProperty
180
+     * @param string $dependentMultiplicity
181
+     */
169 182
     public function addNavigationPropertyToEntityType(
170 183
         TEntityTypeType $principalType,
171 184
         $principalMultiplicity,
@@ -344,6 +357,10 @@  discard block
 block discarded – undo
344 357
         return $association;
345 358
     }
346 359
 
360
+    /**
361
+     * @param string $principalEntitySetName
362
+     * @param string $dependentEntitySetName
363
+     */
347 364
     protected function createAssocationSetForAssocation(
348 365
         TAssociationType $association,
349 366
         $principalEntitySetName,
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         if (!$this->V3Edmx->isOK($msg)) {
31 31
             throw new \Exception($msg);
32 32
         }
33
-        $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata";
33
+        $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata";
34 34
         $this->serializer =
35 35
             SerializerBuilder::create()
36 36
                 ->addMetadataDir($ymlDir)
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         if (0 == strlen(trim($namespace))) {
68 68
             $entityTypeName = $NewEntity->getName();
69 69
         } else {
70
-            $entityTypeName = $namespace . "." . $NewEntity->getName();
70
+            $entityTypeName = $namespace.".".$NewEntity->getName();
71 71
         }
72 72
         $entitySet->setEntityType($entityTypeName);
73 73
         $entitySet->setGetterAccess($accessType);
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
         $last_letter = strtolower($singular[strlen($singular) - 1]);
109 109
         switch ($last_letter) {
110 110
             case 'y':
111
-                return substr($singular, 0, -1) . 'ies';
111
+                return substr($singular, 0, -1).'ies';
112 112
             case 's':
113
-                return $singular . 'es';
113
+                return $singular.'es';
114 114
             default:
115
-                return $singular . 's';
115
+                return $singular.'s';
116 116
         }
117 117
     }
118 118
 
@@ -187,21 +187,21 @@  discard block
 block discarded – undo
187 187
         $this->startEdmxTransaction();
188 188
         $principalEntitySetName = $this->pluralize(2, $principalType->getName());
189 189
         $dependentEntitySetName = $this->pluralize(2, $dependentType->getName());
190
-        $relationName = $principalType->getName() . "_" . $principalProperty . "_"
191
-                        . $dependentType->getName() . "_" . $dependentProperty;
190
+        $relationName = $principalType->getName()."_".$principalProperty."_"
191
+                        . $dependentType->getName()."_".$dependentProperty;
192 192
         $relationName = trim($relationName, "_");
193 193
 
194 194
         $namespace = $this->V3Edmx->getDataServiceType()->getSchema()[0]->getNamespace();
195 195
         if (0 == strlen(trim($namespace))) {
196 196
             $relationFQName = $relationName;
197 197
         } else {
198
-            $relationFQName = $namespace . "." . $relationName;
198
+            $relationFQName = $namespace.".".$relationName;
199 199
         }
200 200
 
201 201
         $principalNavigationProperty = new TNavigationPropertyType();
202 202
         $principalNavigationProperty->setName($principalProperty);
203
-        $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_"));
204
-        $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty);
203
+        $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_"));
204
+        $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty);
205 205
         $principalNavigationProperty->setRelationship($relationFQName);
206 206
         $principalNavigationProperty->setGetterAccess($principalGetterAccess);
207 207
         $principalNavigationProperty->setSetterAccess($principalSetterAccess);
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
         if (!empty($dependentProperty)) {
217 217
             $dependentNavigationProperty = new TNavigationPropertyType();
218 218
             $dependentNavigationProperty->setName($dependentProperty);
219
-            $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty);
220
-            $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty);
219
+            $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty);
220
+            $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty);
221 221
             $dependentNavigationProperty->setRelationship($relationFQName);
222 222
             $dependentNavigationProperty->setGetterAccess($dependentGetterAccess);
223 223
             $dependentNavigationProperty->setSetterAccess($dependentSetterAccess);
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
             $principalTypeFQName = $principalType->getName();
289 289
             $dependentTypeFQName = $dependentType->getName();
290 290
         } else {
291
-            $principalTypeFQName = $namespace . "." . $principalType->getName();
292
-            $dependentTypeFQName = $namespace . "." . $dependentType->getName();
291
+            $principalTypeFQName = $namespace.".".$principalType->getName();
292
+            $dependentTypeFQName = $namespace.".".$dependentType->getName();
293 293
         }
294 294
         $association = new TAssociationType();
295 295
         $relationship = $principalNavigationProperty->getRelationship();
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
         if (0 == strlen(trim($namespace))) {
358 358
             $associationSetName = $association->getName();
359 359
         } else {
360
-            $associationSetName = $namespace . "." . $association->getName();
360
+            $associationSetName = $namespace.".".$association->getName();
361 361
         }
362 362
         $as->setAssociation($associationSetName);
363 363
         $end1 = new EndAnonymousType();
Please login to merge, or discard this patch.