1 | <?php |
||
16 | class AuthenticationService implements Authenticator |
||
17 | { |
||
18 | protected $server; |
||
19 | |||
20 | /** |
||
21 | * AuthenticationService constructor. |
||
22 | * |
||
23 | * @param ResourceServer|null $server Optional resource server. |
||
24 | */ |
||
25 | public function __construct(ResourceServer $server = null) |
||
29 | |||
30 | /** |
||
31 | * Authenticate the request. Returns modified request (probably not as SS doesn't support |
||
32 | * request attributes). |
||
33 | * |
||
34 | * @param HTTPRequest $request The SilverStripe request object to be authenticated. |
||
35 | * |
||
36 | * @return HTTPRequest |
||
37 | * @throws AuthenticationException |
||
38 | */ |
||
39 | public function authenticate(HTTPRequest $request): HTTPRequest |
||
77 | |||
78 | /** |
||
79 | * Override the default ResourceServer. |
||
80 | * |
||
81 | * @param ResourceServer $v The new ResourceServer to use. |
||
82 | * |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function setServer(ResourceServer $v): Authenticator |
||
90 | |||
91 | /** |
||
92 | * Get the ResourceServer. |
||
93 | * |
||
94 | * @return ResourceServer |
||
95 | */ |
||
96 | public function getServer(): ResourceServer |
||
100 | |||
101 | /** |
||
102 | * Create a default ResourceServer. Used if one isn't provided. |
||
103 | * |
||
104 | * @return ResourceServer |
||
105 | */ |
||
106 | protected function createServer(): ResourceServer |
||
120 | } |
||
121 |
This check looks at variables that 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.