SchemaIntegerAttribute::parseContextual()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 2
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Ipag\Sdk\Model\Schema;
4
5
use Ipag\Sdk\Model\Schema\Exception\SchemaAttributeParseException;
6
7
/**
8
 * @codeCoverageIgnore
9
 */
10
class SchemaIntegerAttribute extends SchemaAttribute
11
{
12
    public function parseContextual($value)
13
    {
14
        if (is_integer($value)) {
15
            return $value;
16
        }
17
18
        throw new SchemaAttributeParseException($this, "Provided value '$value' is not an integer");
19
    }
20
}