@@ -131,7 +131,7 @@ |
||
131 | 131 | } |
132 | 132 | $metaCount = count($meta->oDataEntityMap); |
133 | 133 | $entityCount = count($entities); |
134 | - assert($metaCount == 2 * $entityCount + 1); |
|
134 | + assert($metaCount == 2 * $entityCount+1); |
|
135 | 135 | |
136 | 136 | if (null === $objectModel->getAssociations()) { |
137 | 137 | return; |
@@ -54,7 +54,7 @@ |
||
54 | 54 | }; |
55 | 55 | $this->functionDescriptionParsers[ODataConstants::STRFUN_ENDSWITH] = function ($params) { |
56 | 56 | return '(strcmp(substr(' . $params[0] . ', strlen(' . $params[0] . ') - strlen(' . $params[1] . ')), ' |
57 | - .$params[1] . ') === 0)'; |
|
57 | + .$params[1] . ') === 0)'; |
|
58 | 58 | }; |
59 | 59 | $this->functionDescriptionParsers[ODataConstants::STRFUN_INDEXOF] = function ($params) { |
60 | 60 | return 'strpos(' . $params[0] . ', ' . $params[1] . ')'; |
@@ -789,10 +789,10 @@ |
||
789 | 789 | { |
790 | 790 | $queryParameterString = null; |
791 | 791 | foreach ([ODataConstants::HTTPQUERY_STRING_FILTER, |
792 | - ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
793 | - ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
794 | - ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
795 | - ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
792 | + ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
793 | + ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
794 | + ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
795 | + ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
796 | 796 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); |
797 | 797 | if (null !== $value) { |
798 | 798 | if (null !== $queryParameterString) { |
@@ -227,17 +227,17 @@ |
||
227 | 227 | $lastCode = $code[strlen($code)-1]; |
228 | 228 | assert('}' == $lastCode, 'Final character of function definition must be closing brace'); |
229 | 229 | foreach ([ |
230 | - 'hasMany', |
|
231 | - 'hasManyThrough', |
|
232 | - 'belongsToMany', |
|
233 | - 'hasOne', |
|
234 | - 'belongsTo', |
|
235 | - 'morphOne', |
|
236 | - 'morphTo', |
|
237 | - 'morphMany', |
|
238 | - 'morphToMany', |
|
239 | - 'morphedByMany' |
|
240 | - ] as $relation) { |
|
230 | + 'hasMany', |
|
231 | + 'hasManyThrough', |
|
232 | + 'belongsToMany', |
|
233 | + 'hasOne', |
|
234 | + 'belongsTo', |
|
235 | + 'morphOne', |
|
236 | + 'morphTo', |
|
237 | + 'morphMany', |
|
238 | + 'morphToMany', |
|
239 | + 'morphedByMany' |
|
240 | + ] as $relation) { |
|
241 | 241 | $search = '$this->' . $relation . '('; |
242 | 242 | if ($pos = stripos($code, $search)) { |
243 | 243 | //Resolve the relation's model to a Relation object. |
@@ -131,10 +131,10 @@ |
||
131 | 131 | if (0 == count($lastCandidates)) { |
132 | 132 | continue; |
133 | 133 | } |
134 | - foreach($lastCandidates as $lc){ |
|
134 | + foreach ($lastCandidates as $lc) { |
|
135 | 135 | $stub = clone $this->knownSides[$knownType][$key]; |
136 | 136 | $isMulti = ($stub->getMultiplicity()->getValue() == \AlgoWeb\PODataLaravel\Models\ObjectMap\Entities\Associations\AssociationStubRelationType::MANY); |
137 | - $RelPolyTypeName = str_plural(substr($lc->getBaseType(),strrpos($lc->getBaseType(),"\\")+1),$isMulti?2:1); |
|
137 | + $RelPolyTypeName = str_plural(substr($lc->getBaseType(), strrpos($lc->getBaseType(), "\\")+1), $isMulti ? 2 : 1); |
|
138 | 138 | $stub->setRelationName($stub->getRelationName() . "_" . $RelPolyTypeName); |
139 | 139 | $assoc = new AssociationMonomorphic(); |
140 | 140 | $first = -1 === $stub->compare($lc); |
@@ -131,7 +131,7 @@ |
||
131 | 131 | if (0 == count($lastCandidates)) { |
132 | 132 | continue; |
133 | 133 | } |
134 | - foreach($lastCandidates as $lc){ |
|
134 | + foreach($lastCandidates as $lc) { |
|
135 | 135 | $stub = clone $this->knownSides[$knownType][$key]; |
136 | 136 | $isMulti = ($stub->getMultiplicity()->getValue() == \AlgoWeb\PODataLaravel\Models\ObjectMap\Entities\Associations\AssociationStubRelationType::MANY); |
137 | 137 | $RelPolyTypeName = str_plural(substr($lc->getBaseType(),strrpos($lc->getBaseType(),"\\")+1),$isMulti?2:1); |
@@ -193,7 +193,7 @@ |
||
193 | 193 | { |
194 | 194 | if ($association instanceof AssociationMonomorphic) { |
195 | 195 | $stub = $isFirst ? $association->getFirst() : $association->getLast(); |
196 | - if (null === $stub || (!in_array($stub, $this->stubs) && $stub instanceof AssociationStubMonomorphic )) { |
|
196 | + if (null === $stub || (!in_array($stub, $this->stubs) && $stub instanceof AssociationStubMonomorphic)) { |
|
197 | 197 | throw new \InvalidArgumentException('Association cannot be connected to this entity'); |
198 | 198 | } |
199 | 199 | $propertyName = $stub->getRelationName(); |