MissingValueException::getFieldName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 1
c 1
b 1
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
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