Completed
Push — master ( e77a87...e3d3eb )
by Patrick
03:02
created

class.AuthProvider.php (18 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * AuthProvider class
4
 *
5
 * This file describes the AuthProvider Singleton
6
 *
7
 * PHP version 5 and 7
8
 *
9
 * @author Patrick Boyd / [email protected]
10
 * @copyright Copyright (c) 2015, Austin Artistic Reconstruction
11
 * @license http://www.apache.org/licenses/ Apache 2.0 License
12
 */
13
14
/**
15
 * Allow other classes to be loaded as needed
16
 */
17
require_once('Autoload.php');
18
19
/**
20
 * A Singleton class to abstract access to the authentication providers.
21
 *
22
 * This class is the primary method to access user data, login, and other authenication information.
23
 */
24
class AuthProvider extends Provider
25
{
26
    /**
27
     * Load the authentrication providers specified in the Settings $authProviders array
28
     *
29
     * @SuppressWarnings("StaticAccess")
30
     */
31
    protected function __construct()
32
    {
33
        $settings = \Settings::getInstance();
34
        $this->methods = $settings->getClassesByPropName('authProviders');
35
    }
36
37
    /**
38
     * Get the Auth\User class instance for the specified login
39
     *
40
     * Unlike the AuthProvider::login() function. This function will not impact the SESSION
41
     *
42
     * @param string $username The username of the User
43
     * @param string $password The password of the User
44
     *
45
     * @return Auth\User|false The User with the specified credentials or false if the credentials are not valid
46
     */
47
    public function getUserByLogin($username, $password)
48
    {
49
        $res = false;
50
        $count = count($this->methods);
51
        for($i = 0; $i < $count; $i++)
52
        {
53
            $res = $this->methods[$i]->login($username, $password);
54
            if($res !== false)
55
            {
56
                return $this->methods[$i]->getUser($res);
57
            }
58
        }
59
        return $res;
60
    }
61
62
    /**
63
     * Use the provided credetials to log the user on
64
     *
65
     * @param string $username The username of the User
66
     * @param string $password The password of the User
67
     *
68
     * @return true|false true if the login was successful, false otherwise
69
     */
70
    public function login($username, $password)
71
    {
72
        $res = false;
73
        $count = count($this->methods);
74
        for($i = 0; $i < $count; $i++)
75
        {
76
            $res = $this->methods[$i]->login($username, $password);
77
            if($res !== false)
78
            {
79
                FlipSession::setVar('AuthMethod', get_class($this->methods[$i]));
80
                FlipSession::setVar('AuthData', $res);
81
                break;
82
            }
83
        }
84
        return $res;
85
    }
86
87
    /**
88
     * Determine if the user is still logged on from the session data
89
     *
90
     * @param stdClass $data The AuthData from the session
91
     * @param string $methodName The AuthMethod from the session
92
     *
93
     * @return true|false true if user is logged on, false otherwise
94
     */
95
    public function isLoggedIn($data, $methodName)
96
    {
97
        $auth = $this->getMethodByName($methodName);
98
        return $auth->isLoggedIn($data);
99
    }
100
101
    /**
102
     * Obtain the currently logged in user from the session data
103
     *
104
     * @param stdClass $data The AuthData from the session
105
     * @param string $methodName The AuthMethod from the session
106
     *
107
     * @return Auth\User|false The User instance if user is logged on, false otherwise
108
     */
109
    public function getUser($data, $methodName)
110
    {
111
        $auth = $this->getMethodByName($methodName);
112
        return $auth->getUser($data);
113
    }
114
115
    /**
116
     * Merge or set the returnValue as appropriate
117
     *
118
     * @param false|Auth\Group|Auth\User $returnValue The value to merge to
119
     * @param Auth\Group|Auth\User $res The value to merge from
120
     *
121
     * @return Auth\Group|false The merged returnValue
122
     */
123
    public function mergeResult(&$returnValue, $res)
124
    {
125
        if($res === false)
126
        {
127
            return;
128
        }
129
        if($returnValue === false)
130
        {
131
            $returnValue = $res;
132
            return;
133
        }
134
        $returnValue->merge($res);
135
    }
136
137
    /**
138
     * Get an Auth\Group by its name
139
     *
140
     * @param string $name The name of the group
141
     * @param string $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
142
     *
143
     * @return Auth\Group|false The Group instance if a group with that name exists, false otherwise
144
     */
145
    public function getGroupByName($name, $methodName = false)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
146
    {
147
        if($methodName === false)
148
        {
149
            return $this->callOnEach('getGroupByName', array($name));
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->callOnEach('getGr...ByName', array($name)); of type Auth\Group|Auth\User|false adds the type Auth\User to the return on line 149 which is incompatible with the return type documented by AuthProvider::getGroupByName of type Auth\Group|false.
Loading history...
150
        }
151
        $auth = $this->getMethodByName($methodName);
152
        return $auth->getGroupByName($name);
153
    }
154
155
    /**
156
     * Get an array of Auth\User from a filtered set
157
     *
158
     * @param Data\Filter|boolean $filter The filter conditions or false to retreive all
159
     * @param array|boolean $select The user fields to obtain or false to obtain all
160
     * @param integer|boolean $top The number of users to obtain or false to obtain all
161
     * @param integer|boolean $skip The number of users to skip or false to skip none
162
     * @param array|boolean $orderby The field to sort by and the method to sort or false to not sort
163
     * @param string|boolean $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
164
     *
165
     * @return array|boolean An array of Auth\User objects or false if no users were found
166
     */
167 View Code Duplication
    public function getUsersByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false, $methodName = false)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
168
    {
169
        if($methodName === false)
170
        {
171
            return $this->callOnEach('getUsersByFilter', array($filter, $select, $top, $skip, $orderby), 'current', false, array($this, 'mergeResult'));
0 ignored issues
show
Bug Best Practice introduced by
The return type of return $this->callOnEach...$this, 'mergeResult')); (Auth\Group|Auth\User|false) is incompatible with the return type documented by AuthProvider::getUsersByFilter of type array|boolean.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
172
        }
