Conditions | 4 |
Paths | 4 |
Total Lines | 28 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
82 | public function get($event, $supportedOnly = true) |
||
83 | { |
||
84 | $config = isset($this->config[$event]) |
||
85 | ? array_values($this->config[$event]) : []; |
||
86 | |||
87 | if ($supportedOnly) { |
||
88 | $config = array_filter( |
||
89 | $config, |
||
90 | function (ActionInterface $action) { |
||
91 | try { |
||
92 | $action->checkSupport(); |
||
93 | |||
94 | return true; |
||
95 | } catch (\Exception $ex) { |
||
96 | $this->logger->warning( |
||
97 | sprintf( |
||
98 | '%s is not supported: %s.', |
||
99 | $action->getName(), |
||
100 | $ex->getMessage() |
||
101 | ) |
||
102 | ); |
||
103 | } |
||
104 | } |
||
105 | ); |
||
106 | } |
||
107 | |||
108 | return $config; |
||
109 | } |
||
110 | } |
||
111 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.