Ensure   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 2
c 3
b 0
f 1
lcom 0
cbo 2
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A positiveIntegerOrZero() 0 7 1
A positiveInteger() 0 6 1
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