1 | <?php |
||
13 | class HttpLogger |
||
14 | { |
||
15 | protected $logProfile; |
||
16 | protected $logWriter; |
||
17 | |||
18 | public function __construct(LogProfile $logProfile, LogWriter $logWriter, logResponseProfile $logResponseProfile, logResponseWriter $logResponseWriter) |
||
25 | |||
26 | public function handle(Request $request, Closure $next) |
||
34 | |||
35 | public function terminate(Request $request, Response $response) |
||
41 | } |
||
42 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: