1 | <?php |
||
19 | class CreateFluentLogger |
||
20 | { |
||
21 | /** |
||
22 | * @var Application |
||
23 | */ |
||
24 | private $app; |
||
25 | |||
26 | /** |
||
27 | * The Log levels. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $levels = [ |
||
32 | 'debug' => Logger::DEBUG, |
||
33 | 'info' => Logger::INFO, |
||
34 | 'notice' => Logger::NOTICE, |
||
35 | 'warning' => Logger::WARNING, |
||
36 | 'error' => Logger::ERROR, |
||
37 | 'critical' => Logger::CRITICAL, |
||
38 | 'alert' => Logger::ALERT, |
||
39 | 'emergency' => Logger::EMERGENCY, |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * CreateFluentLogger constructor. |
||
44 | * |
||
45 | * @param Application $app |
||
46 | */ |
||
47 | public function __construct(Application $app) |
||
51 | |||
52 | /** |
||
53 | * Create a custom Monolog instance. |
||
54 | * |
||
55 | * @param array $config |
||
56 | * |
||
57 | * @return \Monolog\Logger |
||
58 | */ |
||
59 | public function __invoke(array $config) : Logger |
||
86 | |||
87 | /** |
||
88 | * Prepare the handler for usage by Monolog. |
||
89 | * |
||
90 | * @param \Monolog\Handler\HandlerInterface $handler |
||
91 | * |
||
92 | * @return \Monolog\Handler\HandlerInterface |
||
93 | */ |
||
94 | protected function prepareHandler(HandlerInterface $handler): HandlerInterface |
||
98 | |||
99 | /** |
||
100 | * Get a Monolog formatter instance. |
||
101 | * |
||
102 | * @return \Monolog\Formatter\FormatterInterface |
||
103 | */ |
||
104 | protected function formatter() : FormatterInterface |
||
110 | |||
111 | /** |
||
112 | * Parse the string level into a Monolog constant. |
||
113 | * |
||
114 | * @param array $config |
||
|
|||
115 | * |
||
116 | * @throws \InvalidArgumentException |
||
117 | * |
||
118 | * @return int |
||
119 | */ |
||
120 | protected function level(string $level) : int |
||
130 | } |
||
131 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.