GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( 33d8a9...f5a8bd )
by Andrey
32:16 queued 16:52
created

ValidationException::getMessages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * (c) itmedia.by <[email protected]>
5
 */
6
7
namespace Itmedia\CommandBusBundle\Exception;
8
9
use Symfony\Component\Translation\TranslatorInterface;
10
use Symfony\Component\Validator\ConstraintViolation;
11
use Symfony\Component\Validator\ConstraintViolationInterface;
12
use Symfony\Component\Validator\ConstraintViolationListInterface;
13
14
class ValidationException extends \RuntimeException
15
{
16
    protected $messages = [];
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function __construct(array $messages, $code = 400, \Exception $previous = null)
22
    {
23
        $this->messages = $messages;
24
        parent::__construct(count($messages) ? reset($this->messages) : '', $code, $previous);
25
    }
26
27
28
    /**
29
     * @param ConstraintViolationListInterface $vilations
0 ignored issues
show
Bug introduced by
There is no parameter named $vilations. Was it maybe removed?

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 method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
30
     * @return ValidationException
31
     */
32
    public static function createFromConstraintViolationList(ConstraintViolationListInterface $list): self
33
    {
34
        $messages = [];
35
        /**
36
         * @var ConstraintViolationInterface $violation
37
         */
38
        foreach ($list as $violation) {
39
            $messages[$violation->getPropertyPath()] = $violation->getMessage();
40
        }
41
42
        return new self($messages);
43
    }
44
45
46
    /**
47
     * @return array
48
     */
49
    public function getMessages()
50
    {
51
        return $this->messages;
52
    }
53
54
55
    /**
56
     * Переведенные сообщения об ошибках
57
     *
58
     * @param TranslatorInterface $translator
59
     * @return array
60
     *
61
     * @throws \Exception
62
     */
63
    public function getTranslatedMessages(TranslatorInterface $translator)
64
    {
65
        $result = [];
66
        foreach ($this->messages as $key => $message) {
67
            $result[$key] = $translator->trans($message);
68
        }
69
70
        return $result;
71
    }
72
}
73