1 | <?php |
||
15 | class RestKernel |
||
16 | { |
||
17 | /** |
||
18 | * @var AdapterInterface |
||
19 | */ |
||
20 | private $adapter; |
||
21 | |||
22 | /** |
||
23 | * @var RestConfiguration |
||
24 | */ |
||
25 | private $config; |
||
26 | |||
27 | /** |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $debug = false; |
||
31 | |||
32 | /** |
||
33 | * Constructor. |
||
34 | * |
||
35 | * @param AdapterInterface $adapter |
||
36 | * @param RestConfiguration $config |
||
37 | */ |
||
38 | public function __construct(AdapterInterface $adapter, RestConfiguration $config) |
||
43 | |||
44 | /** |
||
45 | * Enables/disables debug. |
||
46 | * |
||
47 | * @param bool $debug |
||
48 | * @return self |
||
49 | */ |
||
50 | public function enableDebug($debug = true) |
||
55 | |||
56 | /** |
||
57 | * Processes an incoming Request object, routes it to the adapter, and returns a response. |
||
58 | * |
||
59 | * @param Request $request |
||
60 | * @return Response $response |
||
61 | */ |
||
62 | public function handle(Request $request) |
||
75 | |||
76 | /** |
||
77 | * Whether debug is enabled. |
||
78 | * |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function debugEnabled() |
||
85 | } |
||
86 |
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.