@@ -149,7 +149,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -8,6 +8,9 @@ |
||
| 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 |
@@ -30,6 +30,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | for ($i = 0; $i < 100; $i++) { |
| 32 | 32 | $actualMax = max($type->getRand(), $actualMax); |
| 33 | 33 | } |
| 34 | - $this->assertTrue($expectedMax >= $actualMax, $actualMax . " must be less than ".$expectedMax); |
|
| 34 | + $this->assertTrue($expectedMax >= $actualMax, $actualMax." must be less than ".$expectedMax); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function testGetRandMinimum() |
@@ -42,6 +42,6 @@ discard block |
||
| 42 | 42 | for ($i = 0; $i < 100; $i++) { |
| 43 | 43 | $actualMin = min($type->getRand(), $actualMin); |
| 44 | 44 | } |
| 45 | - $this->assertTrue($expectedMin <= $actualMin, $actualMin . " must be less than ".$expectedMin); |
|
| 45 | + $this->assertTrue($expectedMin <= $actualMin, $actualMin." must be less than ".$expectedMin); |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $edmx = new Edmx(); |
| 27 | 27 | $this->assertTrue($edmx->isOK($msg), $msg); |
| 28 | 28 | $this->assertNull($msg); |
| 29 | - $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
|
| 29 | + $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata"; |
|
| 30 | 30 | $serializer = |
| 31 | 31 | \JMS\Serializer\SerializerBuilder::create() |
| 32 | 32 | ->addMetadataDir($ymlDir) |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $ds = DIRECTORY_SEPARATOR; |
| 41 | 41 | |
| 42 | - $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
| 42 | + $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
| 43 | 43 | if (!file_exists($goodxsd)) { |
| 44 | 44 | return true; |
| 45 | 45 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | private function checkEdmxSerialiseDeserialiseRoundTrip($ds, $edmx, $msg) |
| 67 | 67 | { |
| 68 | - $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
|
| 68 | + $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata"; |
|
| 69 | 69 | $serializer = |
| 70 | 70 | \JMS\Serializer\SerializerBuilder::create() |
| 71 | 71 | ->addMetadataDir($ymlDir) |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->assertNull($msg); |
| 113 | 113 | |
| 114 | 114 | |
| 115 | - $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
|
| 115 | + $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata"; |
|
| 116 | 116 | $serializer = |
| 117 | 117 | \JMS\Serializer\SerializerBuilder::create() |
| 118 | 118 | ->addMetadataDir($ymlDir) |
@@ -144,10 +144,10 @@ discard block |
||
| 144 | 144 | $ds = DIRECTORY_SEPARATOR; |
| 145 | 145 | $msg = null; |
| 146 | 146 | |
| 147 | - $docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceDocument.xml"; |
|
| 147 | + $docLocation = dirname(__DIR__).$ds."tests".$ds."exampleV3ServiceDocument.xml"; |
|
| 148 | 148 | $document = file_get_contents($docLocation); |
| 149 | 149 | $type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\TDataServicesType'; |
| 150 | - $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
|
| 150 | + $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata"; |
|
| 151 | 151 | |
| 152 | 152 | $serializer = |
| 153 | 153 | \JMS\Serializer\SerializerBuilder::create() |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | $ds = DIRECTORY_SEPARATOR; |
| 165 | 165 | $msg = null; |
| 166 | 166 | |
| 167 | - $docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceMetadata.xml"; |
|
| 167 | + $docLocation = dirname(__DIR__).$ds."tests".$ds."exampleV3ServiceMetadata.xml"; |
|
| 168 | 168 | $document = file_get_contents($docLocation); |
| 169 | 169 | $type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx'; |
| 170 | - $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
|
| 170 | + $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata"; |
|
| 171 | 171 | |
| 172 | 172 | $serializer = |
| 173 | 173 | \JMS\Serializer\SerializerBuilder::create() |
@@ -185,11 +185,11 @@ discard block |
||
| 185 | 185 | $ds = DIRECTORY_SEPARATOR; |
| 186 | 186 | $msg = null; |
| 187 | 187 | |
| 188 | - $docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceMetadata.xml"; |
|
| 188 | + $docLocation = dirname(__DIR__).$ds."tests".$ds."exampleV3ServiceMetadata.xml"; |
|
| 189 | 189 | $document = file_get_contents($docLocation); |
| 190 | 190 | $this->v3MetadataAgainstXSD($document); |
| 191 | 191 | $type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx'; |
| 192 | - $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
|
| 192 | + $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata"; |
|
| 193 | 193 | |
| 194 | 194 | $serializer = |
| 195 | 195 | \JMS\Serializer\SerializerBuilder::create() |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $this->assertNull($msg); |
| 231 | 231 | |
| 232 | 232 | |
| 233 | - $ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
|
| 233 | + $ymlDir = dirname(__DIR__).$ds."src".$ds."MetadataV3".$ds."JMSmetadata"; |
|
| 234 | 234 | $serializer = |
| 235 | 235 | \JMS\Serializer\SerializerBuilder::create() |
| 236 | 236 | ->addMetadataDir($ymlDir) |
@@ -15,8 +15,6 @@ |
||
| 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; |
@@ -54,6 +54,11 @@ discard block |
||
| 54 | 54 | return $cereal->serialize($this->getEdmx(), "xml"); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @param string $name |
|
| 59 | + * @param TTextType $summary |
|
| 60 | + * @param TTextType $longDescription |
|
| 61 | + */ |
|
| 57 | 62 | public function addEntityType($name, $accessType = "Public", $summary = null, $longDescription = null) |
| 58 | 63 | { |
| 59 | 64 | $NewEntity = new TEntityTypeType(); |
@@ -118,6 +123,14 @@ discard block |
||
| 118 | 123 | return $NewProperty; |
| 119 | 124 | } |
| 120 | 125 | |
| 126 | + /** |
|
| 127 | + * @param string $name |
|
| 128 | + * @param string $type |
|
| 129 | + * @param string $defaultValue |
|
| 130 | + * @param string $storeGeneratedPattern |
|
| 131 | + * @param TTextType $summary |
|
| 132 | + * @param TTextType $longDescription |
|
| 133 | + */ |
|
| 121 | 134 | public function addPropertyToEntityType( |
| 122 | 135 | TEntityTypeType $entityType, |
| 123 | 136 | $name, |
@@ -147,6 +160,11 @@ discard block |
||
| 147 | 160 | return $NewProperty; |
| 148 | 161 | } |
| 149 | 162 | |
| 163 | + /** |
|
| 164 | + * @param string $principalMultiplicity |
|
| 165 | + * @param string $principalProperty |
|
| 166 | + * @param string $dependentMultiplicity |
|
| 167 | + */ |
|
| 150 | 168 | public function addNavigationPropertyToEntityType( |
| 151 | 169 | TEntityTypeType $principalType, |
| 152 | 170 | $principalMultiplicity, |
@@ -301,6 +319,10 @@ discard block |
||
| 301 | 319 | return $association; |
| 302 | 320 | } |
| 303 | 321 | |
| 322 | + /** |
|
| 323 | + * @param string $principalEntitySetName |
|
| 324 | + * @param string $dependentEntitySetName |
|
| 325 | + */ |
|
| 304 | 326 | protected function createAssocationSetForAssocation( |
| 305 | 327 | TAssociationType $association, |
| 306 | 328 | $principalEntitySetName, |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $entitySet = new EntitySetAnonymousType(); |
| 64 | 64 | $entitySet->setName(Str::plural($NewEntity->getName())); |
| 65 | 65 | $namespace = $this->getNamespace(); |
| 66 | - $entityTypeName = $namespace . $NewEntity->getName(); |
|
| 66 | + $entityTypeName = $namespace.$NewEntity->getName(); |
|
| 67 | 67 | $entitySet->setEntityType($entityTypeName); |
| 68 | 68 | $entitySet->setGetterAccess($accessType); |
| 69 | 69 | |
@@ -167,17 +167,17 @@ discard block |
||
| 167 | 167 | ) { |
| 168 | 168 | $principalEntitySetName = Str::plural($principalType->getName()); |
| 169 | 169 | $dependentEntitySetName = Str::plural($dependentType->getName()); |
| 170 | - $relationName = $principalType->getName() . "_" . $principalProperty . "_" |
|
| 171 | - . $dependentType->getName() . "_" . $dependentProperty; |
|
| 170 | + $relationName = $principalType->getName()."_".$principalProperty."_" |
|
| 171 | + . $dependentType->getName()."_".$dependentProperty; |
|
| 172 | 172 | $relationName = trim($relationName, "_"); |
| 173 | 173 | |
| 174 | 174 | $namespace = $this->getNamespace(); |
| 175 | - $relationFQName = $namespace . $relationName; |
|
| 175 | + $relationFQName = $namespace.$relationName; |
|
| 176 | 176 | |
| 177 | 177 | $principalNavigationProperty = new TNavigationPropertyType(); |
| 178 | 178 | $principalNavigationProperty->setName($principalProperty); |
| 179 | - $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_")); |
|
| 180 | - $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty); |
|
| 179 | + $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_")); |
|
| 180 | + $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty); |
|
| 181 | 181 | $principalNavigationProperty->setRelationship($relationFQName); |
| 182 | 182 | $principalNavigationProperty->setGetterAccess($principalGetterAccess); |
| 183 | 183 | $principalNavigationProperty->setSetterAccess($principalSetterAccess); |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | if (!empty($dependentProperty)) { |
| 188 | 188 | $dependentNavigationProperty = new TNavigationPropertyType(); |
| 189 | 189 | $dependentNavigationProperty->setName($dependentProperty); |
| 190 | - $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty); |
|
| 191 | - $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty); |
|
| 190 | + $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty); |
|
| 191 | + $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty); |
|
| 192 | 192 | $dependentNavigationProperty->setRelationship($relationFQName); |
| 193 | 193 | $dependentNavigationProperty->setGetterAccess($dependentGetterAccess); |
| 194 | 194 | $dependentNavigationProperty->setSetterAccess($dependentSetterAccess); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | array $principalConstraintProperty = null, |
| 233 | 233 | array $dependentConstraintProperty = null |
| 234 | 234 | ) { |
| 235 | - $multCombo = [ '*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']]; |
|
| 235 | + $multCombo = ['*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']]; |
|
| 236 | 236 | $multKeys = array_keys($multCombo); |
| 237 | 237 | if (null != $dependentNavigationProperty) { |
| 238 | 238 | if ($dependentNavigationProperty->getRelationship() != $principalNavigationProperty->getRelationship()) { |
@@ -253,13 +253,13 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | if (!in_array($dependentMultiplicity, $multCombo[$principalMultiplicity])) { |
| 255 | 255 | throw new \InvalidArgumentException( |
| 256 | - "Invalid multiplicity combination - ". $principalMultiplicity . ' ' . $dependentMultiplicity |
|
| 256 | + "Invalid multiplicity combination - ".$principalMultiplicity.' '.$dependentMultiplicity |
|
| 257 | 257 | ); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | $namespace = $this->getNamespace(); |
| 261 | - $principalTypeFQName = $namespace . $principalType->getName(); |
|
| 262 | - $dependentTypeFQName = $namespace . $dependentType->getName(); |
|
| 261 | + $principalTypeFQName = $namespace.$principalType->getName(); |
|
| 262 | + $dependentTypeFQName = $namespace.$dependentType->getName(); |
|
| 263 | 263 | $association = new TAssociationType(); |
| 264 | 264 | $relationship = $principalNavigationProperty->getRelationship(); |
| 265 | 265 | if (false !== strpos($relationship, '.')) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $name = $association->getName(); |
| 311 | 311 | $as->setName($name); |
| 312 | 312 | $namespace = $this->getNamespace(); |
| 313 | - $associationSetName = $namespace . $association->getName(); |
|
| 313 | + $associationSetName = $namespace.$association->getName(); |
|
| 314 | 314 | $as->setAssociation($associationSetName); |
| 315 | 315 | $end1 = new EndAnonymousType(); |
| 316 | 316 | $end1->setRole($association->getEnd()[0]->getRole()); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | private function initSerialiser() |
| 372 | 372 | { |
| 373 | - $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata"; |
|
| 373 | + $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata"; |
|
| 374 | 374 | $this->serializer = |
| 375 | 375 | SerializerBuilder::create() |
| 376 | 376 | ->addMetadataDir($ymlDir) |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | * @param $longDescription |
| 441 | 441 | * @param $NewEntity |
| 442 | 442 | */ |
| 443 | - private function addDocumentation($summary, $longDescription, IsOK &$NewEntity) |
|
| 443 | + private function addDocumentation($summary, $longDescription, IsOK & $NewEntity) |
|
| 444 | 444 | { |
| 445 | 445 | if (null != $summary && null != $longDescription) { |
| 446 | 446 | $documentation = $this->generateDocumentation($summary, $longDescription); |
@@ -138,7 +138,7 @@ |
||
| 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(); |
@@ -308,7 +308,7 @@ |
||
| 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 | } |
@@ -11,8 +11,6 @@ |
||
| 11 | 11 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TComplexTypeType; |
| 12 | 12 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityPropertyType; |
| 13 | 13 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityTypeType; |
| 14 | -use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType; |
|
| 15 | -use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionType; |
|
| 16 | 14 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TNavigationPropertyType; |
| 17 | 15 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TTextType; |
| 18 | 16 | use AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $ds = DIRECTORY_SEPARATOR; |
| 39 | 39 | |
| 40 | - $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
| 40 | + $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
| 41 | 41 | if (!file_exists($goodxsd)) { |
| 42 | 42 | return true; |
| 43 | 43 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $result = null; |
| 53 | 53 | |
| 54 | 54 | list($eType, $result) = $metadataManager->addEntityType("Category"); |
| 55 | - $this->assertNotFalse($eType, "Etype is false not type " . $metadataManager->getLastError()); |
|
| 55 | + $this->assertNotFalse($eType, "Etype is false not type ".$metadataManager->getLastError()); |
|
| 56 | 56 | $metadataManager->addPropertyToEntityType($eType, "CategoryID", "Int32", null, false, true, "Identity"); |
| 57 | 57 | $metadataManager->addPropertyToEntityType($eType, "CategoryName", "String"); |
| 58 | 58 | $metadataManager->addPropertyToEntityType($eType, "Description", "String"); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $result = null; |
| 80 | 80 | |
| 81 | 81 | list($CategoryType, $result) = $metadataManager->addEntityType("Category"); |
| 82 | - $this->assertNotFalse($CategoryType, "Etype is false not type " . $metadataManager->getLastError()); |
|
| 82 | + $this->assertNotFalse($CategoryType, "Etype is false not type ".$metadataManager->getLastError()); |
|
| 83 | 83 | $metadataManager->addPropertyToEntityType($CategoryType, "CategoryID", "Int32", null, false, true, "Identity"); |
| 84 | 84 | $metadataManager->addPropertyToEntityType($CategoryType, "CategoryName", "String"); |
| 85 | 85 | $metadataManager->addPropertyToEntityType($CategoryType, "Description", "String"); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $this->assertTrue($metadataManager->getEdmx()->isOK($msg), $msg); |
| 166 | 166 | |
| 167 | 167 | $expectedRelation = "Data.Category_Products_Product_Category"; |
| 168 | - list($principalNav, ) = $metadataManager->addNavigationPropertyToEntityType( |
|
| 168 | + list($principalNav,) = $metadataManager->addNavigationPropertyToEntityType( |
|
| 169 | 169 | $CategoryType, "*", "Products", $ProductType, "1", "Category", ["CategoryID"], ["CategoryID"] |
| 170 | 170 | ); |
| 171 | 171 | $this->assertEquals($expectedRelation, $principalNav->getRelationship()); |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | { |
| 611 | 611 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
| 612 | 612 | |
| 613 | - $expected = "Invalid multiplicity combination - 1 1"; |
|
| 613 | + $expected = "Invalid multiplicity combination - 1 1"; |
|
| 614 | 614 | $actual = null; |
| 615 | 615 | |
| 616 | 616 | try { |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | { |
| 633 | 633 | list(, $metadataManager, $CategoryType, $CustomerType) = $this->setUpMetadataForNavTests(); |
| 634 | 634 | |
| 635 | - $expected = "Invalid multiplicity combination - * 0..1"; |
|
| 635 | + $expected = "Invalid multiplicity combination - * 0..1"; |
|
| 636 | 636 | $actual = null; |
| 637 | 637 | |
| 638 | 638 | try { |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | |
| 653 | 653 | public function testAddComplexType() |
| 654 | 654 | { |
| 655 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 655 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 656 | 656 | |
| 657 | 657 | $name = "Name"; |
| 658 | 658 | $accessType = "Public"; |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
| 665 | 665 | |
| 666 | 666 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
| 667 | - $this->assertEquals($oldCount+1, $newCount); |
|
| 667 | + $this->assertEquals($oldCount + 1, $newCount); |
|
| 668 | 668 | $this->assertNotNull($result); |
| 669 | 669 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
| 670 | 670 | $this->assertNotNull($result->getDocumentation()); |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | |
| 673 | 673 | public function testAddComplexTypeWithOnlySummary() |
| 674 | 674 | { |
| 675 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 675 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 676 | 676 | |
| 677 | 677 | $name = "Name"; |
| 678 | 678 | $accessType = "Public"; |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
| 685 | 685 | |
| 686 | 686 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
| 687 | - $this->assertEquals($oldCount+1, $newCount); |
|
| 687 | + $this->assertEquals($oldCount + 1, $newCount); |
|
| 688 | 688 | $this->assertNotNull($result); |
| 689 | 689 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
| 690 | 690 | $this->assertNull($result->getDocumentation()); |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | |
| 693 | 693 | public function testAddComplexTypeWithOnlyDescription() |
| 694 | 694 | { |
| 695 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 695 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 696 | 696 | |
| 697 | 697 | $name = "Name"; |
| 698 | 698 | $accessType = "Public"; |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | $result = $metadataManager->addComplexType($name, $accessType, $summary, $longDescription); |
| 705 | 705 | |
| 706 | 706 | $newCount = count($metadataManager->getEdmx()->getDataServiceType()->getSchema()[0]->getComplexType()); |
| 707 | - $this->assertEquals($oldCount+1, $newCount); |
|
| 707 | + $this->assertEquals($oldCount + 1, $newCount); |
|
| 708 | 708 | $this->assertNotNull($result); |
| 709 | 709 | $this->assertTrue($result instanceof TComplexTypeType, get_class($result)); |
| 710 | 710 | $this->assertNull($result->getDocumentation()); |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | $expected = "Default value cannot be object or array"; |
| 716 | 716 | $actual = null; |
| 717 | 717 | |
| 718 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 718 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 719 | 719 | $complex = m::mock(TComplexTypeType::class); |
| 720 | 720 | $name = "name"; |
| 721 | 721 | $type = "type"; |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | $expected = "Default value cannot be object or array"; |
| 735 | 735 | $actual = null; |
| 736 | 736 | |
| 737 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 737 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 738 | 738 | $complex = m::mock(TComplexTypeType::class); |
| 739 | 739 | $name = "name"; |
| 740 | 740 | $type = "type"; |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | |
| 751 | 751 | public function testAddPropertyToComplexTypeDefaultValueBoolean() |
| 752 | 752 | { |
| 753 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 753 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 754 | 754 | $complex = m::mock(TComplexTypeType::class); |
| 755 | 755 | $complex->shouldReceive('addToProperty') |
| 756 | 756 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | |
| 777 | 777 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlySummary() |
| 778 | 778 | { |
| 779 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 779 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 780 | 780 | $complex = m::mock(TComplexTypeType::class); |
| 781 | 781 | $complex->shouldReceive('addToProperty') |
| 782 | 782 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | |
| 804 | 804 | public function testAddPropertyToComplexTypeDefaultValueBooleanOnlyDescription() |
| 805 | 805 | { |
| 806 | - list(, $metadataManager, , ) = $this->setUpMetadataForNavTests(); |
|
| 806 | + list(, $metadataManager,,) = $this->setUpMetadataForNavTests(); |
|
| 807 | 807 | $complex = m::mock(TComplexTypeType::class); |
| 808 | 808 | $complex->shouldReceive('addToProperty') |
| 809 | 809 | ->with(m::type(TComplexTypePropertyType::class))->andReturnNull()->once(); |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $longDescription = new TTextType(); |
| 923 | 923 | |
| 924 | 924 | $metadataManager = new MetadataManager(); |
| 925 | - list($result, ) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 925 | + list($result,) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 926 | 926 | $this->assertNotNull($result->getDocumentation()); |
| 927 | 927 | } |
| 928 | 928 | |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | $longDescription = null; |
| 935 | 935 | |
| 936 | 936 | $metadataManager = new MetadataManager(); |
| 937 | - list($result, ) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 937 | + list($result,) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 938 | 938 | $this->assertNull($result->getDocumentation()); |
| 939 | 939 | } |
| 940 | 940 | |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | $longDescription = new TTextType(); |
| 947 | 947 | |
| 948 | 948 | $metadataManager = new MetadataManager(); |
| 949 | - list($result, ) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 949 | + list($result,) = $metadataManager->addEntityType($name, $accessType, $summary, $longDescription); |
|
| 950 | 950 | $this->assertNull($result->getDocumentation()); |
| 951 | 951 | } |
| 952 | 952 | |