1 | <?php declare(strict_types=1); |
||
11 | final class GitLoggerEventSubscriber implements EventSubscriberInterface, LoggerAwareInterface |
||
12 | { |
||
13 | /** |
||
14 | * Mapping of event to log level. |
||
15 | * |
||
16 | * @var string[] |
||
17 | */ |
||
18 | private $logLevelMappings = [ |
||
19 | GitEvents::GIT_PREPARE => LogLevel::INFO, |
||
20 | GitEvents::GIT_OUTPUT => LogLevel::DEBUG, |
||
21 | GitEvents::GIT_SUCCESS => LogLevel::INFO, |
||
22 | GitEvents::GIT_ERROR => LogLevel::ERROR, |
||
23 | GitEvents::GIT_BYPASS => LogLevel::INFO, |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * @var LoggerInterface |
||
28 | */ |
||
29 | private $logger; |
||
30 | |||
31 | public function __construct(LoggerInterface $logger) |
||
35 | |||
36 | /** |
||
37 | * {@inheritDoc} |
||
38 | */ |
||
39 | public function setLogger(LoggerInterface $logger): void |
||
43 | |||
44 | public function getLogger(): LoggerInterface |
||
48 | |||
49 | public function setLogLevelMapping(string $eventName, string $logLevel): void |
||
53 | |||
54 | /** |
||
55 | * Returns the log level mapping for an event. |
||
56 | */ |
||
57 | public function getLogLevelMapping(string $eventName): string |
||
65 | |||
66 | /** |
||
67 | * {@inheritDoc} |
||
68 | */ |
||
69 | public static function getSubscribedEvents() |
||
79 | |||
80 | /** |
||
81 | * Adds a log message using the level defined in the mappings. |
||
82 | * |
||
83 | * @param mixed[] $context |
||
84 | */ |
||
85 | public function log(GitEvent $gitEvent, string $message, array $context = [], ?string $eventName = null): void |
||
96 | |||
97 | public function onPrepare(GitEvent $gitEvent, ?string $eventName = null): void |
||
101 | |||
102 | public function handleOutput(GitOutputEvent $gitOutputEvent, ?string $eventName = null): void |
||
107 | |||
108 | public function onSuccess(GitEvent $gitEvent, ?string $eventName = null): void |
||
112 | |||
113 | public function onError(GitEvent $gitEvent, ?string $eventName = null): void |
||
117 | |||
118 | public function onBypass(GitEvent $gitEvent, ?string $eventName = null): void |
||
122 | } |
||
123 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.