Completed
Pull Request — master (#101)
by Alex
158:08 queued 147:57
created
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/MetadataV3/edm/TSchemaType.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                 die($this->getNamespace());
150 150
                 return false;
151 151
             }*/
152
-            $eSetType = str_replace($this->getNamespace() . ".", "", $eSetType);
152
+            $eSetType = str_replace($this->getNamespace().".", "", $eSetType);
153 153
             if (!in_array($eSetType, $entityTypeNames)) {
154 154
                 $msg = "entitySet Types should have a matching type name in entity Types";
155 155
                 return false;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
         // Check Associations to associationSets
160 160
         if (count($associationSets) != count($associationNames)) {
161
-            $msg = "we have " . count($associationSets) . "association sets and " . count($associationNames)
161
+            $msg = "we have ".count($associationSets)."association sets and ".count($associationNames)
162 162
                    . " associations, they should be the same";
163 163
         }
164 164
         if (count($associationNames) * 2 < count($navigationProperties)) {
@@ -167,33 +167,33 @@  discard block
 block discarded – undo
167 167
         }
168 168
         foreach ($associationNames as $associationName => $associationEnds) {
169 169
             if (!array_key_exists($associationName, $associationSets)) {
170
-                $msg = "association " . $associationName . " exists without matching associationSet";
170
+                $msg = "association ".$associationName." exists without matching associationSet";
171 171
                 return false;
172 172
             }
173 173
 
174 174
             if (!array_key_exists($associationName, $navigationProperties)) {
175
-                $msg = "association " . $associationName . " exists without matching Natvigation Property";
175
+                $msg = "association ".$associationName." exists without matching Natvigation Property";
176 176
                 return false;
177 177
             }
178 178
             $roles = [$associationEnds[0]->getRole(), $associationEnds[1]->getRole()];
179 179
             if (!in_array($associationSets[$associationName][0]->getRole(), $roles)) {
180
-                $msg = "association Set role " . $associationSets[$associationName][0]->getRole()
180
+                $msg = "association Set role ".$associationSets[$associationName][0]->getRole()
181 181
                        . "lacks a matching property in the attached association";
182 182
                 return false;
183 183
             }
184 184
             if (!in_array($associationSets[$associationName][1]->getRole(), $roles)) {
185
-                $msg = "association Set role " . $associationSets[$associationName][1]->getRole()
185
+                $msg = "association Set role ".$associationSets[$associationName][1]->getRole()
186 186
                        . "lacks a matching property in the attached association";
187 187
                 return false;
188 188
             }
189 189
             foreach ($navigationProperties[$associationName] as $navProp) {
190 190
                 if (!in_array($navProp->getToRole(), $roles)) {
191
-                    $msg = "Navigation Property Role " . $navProp->getToRole()
191
+                    $msg = "Navigation Property Role ".$navProp->getToRole()
192 192
                          . " lacks a matching Property in the assocation";
193 193
                     return false;
194 194
                 }
195 195
                 if (!in_array($navProp->getFromRole(), $roles)) {
196
-                    $msg = "Navigation Property Role " .$navProp->getToRole()
196
+                    $msg = "Navigation Property Role ".$navProp->getToRole()
197 197
                          . " lacks a matching Property in the assocation";
198 198
                     return false;
199 199
                 }
Please login to merge, or discard this patch.
src/MetadataV3/edm/IsOKTraits/TPathTrait.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 $string
13
+     */
11 14
     public function isTPathValid($string)
12 15
     {
13 16
         // The below pattern represents the allowed identifiers in ECMA specification plus the '/' for path segment
Please login to merge, or discard this patch.
tests/testType.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -30,6 +30,9 @@  discard block
 block discarded – undo
30 30
         return parent::isNullInstanceOf($var, $instanceOf);
31 31
     }
32 32
 
33
+    /**
34
+     * @param string $instanceOf
35
+     */
33 36
     public function isValidArray(array $arr = null, $instanceOf, $minCount = -1, $maxCount = -1)
34 37
     {
35 38
         return parent::isValidArray($arr, $instanceOf, $minCount, $maxCount);
@@ -40,6 +43,9 @@  discard block
 block discarded – undo
40 43
         return parent::isChildArrayOK($arr, $msg);
41 44
     }
42 45
 
46
+    /**
47
+     * @param null|string $url
48
+     */
43 49
     public function isURLValid($url)
44 50
     {
45 51
         return parent::isURLValid($url);
@@ -50,6 +56,9 @@  discard block
 block discarded – undo
50 56
         return true;
51 57
     }
52 58
 
59
+    /**
60
+     * @return boolean
61
+     */
53 62
     public function isObjectNullOrOK(IsOK $object = null, &$msg = null)
54 63
     {
55 64
         return parent::isObjectNullOrOK($object, $msg);
Please login to merge, or discard this patch.
tests/MetadataManagerTest.php 2 patches
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.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,7 @@
 block discarded – undo
5 5
 use AlgoWeb\ODataMetadata\IsOK;
6 6
 use AlgoWeb\ODataMetadata\MetadataManager;
7 7
 use AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer;
8
-use AlgoWeb\ODataMetadata\MetadataV3\edm\Schema;
9 8
 use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityTypeType;
10
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType;
11
-use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionType;
12 9
 use AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx;
13 10
 use Mockery as m;
14 11
 
Please login to merge, or discard this patch.