Completed
Push — master ( a03250...475c1c )
by Steevan
02:25
created

TranslationsNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 2
1
<?php
2
3
namespace steevanb\DevBundle\Exception;
4
5
class TranslationsNotFoundException extends \Exception
6
{
7
    /**
8
     * @param array $messages
9
     */
10
    public function __construct(array $messages)
11
    {
12
        $missings = array();
13
        foreach ($messages as $message) {
14
            $missing = '[ id : ' . $message['id'] . ', ';
15
            $missing .= 'domain : ' . $message['domain'] . ', ';
16
            $missing .= 'locale : ' . $message['locale'] . ' ]';
17
18
            $missings[] = $missing;
19
        }
20
21
        parent::__construct('Translations not found : ' . implode(', ', $missings));
22
    }
23
}
24