Completed
Push — master ( 2544e2...bb9b3c )
by Mehmet
03:43 queued 01:30
created

DataTypeAbstract::throwException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace Selami\Entity\DataType;
4
5
use InvalidArgumentException;
6
7
abstract class DataTypeAbstract
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $key;
13
    /**
14
     * @var mixed
15
     */
16
    protected $datum;
17
    /**
18
     * @var array
19
     */
20
    protected $options = [];
21
22
    protected $errorMessageTemplate;
23
24
    protected function throwException()
25
    {
26
        $message = sprintf(
27
            $this->errorMessageTemplate,
28
            $this->datum,
29
            $this->key
30
        );
31
        throw new InvalidArgumentException($message);
32
    }
33
}
34