@@ -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) { |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | $stub = clone $this->knownSides[$knownType][$key]; |
| 136 | 136 | $isMulti = ($stub->getMultiplicity()->getValue() == AssociationStubRelationType::MANY); |
| 137 | 137 | $relPolyTypeName = substr($lc->getBaseType(), strrpos($lc->getBaseType(), '\\')+1); |
| 138 | - $relPolyTypeName = str_plural($relPolyTypeName, $isMulti?2:1); |
|
| 138 | + $relPolyTypeName = str_plural($relPolyTypeName, $isMulti ? 2 : 1); |
|
| 139 | 139 | $stub->setRelationName($stub->getRelationName() . '_' . $relPolyTypeName); |
| 140 | 140 | $assoc = new AssociationMonomorphic(); |
| 141 | 141 | $first = -1 === $stub->compare($lc); |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | $metaCount = count($meta->oDataEntityMap); |
| 143 | 143 | $entityCount = count($entities); |
| 144 | 144 | $expected = 2 * $entityCount; |
| 145 | - assert($metaCount == $expected, 'Expected ' . $expected . ' items, actually got '.$metaCount); |
|
| 145 | + assert($metaCount == $expected, 'Expected ' . $expected . ' items, actually got ' . $metaCount); |
|
| 146 | 146 | |
| 147 | 147 | if (0 === count($objectModel->getAssociations())) { |
| 148 | 148 | return; |
@@ -238,17 +238,17 @@ |
||
| 238 | 238 | $lastCode = $code[strlen(/** @scrutinizer ignore-type */$code)-1]; |
| 239 | 239 | assert('}' == $lastCode, 'Final character of function definition must be closing brace'); |
| 240 | 240 | foreach ([ |
| 241 | - 'hasMany', |
|
| 242 | - 'hasManyThrough', |
|
| 243 | - 'belongsToMany', |
|
| 244 | - 'hasOne', |
|
| 245 | - 'belongsTo', |
|
| 246 | - 'morphOne', |
|
| 247 | - 'morphTo', |
|
| 248 | - 'morphMany', |
|
| 249 | - 'morphToMany', |
|
| 250 | - 'morphedByMany' |
|
| 251 | - ] as $relation) { |
|
| 241 | + 'hasMany', |
|
| 242 | + 'hasManyThrough', |
|
| 243 | + 'belongsToMany', |
|
| 244 | + 'hasOne', |
|
| 245 | + 'belongsTo', |
|
| 246 | + 'morphOne', |
|
| 247 | + 'morphTo', |
|
| 248 | + 'morphMany', |
|
| 249 | + 'morphToMany', |
|
| 250 | + 'morphedByMany' |
|
| 251 | + ] as $relation) { |
|
| 252 | 252 | $search = '$this->' . $relation . '('; |
| 253 | 253 | if (stripos(/** @scrutinizer ignore-type */$code, $search)) { |
| 254 | 254 | //Resolve the relation's model to a Relation object. |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | protected $query; |
| 35 | 35 | protected $controllerContainer; |
| 36 | 36 | |
| 37 | - public function __construct(LaravelQuery &$query, AuthInterface $auth = null) |
|
| 37 | + public function __construct(LaravelQuery & $query, AuthInterface $auth = null) |
|
| 38 | 38 | { |
| 39 | 39 | $this->auth = isset($auth) ? $auth : new NullAuthProvider(); |
| 40 | 40 | $this->metadataProvider = new MetadataProvider(App::make('app')); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | foreach ($order->getSubPathSegments() as $subOrder) { |
| 104 | 104 | $subName = $subOrder->getName(); |
| 105 | 105 | $subName = (self::PK == $subName) ? $keyName : $subName; |
| 106 | - $subName = $tableName.'.'.$subName; |
|
| 106 | + $subName = $tableName . '.' . $subName; |
|
| 107 | 107 | $sourceEntityInstance = $sourceEntityInstance->orderBy( |
| 108 | 108 | $subName, |
| 109 | 109 | $order->isAscending() ? 'asc' : 'desc' |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | assert(is_string($line), 'Eager-load elements must be non-empty strings'); |
| 492 | 492 | $lineParts = explode('/', $line); |
| 493 | 493 | $numberOfParts = count($lineParts); |
| 494 | - for ($i = 0; $i<$numberOfParts; $i++) { |
|
| 494 | + for ($i = 0; $i < $numberOfParts; $i++) { |
|
| 495 | 495 | $lineParts[$i] = $this->getLaravelRelationName($lineParts[$i]); |
| 496 | 496 | } |
| 497 | 497 | $remixLine = implode('.', $lineParts); |
@@ -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; |