Completed
Push — master ( e54666...fb0960 )
by Christopher
10:55 queued 05:18
created
src/MetadataV3/edm/IsOKTraits/EDMSimpleTypeTrait.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
             "GeometricMultiPoint", "GeometricMultiLineString", "GeometricMultiPolygon", "GeometryCollection",
14 14
             "Guid", "Int16", "Int32", "Int64", "String", "SByte"];
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 (!in_array($string, $validType)) {
Please login to merge, or discard this patch.
src/MetadataV3/edm/EntityContainer/AssociationSetAnonymousType.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer;
4 4
 
5 5
 use AlgoWeb\ODataMetadata\IsOK;
6
-use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
7 6
 use AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType\EndAnonymousType;
8 7
 use AlgoWeb\ODataMetadata\MetadataV3\edm\Groups\GEmptyElementExtensibilityTrait;
9 8
 use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TQualifiedNameTrait;
Please login to merge, or discard this patch.
edm/EntityContainer/AssociationSetAnonymousType/EndAnonymousType.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,10 +3,8 @@
 block discarded – undo
3 3
 namespace AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType;
4 4
 
5 5
 use AlgoWeb\ODataMetadata\IsOK;
6
-use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
7 6
 use AlgoWeb\ODataMetadata\MetadataV3\edm\Groups\GEmptyElementExtensibilityTrait;
8 7
 use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TSimpleIdentifierTrait;
9
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType;
10 8
 
11 9
 /**
12 10
  * Class representing EndAnonymousType
Please login to merge, or discard this patch.
src/MetadataV3/edm/EntityContainer.php 1 patch
Spacing   +2 added lines, -2 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
 
Please login to merge, or discard this patch.
src/MetadataV3/edm/TEntityPropertyType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function setStoreGeneratedPattern($storeGeneratedPattern)
69 69
     {
70 70
         if (null != $storeGeneratedPattern && !$this->isTGenerationPatternValid($storeGeneratedPattern)) {
71
-            $msg = "Store generation pattern must be a valid TGenerationPattern: " . get_class($this);
71
+            $msg = "Store generation pattern must be a valid TGenerationPattern: ".get_class($this);
72 72
             throw new \InvalidArgumentException($msg);
73 73
         }
74 74
         $this->storeGeneratedPattern = $storeGeneratedPattern;
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     public function isOK(&$msg = null)
282 282
     {
283 283
         if (null != $this->storeGeneratedPattern && !$this->isTGenerationPatternValid($this->storeGeneratedPattern)) {
284
-            $msg = "Store generation pattern must be a valid TGenerationPattern: " . get_class($this);
284
+            $msg = "Store generation pattern must be a valid TGenerationPattern: ".get_class($this);
285 285
             return false;
286 286
         }
287 287
         if (!$this->isValidArrayOK(
Please login to merge, or discard this patch.
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.
tests/EdmxTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $edmx = new Edmx();
21 21
         $this->assertTrue($edmx->isOK($msg), $msg);
22 22
         $this->assertNull($msg);
23
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
23
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
24 24
         $serializer =
25 25
             \JMS\Serializer\SerializerBuilder::create()
26 26
                 ->addMetadataDir($ymlDir)
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $ds = DIRECTORY_SEPARATOR;
35 35
         $xml = new \DOMDocument();
36 36
         $xml->loadXML($data);
37
-        $xml->schemaValidate(dirname(__DIR__) . $ds . "xsd" . $ds . "/Microsoft.Data.Entity.Design.Edmx_3.xsd");
37
+        $xml->schemaValidate(dirname(__DIR__).$ds."xsd".$ds."/Microsoft.Data.Entity.Design.Edmx_3.xsd");
38 38
     }
39 39
 
40 40
     public function testWithSingleEntitySerializeOk()
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $this->assertNull($msg);
52 52
 
53 53
 
54
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
54
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
55 55
         $serializer =
56 56
             \JMS\Serializer\SerializerBuilder::create()
57 57
                 ->addMetadataDir($ymlDir)
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $this->assertNull($msg);
89 89
 
90 90
 
91
-        $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata";
91
+        $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata";
92 92
         $serializer =
93 93
             \JMS\Serializer\SerializerBuilder::create()
94 94
                 ->addMetadataDir($ymlDir)
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
         $last_letter = strtolower($singular[strlen($singular) - 1]);
115 115
         switch ($last_letter) {
116 116
             case 'y':
117
-                return substr($singular, 0, -1) . 'ies';
117
+                return substr($singular, 0, -1).'ies';
118 118
             case 's':
119
-                return $singular . 'es';
119
+                return $singular.'es';
120 120
             default:
121
-                return $singular . 's';
121
+                return $singular.'s';
122 122
         }
123 123
     }
124 124
 }
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.
src/MetadataManager.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -44,6 +44,9 @@  discard block
 block discarded – undo
44 44
         return $this->serializer->serialize($this->V3Edmx, "xml");
45 45
     }
46 46
 
47
+    /**
48
+     * @param string $name
49
+     */
47 50
     public function addEntityType($name, $accessType = "Public", $summary = null, $longDescription = null)
48 51
     {
49 52
         $this->startEdmxTransaction();
@@ -121,6 +124,11 @@  discard block
 block discarded – undo
121 124
         $this->oldEdmx = null;
122 125
     }
123 126
 
127
+    /**
128
+     * @param string $name
129
+     * @param string $type
130
+     * @param string $storeGeneratedPattern
131
+     */
124 132
     public function addPropertyToEntityType(
125 133
         $entityType,
126 134
         $name,
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         if (!$this->V3Edmx->isOK($msg)) {
30 30
             throw new \Exception($msg);
31 31
         }
32
-        $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata";
32
+        $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata";
33 33
         $this->serializer =
34 34
             SerializerBuilder::create()
35 35
                 ->addMetadataDir($ymlDir)
@@ -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);
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
         $last_letter = strtolower($singular[strlen($singular) - 1]);
106 106
         switch ($last_letter) {
107 107
             case 'y':
108
-                return substr($singular, 0, -1) . 'ies';
108
+                return substr($singular, 0, -1).'ies';
109 109
             case 's':
110
-                return $singular . 'es';
110
+                return $singular.'es';
111 111
             default:
112
-                return $singular . 's';
112
+                return $singular.'s';
113 113
         }
114 114
     }