173
        $auth = $this->getMethodByName($methodName);
0 ignored issues
show
It seems like $methodName defined by parameter $methodName on line 167 can also be of type boolean; however, Provider::getMethodByName() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
174
        return $auth->getUsersByFilter($filter, $select, $top, $skip, $orderby);
175
    }
176
177
    /**
178
     * Get an array of Auth\PendingUser from a filtered set
179
     *
180
     * @param Data\Filter|boolean $filter The filter conditions or false to retreive all
181
     * @param array|boolean $select The user fields to obtain or false to obtain all
182
     * @param integer|boolean $top The number of users to obtain or false to obtain all
183
     * @param integer|boolean $skip The number of users to skip or false to skip none
184
     * @param array|boolean $orderby The field to sort by and the method to sort or false to not sort
185
     * @param string|boolean $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
186
     *
187
     * @return array|boolean An array of Auth\PendingUser objects or false if no pending users were found
188
     */
189 View Code Duplication
    public function getPendingUsersByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false, $methodName = false)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
190
    {
191
        if($methodName === false)
192
        {
193
            return $this->callOnEach('getPendingUsersByFilter', array($filter, $select, $top, $skip, $orderby), 'pending', false, array($this, 'mergeResult'));
0 ignored issues
show
Bug Best Practice introduced by
The return type of return $this->callOnEach...$this, 'mergeResult')); (Auth\Group|Auth\User|false) is incompatible with the return type documented by AuthProvider::getPendingUsersByFilter of type array|boolean.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
194
        }
195
        $auth = $this->getMethodByName($methodName);
0 ignored issues
show
It seems like $methodName defined by parameter $methodName on line 189 can also be of type boolean; however, Provider::getMethodByName() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
196
        return $auth->getPendingUsersByFilter($filter, $select, $top, $skip, $orderby);
197
    }
198
199
    /**
200
     * Get an array of Auth\Group from a filtered set
201
     *
202
     * @param Data\Filter|false $filter The filter conditions or false to retreive all
203
     * @param array|false $select The group fields to obtain or false to obtain all
204
     * @param integer|false $top The number of groups to obtain or false to obtain all
205
     * @param integer|false $skip The number of groups to skip or false to skip none
206
     * @param array|false $orderby The field to sort by and the method to sort or false to not sort
207
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
208
     *
209
     * @return array|false An array of Auth\Group objects or false if no pending users were found
210
     */
211 View Code Duplication
    public function getGroupsByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false, $methodName = false)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
212
    {
213
        if($methodName === false)
214
        {
215
            return $this->callOnEach('getGroupsByFilter', array($filter, $select, $top, $skip, $orderby), 'current', false, array($this, 'mergeResult'));
0 ignored issues
show
Bug Best Practice introduced by
The return type of return $this->callOnEach...$this, 'mergeResult')); (Auth\Group|Auth\User|false) is incompatible with the return type documented by AuthProvider::getGroupsByFilter of type array|false.

If you return a value from a function or method, it should be a sub-type of the type that is given by the parent type f.e. an interface, or abstract method. This is more formally defined by the Lizkov substitution principle, and guarantees that classes that depend on the parent type can use any instance of a child type interchangably. This principle also belongs to the SOLID principles for object oriented design.

Let’s take a look at an example:

class Author {
    private $name;

    public function __construct($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }
}

abstract class Post {
    public function getAuthor() {
        return 'Johannes';
    }
}

