Completed
Push — master ( 8e9858...ee369b )
by Kirill
02:43
created
src/Criteria/OrderBy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,6 +64,6 @@
 block discarded – undo
64 64
      */
65 65
     public function isDesc(): bool
66 66
     {
67
-        return ! $this->asc;
67
+        return !$this->asc;
68 68
     }
69 69
 }
Please login to merge, or discard this patch.
src/Criteria/Where.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                 return \iterator_to_array($value);
63 63
 
64 64
             case \is_object($value) && \method_exists($value, '__toString'):
65
-                return (string)$value;
65
+                return (string) $value;
66 66
         }
67 67
 
68 68
         return $value;
Please login to merge, or discard this patch.
src/Query/RelationProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             }
41 41
 
42 42
             $error = 'Relation should be string ("relation_name") '.
43
-                'or array (["relation" => function]), ' .
43
+                'or array (["relation" => function]), '.
44 44
                 'but %s given';
45 45
 
46 46
             throw new \InvalidArgumentException(\sprintf($error, \gettype($relation)));
Please login to merge, or discard this patch.
src/Hydrogen.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function query(): Query
44 44
     {
45
-        if (! $this instanceof EntityRepository) {
45
+        if (!$this instanceof EntityRepository) {
46 46
             $error = 'Could not use %s under non-repository class, but %s given';
47 47
             throw new \LogicException(\sprintf($error, Hydrogen::class, static::class));
48 48
         }
Please login to merge, or discard this patch.
src/Query/ExecutionsProvider.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace RDS\Hydrogen\Query;
11 11
 
12
-use Illuminate\Support\Arr;
13 12
 use RDS\Hydrogen\Query;
14 13
 use RDS\Hydrogen\Collection\Collection;
15 14
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -75,25 +75,25 @@  discard block
 block discarded – undo
75 75
 
76 76
         switch ($typeOf) {
77 77
             case 'callable':
78
-                return function (callable $applicator = null) use ($result) {
78
+                return function(callable $applicator = null) use ($result) {
79 79
                     return ($applicator ?? '\\value')($result);
80 80
                 };
81 81
 
82 82
             case 'object':
83
-                return (object)$result;
83
+                return (object) $result;
84 84
 
85 85
             case 'array':
86 86
             case 'iterable':
87
-                return (array)$result;
87
+                return (array) $result;
88 88
 
89 89
             case 'string':
90
-                return (string)$result;
90
+                return (string) $result;
91 91
         }
92 92
 
93
-        $function = $typeOf . 'val';
93
+        $function = $typeOf.'val';
94 94
 
95
-        if (! \function_exists($function)) {
96
-            throw new \InvalidArgumentException('Could not cast to type ' . $typeOf);
95
+        if (!\function_exists($function)) {
96
+            throw new \InvalidArgumentException('Could not cast to type '.$typeOf);
97 97
         }
98 98
 
99 99
         return $function($result);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         }
112 112
 
113 113
         return $this
114
-            ->select('COUNT(' . $field . ') AS __count')
114
+            ->select('COUNT('.$field.') AS __count')
115 115
             ->scalar('__count', 'int');
116 116
     }
117 117
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function sum(string $field = null): int
124 124
     {
125 125
         return $this
126
-            ->select('SUM(' . $field . ') AS __sum')
126
+            ->select('SUM('.$field.') AS __sum')
127 127
             ->scalar('__sum', 'int');
128 128
     }
129 129
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     public function avg(string $field = null): int
136 136
     {
137 137
         return $this
138
-            ->select('AVG(' . $field . ') AS __avg')
138
+            ->select('AVG('.$field.') AS __avg')
139 139
             ->scalar('__avg', 'int');
140 140
     }
141 141
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     public function max(string $field = null): int
148 148
     {
149 149
         return $this
150
-            ->select('MAX(' . $field . ') AS __max')
150
+            ->select('MAX('.$field.') AS __max')
151 151
             ->scalar('__max', 'int');
152 152
     }
153 153
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     public function min(string $field = null): int
160 160
     {
161 161
         return $this
162
-            ->select('MIN(' . $field . ') AS __min')
162
+            ->select('MIN('.$field.') AS __min')
163 163
             ->scalar('__min', 'int');
164 164
     }
165 165
 
Please login to merge, or discard this patch.
src/Query/GroupByProvider.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 namespace RDS\Hydrogen\Query;
11 11
 
12 12
 use RDS\Hydrogen\Criteria\HavingGroup;
13
-use RDS\Hydrogen\Criteria\WhereGroup;
14 13
 use RDS\Hydrogen\Criteria\GroupBy;
15 14
 use RDS\Hydrogen\Criteria\Having;
16 15
 use RDS\Hydrogen\Query;
Please login to merge, or discard this patch.
src/Query/WhereProvider/WhereInProvider.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 namespace RDS\Hydrogen\Query\WhereProvider;
11 11
 
12 12
 use RDS\Hydrogen\Criteria\Where\Operator;
13
-use RDS\Hydrogen\Criteria\Where;
14 13
 use RDS\Hydrogen\Query;
15 14
 
16 15
 /**
Please login to merge, or discard this patch.
src/Criteria/Common/Field.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $before = \substr($query, 0, $analyzed->getReturn());
74 74
         $after  = \substr($query, $analyzed->getReturn() + \max(0, $haystack - 1));
75 75
 
76
-        $this->wrapper = $before . '%s' . $after;
76
+        $this->wrapper = $before.'%s'.$after;
77 77
     }
78 78
 
79 79
     /**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             }
118 118
         }
119 119
 
120
-        return (int)$offset;
120
+        return (int) $offset;
121 121
     }
122 122
 
123 123
     /**
Please login to merge, or discard this patch.
src/Query/AliasProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             }
61 61
         }
62 62
 
63
-        return 'q' . Str::random(7) . '_' . ++static::$lastQueryId;
63
+        return 'q'.Str::random(7).'_'.++static::$lastQueryId;
64 64
     }
65 65
 
66 66
     /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function createPlaceholder(string $pattern = null): string
71 71
     {
72
-        return ':' . $this->createAlias($pattern);
72
+        return ':'.$this->createAlias($pattern);
73 73
     }
74 74
 
75 75
     /**
Please login to merge, or discard this patch.