Completed
Branch master (2663c6)
by Stan
03:41
created
src/Magister/Models/Enrollment/Enrollment.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
     /**
45 45
      * Define a relationship.
46 46
      *
47
-     * @return mixed
47
+     * @return \Magister\Services\Database\Elegant\Relations\HasMany
48 48
      */
49 49
     public function counsellors()
50 50
     {
Please login to merge, or discard this patch.
src/Magister/Services/Auth/Guard.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     /**
154 154
      * Determine if the user matches the credentials.
155 155
      *
156
-     * @param mixed $user
156
+     * @param \Magister\Services\Database\Elegant\Model|null $user
157 157
      *
158 158
      * @return bool
159 159
      */
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     /**
287 287
      * Return the currently cached user.
288 288
      *
289
-     * @return mixed|null
289
+     * @return UserContract
290 290
      */
291 291
     public function getUser()
292 292
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function check()
67 67
     {
68
-        return !is_null($this->user());
68
+        return ! is_null($this->user());
69 69
     }
70 70
 
71 71
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function guest()
77 77
     {
78
-        return !$this->check();
78
+        return ! $this->check();
79 79
     }
80 80
 
81 81
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         // If we have already retrieved the user for the current request we can just
93 93
         // return it back immediately. We do not want to pull the user data every
94 94
         // request into the method because that would tremendously slow an app.
95
-        if (!is_null($this->user)) {
95
+        if ( ! is_null($this->user)) {
96 96
             return $this->user;
97 97
         }
98 98
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         $user = null;
102 102
 
103
-        if (!is_null($id)) {
103
+        if ( ! is_null($id)) {
104 104
             $user = $this->provider->retrieveByToken();
105 105
         }
106 106
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     protected function hasValidCredentials($user)
161 161
     {
162
-        return !is_null($user);
162
+        return ! is_null($user);
163 163
     }
164 164
 
165 165
     /**
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      */
315 315
     public function getCookieJar()
316 316
     {
317
-        if (!isset($this->cookie)) {
317
+        if ( ! isset($this->cookie)) {
318 318
             throw new \RuntimeException('Cookie jar has not been set.');
319 319
         }
320 320
 
Please login to merge, or discard this patch.
src/Magister/Services/Container/Container.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * Register a service as a singleton.
37 37
      *
38 38
      * @param string $abstract
39
-     * @param mixed  $concrete
39
+     * @param Closure  $concrete
40 40
      *
41 41
      * @return void
42 42
      */
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      *
210 210
      * @param string $abstract
211 211
      *
212
-     * @return bool
212
+     * @return boolean|null
213 213
      */
214 214
     public function __isset($abstract)
215 215
     {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      *
259 259
      * @param string $abstract
260 260
      *
261
-     * @return bool
261
+     * @return boolean|null
262 262
      */
263 263
     public function offsetExists($abstract)
264 264
     {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function make($abstract)
58 58
     {
59
-        if (!$this->bound($abstract)) {
59
+        if ( ! $this->bound($abstract)) {
60 60
             throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract));
61 61
         }
62 62
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public static function share(Closure $callable)
101 101
     {
102
-        return function ($c) use ($callable) {
102
+        return function($c) use ($callable) {
103 103
             static $object;
104 104
 
105 105
             if (null === $object) {
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public static function protect(Closure $callable)
121 121
     {
122
-        return function ($c) use ($callable) {
122
+        return function($c) use ($callable) {
123 123
             return $callable;
124 124
         };
125 125
     }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function raw($abstract)
137 137
     {
138
-        if (!array_key_exists($abstract, $this->bindings)) {
138
+        if ( ! array_key_exists($abstract, $this->bindings)) {
139 139
             throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract));
140 140
         }
141 141
 
@@ -154,17 +154,17 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function extend($abstract, Closure $callable)
156 156
     {
157
-        if (!array_key_exists($abstract, $this->bindings)) {
157
+        if ( ! array_key_exists($abstract, $this->bindings)) {
158 158
             throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract));
159 159
         }
160 160
 
161 161
         $factory = $this->bindings[$abstract];
162 162
 
163
-        if (!($factory instanceof Closure)) {
163
+        if ( ! ($factory instanceof Closure)) {
164 164
             throw new InvalidArgumentException(sprintf('Identifier "%s" does not contain an object definition.', $abstract));
165 165
         }
166 166
 
167
-        return $this->bindings[$abstract] = function ($c) use ($callable, $factory) {
167
+        return $this->bindings[$abstract] = function($c) use ($callable, $factory) {
168 168
             return $callable($factory($c), $c);
169 169
         };
170 170
     }
Please login to merge, or discard this patch.
src/Magister/Services/Database/Query/Builder.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @param string $column
73 73
      * @param string $key
74 74
      *
75
-     * @return array
75
+     * @return Collection
76 76
      */
77 77
     public function lists($column, $key = null)
78 78
     {
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      *
201 201
      * @throws \BadMethodCallException
202 202
      *
203
-     * @return mixed
203
+     * @return Builder
204 204
      */
205 205
     public function __call($method, $parameters)
206 206
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
     {
96 96
         $select = is_null($key) ? [$column] : [$column, $key];
97 97
 
98
-        return array_map(function ($column) {
98
+        return array_map(function($column) {
99 99
             $dot = strpos($column, '.');
100 100
 
101 101
             return $dot === false ? $column : substr($column, $dot + 1);
Please login to merge, or discard this patch.
src/Magister/Services/Events/Dispatcher.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@
 block discarded – undo
155 155
     /**
156 156
      * Create a class based listener using the IoC container.
157 157
      *
158
-     * @param mixed $listener
158
+     * @param string $listener
159 159
      *
160 160
      * @return \Closure
161 161
      */
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $responses = [];
81 81
 
82
-        if (!is_array($payload)) {
82
+        if ( ! is_array($payload)) {
83 83
             $payload = [$payload];
84 84
         }
85 85
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         foreach ($this->getListeners($event) as $listener) {
89 89
             $response = call_user_func_array($listener, $payload);
90 90
 
91
-            if (!is_null($response) && $halt) {
91
+            if ( ! is_null($response) && $halt) {
92 92
                 return $response;
93 93
             }
94 94
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function getListeners($eventName)
113 113
     {
114
-        if (!isset($this->sorted[$eventName])) {
114
+        if ( ! isset($this->sorted[$eventName])) {
115 115
             $this->sortListeners($eventName);
116 116
         }
117 117
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     {
164 164
         $container = $this->container;
165 165
 
166
-        return function () use ($listener, $container) {
166
+        return function() use ($listener, $container) {
167 167
             $segments = explode('@', $listener);
168 168
 
169 169
             $method = count($segments) == 2 ? $segments[1] : 'handle';
Please login to merge, or discard this patch.
src/Magister/Services/Support/Collection.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
     /**
203 203
      * Remove an item from the collection by key.
204 204
      *
205
-     * @param mixed $key
205
+     * @param string $key
206 206
      *
207 207
      * @return void
208 208
      */
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
     public function contains($key, $value = null)
65 65
     {
66 66
         if (func_num_args() == 2) {
67
-            return $this->contains(function ($k, $item) use ($key, $value) {
67
+            return $this->contains(function($k, $item) use ($key, $value) {
68 68
                 return data_get($item, $key) == $value;
69 69
             });
70 70
         }
71 71
 
72 72
         if ($this->useAsCallable($key)) {
73
-            return !is_null($this->first($key));
73
+            return ! is_null($this->first($key));
74 74
         }
75 75
 
76 76
         return in_array($key, $this->items);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     public function where($key, $value, $strict = true)
131 131
     {
132
-        return $this->filter(function ($item) use ($key, $value, $strict) {
132
+        return $this->filter(function($item) use ($key, $value, $strict) {
133 133
             return $strict ? data_get($item, $key) === $value : data_get($item, $key) == $value;
134 134
         });
135 135
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public function find($key, $default = null)
159 159
     {
160
-        return array_first($this->items, function ($itemKey, $model) use ($key) {
160
+        return array_first($this->items, function($itemKey, $model) use ($key) {
161 161
             return $itemKey == $key;
162 162
         }, $default);
163 163
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         foreach ($this->items as $key => $value) {
246 246
             $groupKey = $groupBy($value, $key);
247 247
 
248
-            if (!array_key_exists($groupKey, $results)) {
248
+            if ( ! array_key_exists($groupKey, $results)) {
249 249
                 $results[$groupKey] = new static();
250 250
             }
251 251
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     protected function useAsCallable($value)
339 339
     {
340
-        return !is_string($value) && is_callable($value);
340
+        return ! is_string($value) && is_callable($value);
341 341
     }
342 342
 
343 343
     /**
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
             return $value;
652 652
         }
653 653
 
654
-        return function ($item) use ($value) {
654
+        return function($item) use ($value) {
655 655
             return data_get($item, $value);
656 656
         };
657 657
     }
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
      */
684 684
     public function toArray()
685 685
     {
686
-        return array_map(function ($value) {
686
+        return array_map(function($value) {
687 687
             return $value instanceof Arrayable ? $value->toArray() : $value;
688 688
         }, $this->items);
689 689
     }
Please login to merge, or discard this patch.
src/Magister/Magister.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             return;
161 161
         }
162 162
 
163
-        array_walk($this->serviceProviders, function ($p) {
163
+        array_walk($this->serviceProviders, function($p) {
164 164
             $this->bootProvider($p);
165 165
         });
166 166
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
     {
248 248
         $name = is_string($provider) ? $provider : get_class($provider);
249 249
 
250
-        return array_first($this->serviceProviders, function ($key, $value) use ($name) {
250
+        return array_first($this->serviceProviders, function($key, $value) use ($name) {
251 251
             return $value instanceof $name;
252 252
         });
253 253
     }
Please login to merge, or discard this patch.
src/Magister/Services/Auth/AuthServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     protected function registerAuthenticator()
28 28
     {
29
-        $this->app->singleton('auth', function ($app) {
29
+        $this->app->singleton('auth', function($app) {
30 30
             return new AuthManager($app);
31 31
         });
32 32
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         if ($this->app->bound('credentials')) {
42 42
             $auth = $this->app->auth;
43 43
 
44
-            if (!$auth->check()) {
44
+            if ( ! $auth->check()) {
45 45
                 $auth->attempt($this->app['credentials']);
46 46
             }
47 47
         }
Please login to merge, or discard this patch.
src/Magister/Services/Encryption/EncryptionServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      */
17 17
     public function register()
18 18
     {
19
-        $this->app->singleton('encrypter', function ($app) {
19
+        $this->app->singleton('encrypter', function($app) {
20 20
             return new Encrypter($app['config']['app.key']);
21 21
         });
22 22
     }
Please login to merge, or discard this patch.