MissingValueException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
eloc 5
c 1
b 1
f 1
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFieldName() 0 3 1
1
<?php
2
3
4
namespace Apie\TypeJuggling\Exceptions;
5
6
use Apie\Core\Exceptions\ApieException;
7
use Apie\Core\Exceptions\FieldNameAwareInterface;
8
9
/**
10
 * Error thrown if a value is missing in the array.
11
 */
12
class MissingValueException extends ApieException implements FieldNameAwareInterface
13
{
14
    private $fieldName;
15
16
    public function __construct(string $fieldName)
17
    {
18
        $this->fieldName = $fieldName;
19
        parent::__construct(422, 'Value missing for field name "' . $fieldName . '"');
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getFieldName(): string
26
    {
27
        return $this->fieldName;
28
    }
29
}
30