Completed
Push — master ( 3279ce...3c79e2 )
by Christopher
06:53
created
src/Providers/MetadataProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function boot()
23 23
     {
24 24
         self::$METANAMESPACE = env('ODataMetaNamespace', 'Data');
25
-        if(\App::runningInConsole() && count($_SERVER[ 'argv' ]) > 1 && $_SERVER[ 'argv' ][0] == "artisan"){
25
+        if (\App::runningInConsole() && count($_SERVER['argv']) > 1 && $_SERVER['argv'][0] == "artisan") {
26 26
            return;
27 27
         }
28 28
 
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
         }
84 84
     }
85 85
 
86
-    private static function setupRoute(){
86
+    private static function setupRoute() {
87 87
         $valueArray = [];
88 88
 
89 89
         Route::any('odata.svc/{section}', 'AlgoWeb\PODataLaravel\Controllers\ODataController@index') ->where(['section' => '.*']);
90 90
         Route::any('odata.svc', 'AlgoWeb\PODataLaravel\Controllers\ODataController@index');
91 91
 
92
-        Route::get('/', function () use ($valueArray) {
92
+        Route::get('/', function() use ($valueArray) {
93 93
             $array = array(
94 94
                 '@odata.context' => Config::get('app.url').'/$metadata',
95 95
                 'value' => $valueArray
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function register()
107 107
     {
108
-        $this->app->singleton('metadata', function ($app) {
108
+        $this->app->singleton('metadata', function($app) {
109 109
             return new SimpleMetadataProvider('Data', self::$METANAMESPACE);
110 110
         });
111 111
     }
Please login to merge, or discard this patch.
src/Providers/QueryProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Models/MetadataTrait.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -229,16 +229,16 @@
 block discarded – undo
229 229
                     $begin = strpos($code, 'function(');
230 230
                     $code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
231 231
                     foreach (array(
232
-                               'hasMany',
233
-                               'hasManyThrough',
234
-                               'belongsToMany',
235
-                               'hasOne',
236
-                               'belongsTo',
237
-                               'morphOne',
238
-                               'morphTo',
239
-                               'morphMany',
240
-                               'morphToMany'
241
-                             ) as $relation) {
232
+                                'hasMany',
233
+                                'hasManyThrough',
234
+                                'belongsToMany',
235
+                                'hasOne',
236
+                                'belongsTo',
237
+                                'morphOne',
238
+                                'morphTo',
239
+                                'morphMany',
240
+                                'morphToMany'
241
+                                ) as $relation) {
242 242
                         $search = '$this->' . $relation . '(';
243 243
                         if ($pos = stripos($code, $search)) {
244 244
                             //Resolve the relation's model to a Relation object.
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         }*/
61 61
             assert(
62 62
                 Schema::connection($connName)->hasTable($this->table),
63
-                $this->table . ' table not present in current db, ' . $this->getConnectionName()
63
+                $this->table.' table not present in current db, '.$this->getConnectionName()
64 64
             );
65 65
         
66 66
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             if ($key == $keyName) {
121 121
                 continue;
122 122
             }
123
-            if($secret['type'] == "blob"){
123
+            if ($secret['type'] == "blob") {
124 124
                 $complex->setMediaLinkEntry(true);
125 125
                 $streamInfo = new ResourceStreamInfo($key);
126 126
                 $complex->addNamedStream($streamInfo);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                     $reflection = new \ReflectionMethod($model, $method);
220 220
 
221 221
                     $file = new \SplFileObject($reflection->getFileName());
222
-                    $file->seek($reflection->getStartLine() - 1);
222
+                    $file->seek($reflection->getStartLine()-1);
223 223
                     $code = '';
224 224
                     while ($file->key() < $reflection->getEndLine()) {
225 225
                         $code .= $file->current();
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                     }
228 228
                     $code = trim(preg_replace('/\s\s+/', '', $code));
229 229
                     $begin = strpos($code, 'function(');
230
-                    $code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
230
+                    $code = substr($code, $begin, strrpos($code, '}')-$begin+1);
231 231
                     foreach (array(
232 232
                                'hasMany',
233 233
                                'hasManyThrough',
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
                                'morphMany',
240 240
                                'morphToMany'
241 241
                              ) as $relation) {
242
-                        $search = '$this->' . $relation . '(';
242
+                        $search = '$this->'.$relation.'(';
243 243
                         if ($pos = stripos($code, $search)) {
244 244
                             //Resolve the relation's model to a Relation object.
245 245
                             $relationObj = $model->$method();
246 246
                             if ($relationObj instanceof Relation) {
247
-                                $relatedModel = '\\' . get_class($relationObj->getRelated());
247
+                                $relatedModel = '\\'.get_class($relationObj->getRelated());
248 248
                                 $relations = ['hasManyThrough', 'belongsToMany', 'hasMany', 'morphMany', 'morphToMany'];
249 249
                                 if (in_array($relation, $relations)) {
250 250
                                     //Collection or array of models (because Collection is Arrayable)
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
                                     $relationships["HasOne"][$method] = $relatedModel;
270 270
                                     //$this->setProperty($method, $relatedModel, true, null);
271 271
                                 }
272
-                                if (in_array($relation, ["morphMany","morphOne"])) {
272
+                                if (in_array($relation, ["morphMany", "morphOne"])) {
273 273
                                     $relationships["KnownPolyMorphSide"][$method] = $relatedModel;
274 274
                                 }
275 275
                             }
Please login to merge, or discard this patch.
src/Query/LaravelExpressionProvider.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -240,17 +240,17 @@  discard block
 block discarded – undo
240 240
             case ODataConstants::DATETIME_COMPARE:
241 241
                 return "DATETIMECMP($params[0]; $params[1])";
242 242
             case ODataConstants::DATETIME_YEAR:
243
-                return 'EXTRACT(YEAR from ' . $params[0] . ')';
243
+                return 'EXTRACT(YEAR from '.$params[0].')';
244 244
             case ODataConstants::DATETIME_MONTH:
245
-                return 'EXTRACT(MONTH from ' . $params[0] . ')';
245
+                return 'EXTRACT(MONTH from '.$params[0].')';
246 246
             case ODataConstants::DATETIME_DAY:
247
-                return 'EXTRACT(DAY from ' . $params[0] . ')';
247
+                return 'EXTRACT(DAY from '.$params[0].')';
248 248
             case ODataConstants::DATETIME_HOUR:
249
-                return 'EXTRACT(HOUR from ' . $params[0] . ')';
249
+                return 'EXTRACT(HOUR from '.$params[0].')';
250 250
             case ODataConstants::DATETIME_MINUTE:
251
-                return 'EXTRACT(MINUTE from ' . $params[0] . ')';
251
+                return 'EXTRACT(MINUTE from '.$params[0].')';
252 252
             case ODataConstants::DATETIME_SECOND:
253
-                return 'EXTRACT(SECOND from ' . $params[0] . ')';
253
+                return 'EXTRACT(SECOND from '.$params[0].')';
254 254
             case ODataConstants::MATHFUN_ROUND:
255 255
                 return "ROUND($params[0])";
256 256
             case ODataConstants::MATHFUN_CEILING:
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
             $str = explode(';', $left, 2);
282 282
             $str[0] = str_replace('DATETIMECMP', '', $str[0]);
283 283
             return self::OPEN_BRACKET
284
-                .$str[0] . ' ' . $operator
285
-                .' ' . $str[1] . self::CLOSE_BRACKET;
284
+                .$str[0].' '.$operator
285
+                .' '.$str[1].self::CLOSE_BRACKET;
286 286
         }
287 287
         //return self::OPEN_BRACKET . $left . ' ' . $operator . ' ' . $right . self::CLOSE_BRACKET;
288 288
 	    return $this->getSql();
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
      */
298 298
     private function _prepareUnaryExpression($operator, $child)
299 299
     {
300
-        return $operator . self::OPEN_BRACKET . $child . self::CLOSE_BRACKET;
300
+        return $operator.self::OPEN_BRACKET.$child.self::CLOSE_BRACKET;
301 301
     }
302 302
 
303 303
     private function getSql()
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -310,7 +310,7 @@
 block discarded – undo
310 310
         return $nuSql;
311 311
     }
312 312
 
313
-   private function replace($sql, $bindings)
313
+    private function replace($sql, $bindings)
314 314
     {
315 315
         $needle = '?';
316 316
         foreach ($bindings as $replace) {
Please login to merge, or discard this patch.
src/Query/LaravelQuery.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     public function __construct()
25 25
     {
26 26
         /* MySQLExpressionProvider();*/
27
-        $this->expression = new LaravelExpressionProvider(DB::table('dummy'));//PHPExpressionProvider('expression');
27
+        $this->expression = new LaravelExpressionProvider(DB::table('dummy')); //PHPExpressionProvider('expression');
28 28
         $this->queryProviderClassName = get_class($this);
29 29
     }
30 30
 
Please login to merge, or discard this patch.