115 115
 
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
     )
184 184
     {
185 185
         $as = new AssociationSetAnonymousType();
186
-        $name = $principalType . "_" . $principalProperty . "_" . $dependentType . "_" . $dependentProperty;
186
+        $name = $principalType."_".$principalProperty."_".$dependentType."_".$dependentProperty;
187 187
         $as->setName($name);
188 188
         $namespace = $this->V3Edmx->getDataServices()[0]->getNamespace();
189 189
         if (0 == strlen(trim($namespace))) {
190 190
             $associationSetName = $association->getName();
191 191
         } else {
192
-            $associationSetName = $namespace . "." . $association->getName();
192
+            $associationSetName = $namespace.".".$association->getName();
193 193
         }
194 194
         $as->setAssociation($associationSetName);
195 195
         $end1 = new EndAnonymousType();
@@ -215,17 +215,17 @@  discard block
 block discarded – undo
215 215
     )
216 216
     {
217 217
         $association = new TAssociationType();
218
-        $name = $principalType . "_" . $principalProperty . "_" . $dependentType . "_" . $dependentProperty;
218
+        $name = $principalType."_".$principalProperty."_".$dependentType."_".$dependentProperty;
219 219
         $name = trim($name, "_");
220 220
         $association->setName($name);
221 221
 
222 222
         $principalEnd = new TAssociationEndType();
223 223
         $principalEnd->setType($principalType);
224
-        $principalEnd->setRole($principalType . "_" . $principalProperty . "_" . $dependentType);
224
+        $principalEnd->setRole($principalType."_".$principalProperty."_".$dependentType);
225 225
         $principalEnd->setMultiplicity($principalMultiplicity);
226 226
         $dependentEnd = new TAssociationEndType();
227 227
         $dependentEnd->setType($dependentType);
228
-        $dependentEnd->setRole($dependentType . "_" . $dependentProperty . "_" . $principalType);
228
+        $dependentEnd->setRole($dependentType."_".$dependentProperty."_".$principalType);
229 229
         $dependentEnd->setMultiplicity($dependentMultiplicity);
230 230
         $association->addToEnd($principalEnd);
231 231
         $association->addToEnd($dependentEnd);
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
         $dependentReferralConstraint = null;
234 234
         if (null != $principalConstraintProperty && 0 < count($principalConstraintProperty)) {
235 235
             $principalReferralConstraint = new TReferentialConstraintRoleElementType();
236
-            $principalReferralConstraint->setRole($principalType . "_" . $principalProperty . "_" . $dependentType);
236
+            $principalReferralConstraint->setRole($principalType."_".$principalProperty."_".$dependentType);
237 237
             foreach ($principalConstraintProperty as $pripertyRef) {
238 238
                 $principalReferralConstraint->addToPropertyRef($pripertyRef);
239 239
             }
240 240
         }
241 241
         if (null != $dependentConstraintProperty && 0 < count($dependentConstraintProperty)) {
242 242
             $dependentReferralConstraint = new TReferentialConstraintRoleElementType();
243
-            $dependentReferralConstraint->setRole($dependentType . "_" . $dependentProperty . "_" . $principalType);
243
+            $dependentReferralConstraint->setRole($dependentType."_".$dependentProperty."_".$principalType);
244 244
             foreach ($dependentConstraintProperty as $pripertyRef) {
245 245
                 $dependentReferralConstraint->addToPropertyRef($pripertyRef);
246 246
             }
Please login to merge, or discard this patch.