| @@ -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] . ')'; | 
| @@ -70,7 +70,7 @@ | ||
| 70 | 70 | $others = $this->getRelationsByRelationName($className, $relName); | 
| 71 | 71 |              if ($stub instanceof AssociationStubMonomorphic) { | 
| 72 | 72 | $msg = 'Monomorphic relation stub on ' . $className . ' ' . $relName | 
| 73 | - . ' should point to at most 1 other stub'; | |
| 73 | + . ' should point to at most 1 other stub'; | |
| 74 | 74 |                  if (!(1 >= count($others))) { | 
| 75 | 75 | throw new InvalidOperationException($msg); | 
| 76 | 76 | } | 
| @@ -118,10 +118,10 @@ | ||
| 118 | 118 | /** @var string|null $queryParameterString */ | 
| 119 | 119 | $queryParameterString = null; | 
| 120 | 120 | foreach ([ODataConstants::HTTPQUERY_STRING_FILTER, | 
| 121 | - ODataConstants::HTTPQUERY_STRING_EXPAND, | |
| 122 | - ODataConstants::HTTPQUERY_STRING_ORDERBY, | |
| 123 | - ODataConstants::HTTPQUERY_STRING_INLINECOUNT, | |
| 124 | -                     ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { | |
| 121 | + ODataConstants::HTTPQUERY_STRING_EXPAND, | |
| 122 | + ODataConstants::HTTPQUERY_STRING_ORDERBY, | |
| 123 | + ODataConstants::HTTPQUERY_STRING_INLINECOUNT, | |
| 124 | +                        ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { | |
| 125 | 125 | /** @var string|null $value */ | 
| 126 | 126 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); | 
| 127 | 127 |              if (null !== $value) { | 
| @@ -128,7 +128,7 @@ discard block | ||
| 128 | 128 | $targClass = $resourceType->getInstanceType()->getName(); | 
| 129 | 129 |          if (!($res instanceof $targClass)) { | 
| 130 | 130 | $msg = 'Object being serialised not instance of expected class, ' | 
| 131 | - . $targClass . ', is actually ' . $payloadClass; | |
| 131 | + . $targClass . ', is actually ' . $payloadClass; | |
| 132 | 132 | throw new InvalidOperationException($msg); | 
| 133 | 133 | } | 
| 134 | 134 | |
| @@ -667,7 +667,7 @@ discard block | ||
| 667 | 667 | if (!(ResourcePropertyKind::RESOURCESET_REFERENCE == $propKind | 
| 668 | 668 |                    || ResourcePropertyKind::RESOURCE_REFERENCE == $propKind)) { | 
| 669 | 669 | $msg = '$propKind != ResourcePropertyKind::RESOURCESET_REFERENCE &&' | 
| 670 | - . ' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE'; | |
| 670 | + . ' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE'; | |
| 671 | 671 | throw new InvalidOperationException($msg); | 
| 672 | 672 | } | 
| 673 | 673 | $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed'; | 
| @@ -75,7 +75,7 @@ | ||
| 75 | 75 | $kVal = $typeKind; | 
| 76 | 76 |          if (!(ResourceTypeKind::PRIMITIVE() == $kVal || ResourceTypeKind::COMPLEX() == $kVal)) { | 
| 77 | 77 | $msg = '$bagItemResourceTypeKind != ResourceTypeKind::PRIMITIVE' | 
| 78 | - .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX'; | |
| 78 | + .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX'; | |
| 79 | 79 | throw new InvalidOperationException($msg); | 
| 80 | 80 | } | 
| 81 | 81 |          if (null == $result) { | 
| @@ -234,7 +234,7 @@ | ||
| 234 | 234 |                      $segments = explode('.', $this->{$item}); | 
| 235 | 235 | $carry[] = end($segments); | 
| 236 | 236 | |
| 237 | - } | |
| 237 | + } | |
| 238 | 238 | return $carry; | 
| 239 | 239 | }; | 
| 240 | 240 | return call_user_func($getter->bindTo($relation, Relation::class)); | 
| @@ -102,7 +102,7 @@ discard block | ||
| 102 | 102 | * @return AssociationStubBase | 
| 103 | 103 | */ | 
| 104 | 104 |      protected static function handleHasManyThrough(string $name, Relation $relation, $cacheKey = 'HasManyThrough'):AssociationStubBase{ | 
| 105 | -        $farParentGetter = function(){ | |
| 105 | +        $farParentGetter = function() { | |
| 106 | 106 | return $this->farParent; | 
| 107 | 107 | }; | 
| 108 | 108 | $farParent = call_user_func($farParentGetter->bindTo($relation, HasManyThrough::class)); | 
| @@ -126,7 +126,7 @@ discard block | ||
| 126 | 126 | * @return AssociationStubBase | 
| 127 | 127 | */ | 
| 128 | 128 |      protected static function handleMorphToMany(string $name, Relation $relation, $cacheKey = 'BelongsToMany'): AssociationStubBase{ | 
| 129 | -        $inverseGetter = function(){ | |
| 129 | +        $inverseGetter = function() { | |
| 130 | 130 | return $this->inverse; | 
| 131 | 131 | }; | 
| 132 | 132 | $inverse = call_user_func($inverseGetter->bindTo($relation, MorphToMany::class)); | 
| @@ -214,8 +214,9 @@ discard block | ||
| 214 | 214 | return $stub; | 
| 215 | 215 | } | 
| 216 | 216 | |
| 217 | -    private static function getParent(Relation $relation){ | |
| 218 | -        $getter = function(){ | |
| 217 | + private static function getParent(Relation $relation) | |
| 218 | +    { | |
| 219 | +        $getter = function() { | |
| 219 | 220 | return $this->parent; | 
| 220 | 221 | }; | 
| 221 | 222 | return call_user_func($getter->bindTo($relation, Relation::class)); | 
| @@ -223,11 +224,11 @@ discard block | ||
| 223 | 224 | |
| 224 | 225 |      private static function getKeyChain(Relation $relation, string $cacheKey) : array { | 
| 225 | 226 | $fields = self::$fieldOrderCache[$cacheKey]; | 
| 226 | -        $getter =  function() use ($fields){ | |
| 227 | +        $getter =  function() use ($fields) { | |
| 227 | 228 | $carry = []; | 
| 228 | -            foreach($fields as $item){ | |
| 229 | +            foreach($fields as $item) { | |
| 229 | 230 |                      $v = $this->{$item}; | 
| 230 | -                    if($v == null && $item == 'ownerKey'){ | |
| 231 | +                    if($v == null && $item == 'ownerKey') { | |
| 231 | 232 | $carry[] = null; | 
| 232 | 233 | continue; | 
| 233 | 234 | } |