Ensure::positiveIntegerOrZero()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
/**
3
 * @author Boris Guéry <[email protected]>
4
 */
5
6
namespace Bgy\OAuth2\Utils;
7
8
class Ensure extends Assertion
9
{
10
    public static function positiveIntegerOrZero($value, $message = null, $propertyPath = null)
11
    {
12
        \Assert\that($value, $message, $propertyPath)
13
            ->integer()
14
            ->min(0)
15
        ;
16
    }
17
18
    public static function positiveInteger($value, $message = null, $propertyPath = null)
19
    {
20
        \Assert\that($value, $message, $propertyPath)
21
            ->integer()
22
            ->min(1);
23
    }
24
}
25