@@ -98,7 +98,7 @@ |
||
| 98 | 98 | */ |
| 99 | 99 | public function register() |
| 100 | 100 | { |
| 101 | - $this->app->singleton('metadata', function ($app) { |
|
| 101 | + $this->app->singleton('metadata', function($app) { |
|
| 102 | 102 | return new SimpleMetadataProvider('Data', self::$METANAMESPACE); |
| 103 | 103 | }); |
| 104 | 104 | } |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | */ |
| 80 | 80 | public function register() |
| 81 | 81 | { |
| 82 | - $this->app->singleton('metadataControllers', function ($app) { |
|
| 82 | + $this->app->singleton('metadataControllers', function($app) { |
|
| 83 | 83 | return new MetadataControllerContainer(); |
| 84 | 84 | }); |
| 85 | 85 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function register() |
| 26 | 26 | { |
| 27 | - $this->app->singleton('odataquery', function ($app) { |
|
| 27 | + $this->app->singleton('odataquery', function($app) { |
|
| 28 | 28 | return new LaravelQuery(); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -490,7 +490,7 @@ |
||
| 490 | 490 | } |
| 491 | 491 | $outData = $result->getData(); |
| 492 | 492 | if (is_object($outData)) { |
| 493 | - $outData = (array)$outData; |
|
| 493 | + $outData = (array) $outData; |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | if (!is_array($outData)) { |
@@ -255,7 +255,7 @@ |
||
| 255 | 255 | $relations = ['hasManyThrough', 'belongsToMany', 'hasMany', 'morphMany', 'morphToMany']; |
| 256 | 256 | if (in_array($relation, $relations)) { |
| 257 | 257 | //Collection or array of models (because Collection is Arrayable) |
| 258 | - $relationships["HasMany"][$method] = $relatedModel; |
|
| 258 | + $relationships["HasMany"][$method] = $relatedModel; |
|
| 259 | 259 | } elseif ($relation === "morphTo") { |
| 260 | 260 | // Model isn't specified because relation is polymorphic |
| 261 | 261 | $relationships["UnknownPolyMorphSide"][$method] = |
@@ -50,80 +50,80 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function __construct() |
| 52 | 52 | { |
| 53 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_COMPARE] = function($params){ |
|
| 53 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_COMPARE] = function($params) { |
|
| 54 | 54 | return "strcmp($params[0], $params[1])"; |
| 55 | 55 | }; |
| 56 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_ENDSWITH] = function($params){ |
|
| 56 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_ENDSWITH] = function($params) { |
|
| 57 | 57 | return "(strcmp(substr($params[0], strlen($params[0]) - strlen($params[1])), $params[1]) === 0)"; |
| 58 | 58 | }; |
| 59 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_INDEXOF] = function($params){ |
|
| 59 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_INDEXOF] = function($params) { |
|
| 60 | 60 | return "strpos($params[0], $params[1])"; |
| 61 | 61 | }; |
| 62 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_REPLACE] = function($params){ |
|
| 62 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_REPLACE] = function($params) { |
|
| 63 | 63 | return "str_replace($params[1], $params[2], $params[0])"; |
| 64 | 64 | }; |
| 65 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_STARTSWITH] = function($params){ |
|
| 65 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_STARTSWITH] = function($params) { |
|
| 66 | 66 | return "(strpos($params[0], $params[1]) === 0)"; |
| 67 | 67 | }; |
| 68 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_TOLOWER] = function($params){ |
|
| 68 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_TOLOWER] = function($params) { |
|
| 69 | 69 | return "strtolower($params[0])"; |
| 70 | 70 | }; |
| 71 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_TOUPPER] = function($params){ |
|
| 71 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_TOUPPER] = function($params) { |
|
| 72 | 72 | return "strtoupper($params[0])"; |
| 73 | 73 | }; |
| 74 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_TRIM] = function($params){ |
|
| 74 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_TRIM] = function($params) { |
|
| 75 | 75 | return "trim($params[0])"; |
| 76 | 76 | }; |
| 77 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRING] = function($params){ |
|
| 77 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRING] = function($params) { |
|
| 78 | 78 | return count($params) == 3 ? |
| 79 | 79 | "substr($params[0], $params[1], $params[2])" : "substr($params[0], $params[1])"; |
| 80 | 80 | }; |
| 81 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRINGOF] = function($params){ |
|
| 81 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRINGOF] = function($params) { |
|
| 82 | 82 | return "(strpos($params[1], $params[0]) !== false)"; |
| 83 | 83 | }; |
| 84 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_CONCAT] = function($params){ |
|
| 84 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_CONCAT] = function($params) { |
|
| 85 | 85 | return $params[0].' . '.$params[1]; |
| 86 | 86 | }; |
| 87 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_LENGTH] = function($params){ |
|
| 87 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_LENGTH] = function($params) { |
|
| 88 | 88 | return "strlen($params[0])"; |
| 89 | 89 | }; |
| 90 | - $this->functionDescriptionParsers[ODataConstants::GUIDFUN_EQUAL] = function($params){ |
|
| 90 | + $this->functionDescriptionParsers[ODataConstants::GUIDFUN_EQUAL] = function($params) { |
|
| 91 | 91 | return self::TYPE_NAMESPACE."Guid::guidEqual($params[0], $params[1])"; |
| 92 | 92 | }; |
| 93 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_COMPARE] = function($params){ |
|
| 93 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_COMPARE] = function($params) { |
|
| 94 | 94 | return self::TYPE_NAMESPACE."DateTime::dateTimeCmp($params[0], $params[1])"; |
| 95 | 95 | }; |
| 96 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_YEAR] = function($params){ |
|
| 96 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_YEAR] = function($params) { |
|
| 97 | 97 | return self::TYPE_NAMESPACE."DateTime::year($params[0])"; |
| 98 | 98 | }; |
| 99 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_MONTH] = function($params){ |
|
| 99 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_MONTH] = function($params) { |
|
| 100 | 100 | return self::TYPE_NAMESPACE."DateTime::month($params[0])"; |
| 101 | 101 | }; |
| 102 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_DAY] = function($params){ |
|
| 102 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_DAY] = function($params) { |
|
| 103 | 103 | return self::TYPE_NAMESPACE."DateTime::day($params[0])"; |
| 104 | 104 | }; |
| 105 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_HOUR] = function($params){ |
|
| 105 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_HOUR] = function($params) { |
|
| 106 | 106 | return self::TYPE_NAMESPACE."DateTime::hour($params[0])"; |
| 107 | 107 | }; |
| 108 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_MINUTE] = function($params){ |
|
| 108 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_MINUTE] = function($params) { |
|
| 109 | 109 | return self::TYPE_NAMESPACE."DateTime::minute($params[0])"; |
| 110 | 110 | }; |
| 111 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_SECOND] = function($params){ |
|
| 111 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_SECOND] = function($params) { |
|
| 112 | 112 | return self::TYPE_NAMESPACE."DateTime::second($params[0])"; |
| 113 | 113 | }; |
| 114 | - $this->functionDescriptionParsers[ODataConstants::MATHFUN_ROUND] = function($params){ |
|
| 114 | + $this->functionDescriptionParsers[ODataConstants::MATHFUN_ROUND] = function($params) { |
|
| 115 | 115 | return "round($params[0])"; |
| 116 | 116 | }; |
| 117 | - $this->functionDescriptionParsers[ODataConstants::MATHFUN_CEILING] = function($params){ |
|
| 117 | + $this->functionDescriptionParsers[ODataConstants::MATHFUN_CEILING] = function($params) { |
|
| 118 | 118 | return "ceil($params[0])"; |
| 119 | 119 | }; |
| 120 | - $this->functionDescriptionParsers[ODataConstants::MATHFUN_FLOOR] = function($params){ |
|
| 120 | + $this->functionDescriptionParsers[ODataConstants::MATHFUN_FLOOR] = function($params) { |
|
| 121 | 121 | return "floor($params[0])"; |
| 122 | 122 | }; |
| 123 | - $this->functionDescriptionParsers[ODataConstants::BINFUL_EQUAL] = function($params){ |
|
| 123 | + $this->functionDescriptionParsers[ODataConstants::BINFUL_EQUAL] = function($params) { |
|
| 124 | 124 | return self::TYPE_NAMESPACE."Binary::binaryEqual($params[0], $params[1])"; |
| 125 | 125 | }; |
| 126 | - $this->functionDescriptionParsers['is_null'] = function($params){ |
|
| 126 | + $this->functionDescriptionParsers['is_null'] = function($params) { |
|
| 127 | 127 | return "is_null($params[0])"; |
| 128 | 128 | }; |
| 129 | 129 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | if (!isset($functionDescription)) { |
| 301 | 301 | throw new \InvalidArgumentException('onFunctionCallExpression'); |
| 302 | 302 | } |
| 303 | - if(!array_key_exists ($functionDescription->name, $this->functionDescriptionParsers)){ |
|
| 303 | + if (!array_key_exists($functionDescription->name, $this->functionDescriptionParsers)) { |
|
| 304 | 304 | throw new \InvalidArgumentException('onFunctionCallExpression'); |
| 305 | 305 | } |
| 306 | 306 | return $this->functionDescriptionParsers[$functionDescription->name]($params); |