@@ -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] . ')'; |
@@ -119,13 +119,13 @@ discard block |
||
| 119 | 119 | public function setFields(array $fields) |
| 120 | 120 | { |
| 121 | 121 | if (0 == count($fields)) { |
| 122 | - $msg = 'Fields array must not be empty for '.$this->getClassName(); |
|
| 122 | + $msg = 'Fields array must not be empty for ' . $this->getClassName(); |
|
| 123 | 123 | throw new \Exception($msg); |
| 124 | 124 | } |
| 125 | 125 | $keys = []; |
| 126 | 126 | foreach ($fields as $propName => $field) { |
| 127 | 127 | if (!$field instanceof EntityField) { |
| 128 | - $msg = 'Fields array must only have EntityField objects for '.$this->getClassName(); |
|
| 128 | + $msg = 'Fields array must only have EntityField objects for ' . $this->getClassName(); |
|
| 129 | 129 | throw new \Exception($msg); |
| 130 | 130 | } |
| 131 | 131 | if ($field->getIsKeyField()) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | if (0 == count($keys)) { |
| 136 | - $msg = 'No key field supplied in fields array for '.$this->getClassName(); |
|
| 136 | + $msg = 'No key field supplied in fields array for ' . $this->getClassName(); |
|
| 137 | 137 | throw new \Exception($msg); |
| 138 | 138 | } |
| 139 | 139 | $this->fields = $fields; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | foreach ($orderBy->getOrderByInfo()->getOrderByPathSegments() as $order) { |
| 103 | 103 | foreach ($order->getSubPathSegments() as $subOrder) { |
| 104 | 104 | $subName = $subOrder->getName(); |
| 105 | - $subName = $tableName.'.'.$subName; |
|
| 105 | + $subName = $tableName . '.' . $subName; |
|
| 106 | 106 | $sourceEntityInstance = $sourceEntityInstance->orderBy( |
| 107 | 107 | $subName, |
| 108 | 108 | $order->isAscending() ? 'asc' : 'desc' |
@@ -411,10 +411,10 @@ discard block |
||
| 411 | 411 | private function processKeyDescriptor(&$sourceEntityInstance, KeyDescriptor $keyDescriptor = null) |
| 412 | 412 | { |
| 413 | 413 | if ($keyDescriptor) { |
| 414 | - $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable().'.' : ''; |
|
| 414 | + $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable() . '.' : ''; |
|
| 415 | 415 | foreach ($keyDescriptor->getValidatedNamedValues() as $key => $value) { |
| 416 | 416 | $trimValue = trim($value[0], '\''); |
| 417 | - $sourceEntityInstance = $sourceEntityInstance->where($table.$key, $trimValue); |
|
| 417 | + $sourceEntityInstance = $sourceEntityInstance->where($table . $key, $trimValue); |
|
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | } |
| 434 | 434 | $lineParts = explode('/', $line); |
| 435 | 435 | $numberOfParts = count($lineParts); |
| 436 | - for ($i = 0; $i<$numberOfParts; $i++) { |
|
| 436 | + for ($i = 0; $i < $numberOfParts; $i++) { |
|
| 437 | 437 | $lineParts[$i] = $this->getLaravelRelationName($lineParts[$i]); |
| 438 | 438 | } |
| 439 | 439 | $remixLine = implode('.', $lineParts); |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | $values = $skipToken->getOrderByKeysInToken(); |
| 465 | 465 | $numValues = count($values); |
| 466 | 466 | if ($numValues != count($segments)) { |
| 467 | - $msg = 'Expected '.count($segments).', got '.$numValues; |
|
| 467 | + $msg = 'Expected ' . count($segments) . ', got ' . $numValues; |
|
| 468 | 468 | throw new InvalidOperationException($msg); |
| 469 | 469 | } |
| 470 | 470 | |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | // so we can't bail out early |
| 520 | 520 | $rawCount += $results->count(); |
| 521 | 521 | // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz |
| 522 | - if ($rawTop > $resultSet->count() + $skip) { |
|
| 522 | + if ($rawTop > $resultSet->count()+$skip) { |
|
| 523 | 523 | $resultSet = collect(array_merge($resultSet->all(), $results->all())); |
| 524 | 524 | $sliceAmount = min($skip, $resultSet->count()); |
| 525 | 525 | $resultSet = $resultSet->slice($sliceAmount); |
@@ -244,17 +244,17 @@ |
||
| 244 | 244 | throw new InvalidOperationException($msg); |
| 245 | 245 | } |
| 246 | 246 | foreach ([ |
| 247 | - 'hasMany', |
|
| 248 | - 'hasManyThrough', |
|
| 249 | - 'belongsToMany', |
|
| 250 | - 'hasOne', |
|
| 251 | - 'belongsTo', |
|
| 252 | - 'morphOne', |
|
| 253 | - 'morphTo', |
|
| 254 | - 'morphMany', |
|
| 255 | - 'morphToMany', |
|
| 256 | - 'morphedByMany' |
|
| 257 | - ] as $relation) { |
|
| 247 | + 'hasMany', |
|
| 248 | + 'hasManyThrough', |
|
| 249 | + 'belongsToMany', |
|
| 250 | + 'hasOne', |
|
| 251 | + 'belongsTo', |
|
| 252 | + 'morphOne', |
|
| 253 | + 'morphTo', |
|
| 254 | + 'morphMany', |
|
| 255 | + 'morphToMany', |
|
| 256 | + 'morphedByMany' |
|
| 257 | + ] as $relation) { |
|
| 258 | 258 | $search = '$this->' . $relation . '('; |
| 259 | 259 | if (stripos(/** @scrutinizer ignore-type */$code, $search)) { |
| 260 | 260 | //Resolve the relation's model to a Relation object. |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | public function retrieveCasts() |
| 636 | 636 | { |
| 637 | 637 | $exists = method_exists($this, 'getCasts'); |
| 638 | - return $exists ? (array)$this->getCasts() : (array)$this->casts; |
|
| 638 | + return $exists ? (array) $this->getCasts() : (array) $this->casts; |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | /** |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | $builder = $connect->getSchemaBuilder(); |
| 783 | 783 | $columns = $builder->getColumnListing($table); |
| 784 | 784 | |
| 785 | - self::$tableColumns = (array)$columns; |
|
| 785 | + self::$tableColumns = (array) $columns; |
|
| 786 | 786 | } |
| 787 | 787 | return self::$tableColumns; |
| 788 | 788 | } |
@@ -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 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | /** @var SimpleMetadataProvider $meta */ |
| 137 | 137 | $meta = App::make('metadata'); |
| 138 | - $namespace = $meta->getContainerNamespace().'.'; |
|
| 138 | + $namespace = $meta->getContainerNamespace() . '.'; |
|
| 139 | 139 | |
| 140 | 140 | $entities = $objectModel->getEntities(); |
| 141 | 141 | foreach ($entities as $entity) { |
@@ -150,13 +150,13 @@ discard block |
||
| 150 | 150 | $entity->setOdataResourceType($entityType); |
| 151 | 151 | $this->implementProperties($entity); |
| 152 | 152 | $meta->addResourceSet($pluralName, $entityType); |
| 153 | - $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace.$entityName]; |
|
| 153 | + $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace . $entityName]; |
|
| 154 | 154 | } |
| 155 | 155 | $metaCount = count($meta->oDataEntityMap); |
| 156 | 156 | $entityCount = count($entities); |
| 157 | 157 | $expected = 2 * $entityCount; |
| 158 | 158 | if ($metaCount != $expected) { |
| 159 | - $msg = 'Expected ' . $expected . ' items, actually got '.$metaCount; |
|
| 159 | + $msg = 'Expected ' . $expected . ' items, actually got ' . $metaCount; |
|
| 160 | 160 | throw new InvalidOperationException($msg); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $targClass = $resourceType->getInstanceType()->getName(); |
| 190 | 190 | if (!($res instanceof $targClass)) { |
| 191 | 191 | $msg = 'Object being serialised not instance of expected class, ' |
| 192 | - . $targClass . ', is actually ' . $payloadClass; |
|
| 192 | + . $targClass . ', is actually ' . $payloadClass; |
|
| 193 | 193 | throw new InvalidOperationException($msg); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | if (!(ResourcePropertyKind::RESOURCESET_REFERENCE == $propKind |
| 246 | 246 | || ResourcePropertyKind::RESOURCE_REFERENCE == $propKind)) { |
| 247 | 247 | $msg = '$propKind != ResourcePropertyKind::RESOURCESET_REFERENCE &&' |
| 248 | - .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE'; |
|
| 248 | + .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE'; |
|
| 249 | 249 | throw new InvalidOperationException($msg); |
| 250 | 250 | } |
| 251 | 251 | $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed'; |
@@ -862,10 +862,10 @@ discard block |
||
| 862 | 862 | { |
| 863 | 863 | $queryParameterString = null; |
| 864 | 864 | foreach ([ODataConstants::HTTPQUERY_STRING_FILTER, |
| 865 | - ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
| 866 | - ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
| 867 | - ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
| 868 | - ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
| 865 | + ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
| 866 | + ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
| 867 | + ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
| 868 | + ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
| 869 | 869 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); |
| 870 | 870 | if (null !== $value) { |
| 871 | 871 | if (null !== $queryParameterString) { |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | $kVal = $typeKind->getValue(); |
| 1067 | 1067 | if (!(ResourceTypeKind::PRIMITIVE()->getValue() == $kVal || ResourceTypeKind::COMPLEX()->getValue() == $kVal)) { |
| 1068 | 1068 | $msg = '$bagItemResourceTypeKind != ResourceTypeKind::PRIMITIVE' |
| 1069 | - .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX'; |
|
| 1069 | + .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX'; |
|
| 1070 | 1070 | throw new InvalidOperationException($msg); |
| 1071 | 1071 | } |
| 1072 | 1072 | if (null == $result) { |