TranslationsNotFoundException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace steevanb\DevBundle\Exception;
6
7
class TranslationsNotFoundException extends \Exception
8
{
9
    public function __construct(array $messages)
10
    {
11
        $missings = array();
12
        foreach ($messages as $message) {
13
            $missing = '[ id : ' . $message['id'] . ', ';
14
            $missing .= 'domain : ' . $message['domain'] . ', ';
15
            $missing .= 'locale : ' . $message['locale'] . ' ]';
16
17
            $missings[] = $missing;
18
        }
19
20
        parent::__construct('Translations not found : ' . implode(', ', $missings));
21
    }
22
}
23