class BlogPost extends Post {
    public function getAuthor() {
        return new Author('Johannes');
    }
}

class ForumPost extends Post { /* ... */ }

function my_function(Post $post) {
    echo strtoupper($post->getAuthor());
}

Our function my_function expects a Post object, and outputs the author of the post. The base class Post returns a simple string and outputting a simple string will work just fine. However, the child class BlogPost which is a sub-type of Post instead decided to return an object, and is therefore violating the SOLID principles. If a BlogPost were passed to my_function, PHP would not complain, but ultimately fail when executing the strtoupper call in its body.

Loading history...
216
        }
217
        $auth = $this->getMethodByName($methodName);
218
        return $auth->getGroupsByFilter($filter, $select, $top, $skip, $orderby);
219
    }
220
221
    /**
222
     * Get the number of currently active users on the system
223
     *
224
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
225
     *
226
     * @return integer The number of currently active users on the system
227
     */
228
    public function getActiveUserCount($methodName = false)
229
    {
230
        if($methodName === false)
231
        {
232
            return $this->addFromEach('getActiveUserCount', 'current');
233
        }
234
        $auth = $this->getMethodByName($methodName);
235
        return $auth->getActiveUserCount();
236
    }
237
238
    /**
239
     * Get the number of currently pending users on the system
240
     *
241
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
242
     *
243
     * @return integer The number of currently pending users on the system
244
     */
245
    public function getPendingUserCount($methodName = false)
246
    {
247
        if($methodName === false)
248
        {
249
            return $this->addFromEach('getPendingUserCount', 'pending');
250
        }
251
        $auth = $this->getMethodByName($methodName);
252
        return $auth->getPendingUserCount();
253
    }
254
255
    /**
256
     * Get the number of current groups on the system
257
     *
258
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
259
     *
260
     * @return integer The number of current groups on the system
261
     */
262
    public function getGroupCount($methodName = false)
263
    {
264
        if($methodName === false)
265
        {
266
            return $this->addFromEach('getGroupCount', 'current');
267
        }
268
        $auth = $this->getMethodByName($methodName);
269
        return $auth->getGroupCount();
270
    }
271
272
    /**
273
     * Get the login links for all supplementary Authenitcation mechanisms
274
     *
275
     * This will return an array of links to any supplementary authentication mechanims. For example, Goodle is 
276
     * a supplementary authentication mechanism.
277
     *
278
     * @return array An array of suppmentary authentication mechanism links
279
     */
280
    public function getSupplementaryLinks()
281
    {
282
        $ret = array();
283
        $count = count($this->methods);
284 View Code Duplication
        for($i = 0; $i < $count; $i++)
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
285
        {
286
            if($this->methods[$i]->supplement === false)
287
            {
288
                continue;
289
            }
290
291
            array_push($ret, $this->methods[$i]->getSupplementLink());
292
        }
293
        return $ret;
294
    }
295
296
    /**
297
     * Impersonate the user specified
298
     *
299
     * This will replace the user in the session with the specified user. In order
300
     * to undo this operation a user must logout.
301
     *
302
     * @param array|Auth\User $userArray Data representing the user
303
     */
304
    public function impersonateUser($userArray)
305
    {
306
        if(!is_object($userArray))
307
        {
308
            $userArray = new $userArray['class']($userArray);
309
        }
310
        \FlipSession::setUser($userArray);
311
    }
312
313
    /**
314
     * Get the pending user reresented by the supplied hash
315
     *
316
     * @param string $hash The hash value representing the Penging User
317
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
318
     *
319
     * @return Auth\PendingUser|false The Auth\PendingUser instance or false if no user is matched by the provided hash
320
     */
321
    public function getTempUserByHash($hash, $methodName = false)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
