| Conditions | 16 |
| Paths | 16 |
| Total Lines | 32 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 24 |
| CRAP Score | 16.1164 |
| Changes | 2 | ||
| Bugs | 2 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 48 | 4 | protected function handleErrorException(ErrorException $exception): bool |
|
| 49 | { |
||
| 50 | 4 | switch ($exception->getSeverity()) { |
|
| 51 | 4 | case E_ERROR: |
|
| 52 | 3 | case E_RECOVERABLE_ERROR: |
|
| 53 | 3 | case E_CORE_ERROR: |
|
| 54 | 3 | case E_COMPILE_ERROR: |
|
| 55 | 3 | case E_USER_ERROR: |
|
| 56 | 3 | case E_PARSE: |
|
| 57 | 1 | $this->logger->error($this->buildLogMessage($exception)); |
|
|
|
|||
| 58 | 1 | break; |
|
| 59 | |||
| 60 | 3 | case E_WARNING: |
|
| 61 | 2 | case E_USER_WARNING: |
|
| 62 | 2 | case E_CORE_WARNING: |
|
| 63 | 2 | case E_COMPILE_WARNING: |
|
| 64 | 1 | $this->logger->warning($this->buildLogMessage($exception)); |
|
| 65 | 1 | break; |
|
| 66 | |||
| 67 | 2 | case E_NOTICE: |
|
| 68 | 1 | case E_USER_NOTICE: |
|
| 69 | 1 | $this->logger->notice($this->buildLogMessage($exception)); |
|
| 70 | 1 | break; |
|
| 71 | |||
| 72 | 1 | case E_STRICT: |
|
| 73 | case E_DEPRECATED: |
||
| 74 | case E_USER_DEPRECATED: |
||
| 75 | 1 | $this->logger->info($this->buildLogMessage($exception)); |
|
| 76 | 1 | break; |
|
| 77 | } |
||
| 78 | |||
| 79 | 4 | return true; |
|
| 80 | } |
||
| 95 |
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.