Completed
Push — master ( 7e3691...614a48 )
by Christopher
05:10
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
@@ -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.