322
    {
323
        if($methodName === false)
324
        {
325
            return $this->callOnEach('getTempUserByHash', array($hash), 'pending');
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->callOnEach('getTe...ray($hash), 'pending'); of type Auth\Group|Auth\User|false adds the type Auth\Group to the return on line 325 which is incompatible with the return type documented by AuthProvider::getTempUserByHash of type Auth\PendingUser|false.
Loading history...
326
        }
327
        $auth = $this->getMethodByName($methodName);
328
        return $auth->getTempUserByHash($hash);
329
    }
330
331
    /**
332
     * Create a pending user
333
     *
334
     * @param array $user An array of information about the user to create
335
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
336
     *
337
     * @return boolean true if the user was successfully created. Otherwise false.
338
     */
339
    public function createPendingUser($user, $methodName = false)
340
    {
341
        if($methodName === false)
342
        {
343
            $count = count($this->methods);
344
            for($i = 0; $i < $count; $i++)
345
            {
346
                if($this->methods[$i]->pending === false)
347
                {
348
                    continue;
349
                }
350
351
                $ret = $this->methods[$i]->createPendingUser($user);
352
                if($ret !== false)
353
                {
354
                    return true;
355
                }
356
            }
357
            return false;
358
        }
359
        $auth = $this->getMethodByName($methodName);
360
        return $auth->createPendingUser($user);
361
    }
362
363
    /**
364
     * Convert a Auth\PendingUser into an Auth\User
365
     *
366
     * This will allow a previously pending user the ability to log on in the future as an active user. It will also
367
     * have the side effect of logging the user on now.
368
     *
369
     * @param Auth\PendingUser $user The user to turn into a current user
370
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
371
     *
372
     * @return boolean true if the user was successfully created. Otherwise false.
373
     */
374
    public function activatePendingUser($user, $methodName = false)
375
    {
376
        if($methodName === false)
377
        {
378
            $count = count($this->methods);
379
            for($i = 0; $i < $count; $i++)
380
            {
381
                if($this->methods[$i]->current === false)
382
                {
383
                    continue;
384
                }
385
386
                $ret = $this->methods[$i]->activatePendingUser($user);
387
                if($ret !== false)
388
                {
389
                    $this->impersonateUser($ret);
390
                    return true;
391
                }
392
            }
393
            return false;
394
        }
395
        $auth = $this->getMethodByName($methodName);
396
        return $auth->activatePendingUser($user);
397
    }
398
399
    /**
400
     * Get a current user by a password reset hash
401
     *
402
     * @param string $hash The current password reset hash for the user
403
     * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
404
     *
405
     * @return Auth\User|false The user if the password reset hash is valid. Otherwise false.
406
     */
407
    public function getUserByResetHash($hash, $methodName = false)
408
    {
409
        if($methodName === false)
410
        {
411
            return $this->callOnEach('getUserByResetHash', array($hash), 'current');
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->callOnEach('getUs...ray($hash), 'current'); of type Auth\Group|Auth\User|false adds the type Auth\Group to the return on line 411 which is incompatible with the return type documented by AuthProvider::getUserByResetHash of type Auth\User|false.
Loading history...
412
        }
413
        $auth = $this->getMethodByName($methodName);
414
        if($auth === false)
415
        {
416
            return $this->getUserByResetHash($hash, false);
417
        }
418
        return $auth->getUserByResetHash($hash);
419
    }
420
421
    /**
422
     * Get the Auth\Authenticator by host name
423
     *
424
     * @param string $host The host name used by the supplemental authentication mechanism
425
     *
426
     * @return Auth\Authenticator|false The Authenticator if the host is supported by a loaded Authenticator. Otherwise false.
427
     */
428
    public function getSuplementalProviderByHost($host)
429
    {
430
        $count = count($this->methods);
431 View Code Duplication
        for($i = 0; $i < $count; $i++)
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
432
        {
433
            if($this->methods[$i]->supplement === false)
434
            {
435
                continue;
436
            }
437
438
            if($this->methods[$i]->getHostName() === $host)
439
            {
440
                return $this->methods[$i];
441
            }
442
        }
443
        return false;
444
    }
445
446
    /**
447
     * Delete any pending users that match the filter
448
     *
449
     * @param \Data\Filter|boolean $filter The filter to delete with or false to delete all
450
     * @param string|boolean $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
451
     *
452
     * @return boolean True if the users were deleted, false otherwise
453
     */
454
    public function deletePendingUsersByFilter($filter, $methodName = false)
455
    {
456
        $users = $this->getPendingUsersByFilter($filter, false, false, false, false, $methodName);
457
        if($users === false)
458
        {
459
            return false;
460
        }
461
        $count = count($users);
462
        for($i = 0; $i < $count; $i++)
463
        {
464
            $users[$i]->delete();
465
        }
466
        return true;
467
    }
468
469
    /**
470
     * Get the user by the one time access code
471
     *
472
     * @param string $key The user's access code
473
     * @param string|boolean $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator
474
     *
475
     * @return boolean|\Auth\User The User specified by the access code or false otherwise
476
     */
477
    public function getUserByAccessCode($key, $methodName = false)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
478
    {
479
        if($methodName === false)
480
        {
481
            return $this->callOnEach('getUserByAccessCode', array($key), 'current');
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->callOnEach('getUs...rray($key), 'current'); of type Auth\Group|Auth\User|false adds the type Auth\Group to the return on line 481 which is incompatible with the return type documented by AuthProvider::getUserByAccessCode of type boolean|Auth\User.
Loading history...
482
        }
483
        $auth = $this->getMethodByName($methodName);
0 ignored issues
show
It seems like $methodName defined by parameter $methodName on line 477 can also be of type boolean; however, Provider::getMethodByName() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
484
        return $auth->getUserByAccessCode($key);
485
    }
486
}
487
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
488