Completed
Branch master (9c4346)
by Patrick
10:57
created
class.ODataParams.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -12,45 +12,45 @@  discard block
 block discarded – undo
12 12
 
13 13
     function __construct($params)
14 14
     {
15
-        if(isset($params['filter']))
15
+        if (isset($params['filter']))
16 16
         {
17 17
             $this->filter = new \Data\Filter($params['filter']);
18 18
         }
19
-        else if(isset($params['$filter']))
19
+        else if (isset($params['$filter']))
20 20
         {
21 21
             $this->filter = new \Data\Filter($params['$filter']);
22 22
         }
23 23
 
24
-        if(isset($params['$expand']))
24
+        if (isset($params['$expand']))
25 25
         {
26
-            $this->expand = explode(',',$params['$expand']);
26
+            $this->expand = explode(',', $params['$expand']);
27 27
         }
28 28
 
29
-        if(isset($params['select']))
29
+        if (isset($params['select']))
30 30
         {
31
-            $this->select = explode(',',$params['select']);
31
+            $this->select = explode(',', $params['select']);
32 32
         }
33
-        else if(isset($params['$select']))
33
+        else if (isset($params['$select']))
34 34
         {
35
-            $this->select = explode(',',$params['$select']);
35
+            $this->select = explode(',', $params['$select']);
36 36
         }
37 37
 
38
-        if(isset($params['$orderby']))
38
+        if (isset($params['$orderby']))
39 39
         {
40 40
             $this->orderby = array();
41
-            $orderby = explode(',',$params['$orderby']);
41
+            $orderby = explode(',', $params['$orderby']);
42 42
             $count = count($orderby);
43
-            for($i = 0; $i < $count; $i++)
43
+            for ($i = 0; $i < $count; $i++)
44 44
             {
45
-                $exp = explode(' ',$orderby[$i]);
46
-                if(count($exp) === 1)
45
+                $exp = explode(' ', $orderby[$i]);
46
+                if (count($exp) === 1)
47 47
                 {
48 48
                     //Default to assending
49 49
                     $this->orderby[$exp[0]] = 1;
50 50
                 }
51 51
                 else
52 52
                 {
53
-                    switch($exp[1])
53
+                    switch ($exp[1])
54 54
                     {
55 55
                         case 'asc':
56 56
                             $this->orderby[$exp[0]] = 1;
@@ -65,22 +65,22 @@  discard block
 block discarded – undo
65 65
             }
66 66
         }
67 67
 
68
-        if(isset($params['$top']))
68
+        if (isset($params['$top']))
69 69
         {
70 70
             $this->top = $params['$top'];
71 71
         }
72 72
 
73
-        if(isset($params['$skip']))
73
+        if (isset($params['$skip']))
74 74
         {
75 75
             $this->skip = $params['$skip'];
76 76
         }
77 77
 
78
-        if(isset($params['$count']) && $params['$count'] === 'true')
78
+        if (isset($params['$count']) && $params['$count'] === 'true')
79 79
         {
80 80
             $this->count = true;
81 81
         }
82 82
 
83
-        if(isset($params['$seach']))
83
+        if (isset($params['$seach']))
84 84
         {
85 85
             throw new Exception('Search not yet implemented');
86 86
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
         if(isset($params['filter']))
16 16
         {
17 17
             $this->filter = new \Data\Filter($params['filter']);
18
-        }
19
-        else if(isset($params['$filter']))
18
+        } else if(isset($params['$filter']))
20 19
         {
21 20
             $this->filter = new \Data\Filter($params['$filter']);
22 21
         }
@@ -29,8 +28,7 @@  discard block
 block discarded – undo
29 28
         if(isset($params['select']))
30 29
         {
31 30
             $this->select = explode(',',$params['select']);
32
-        }
33
-        else if(isset($params['$select']))
31
+        } else if(isset($params['$select']))
34 32
         {
35 33
             $this->select = explode(',',$params['$select']);
36 34
         }
@@ -47,8 +45,7 @@  discard block
 block discarded – undo
47 45
                 {
48 46
                     //Default to assending
49 47
                     $this->orderby[$exp[0]] = 1;
50
-                }
51
-                else
48
+                } else
52 49
                 {
53 50
                     switch($exp[1])
54 51
                     {
Please login to merge, or discard this patch.