1 | <?php |
||
36 | class Psr7Authenticate extends BaseAuthenticate |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * Authenticates the identity contained in a request. Will use the `config.userModel`, and `config.fields` |
||
41 | * to find POST data that is used to find a matching record in the `config.userModel`. Will return false if |
||
42 | * there is no post data, either username or password is missing, or if the scope conditions have not been met. |
||
43 | * |
||
44 | * @param \Cake\Http\ServerRequest $request The request that contains login information. |
||
45 | * @param \Cake\Http\Response $response Unused response object. |
||
46 | * @return mixed False on login failure. An array of User data on success. |
||
47 | */ |
||
48 | public function authenticate(ServerRequest $request, Response $response) |
||
52 | |||
53 | /** |
||
54 | * Get a user based on information in the request. Primarily used by stateless authentication |
||
55 | * systems like basic and digest auth. |
||
56 | * |
||
57 | * @param \Cake\Http\ServerRequest $request Request object. |
||
58 | * @return mixed Either false or an array of user information |
||
59 | */ |
||
60 | public function getUser(ServerRequest $request) |
||
78 | } |
||
79 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.