GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c80709...02f185 )
by Rémi
19:02 queued 07:27
created

UnanimousQuorum::isMet()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 3
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace RemiSan\Lock\Quorum;
4
5
use RemiSan\Lock\Quorum;
6
7
class UnanimousQuorum implements Quorum
8
{
9
    /**
10
     * @var int
11
     */
12
    private $quorum;
13
14
    /**
15
     * @inheritDoc
16
     */
17
    public function init($totalNumber)
18
    {
19
        if ($totalNumber < 1) {
20
            throw new \InvalidArgumentException();
21
        }
22
23
        $this->quorum = $totalNumber;
24
    }
25
26
    /**
27
     * @inheritDoc
28
     */
29
    public function isMet($numberOfSuccess)
30
    {
31
        if ($numberOfSuccess < 0 ||
32
            $numberOfSuccess > $this->quorum) {
33
            throw new \InvalidArgumentException();
34
        }
35
36
        return $numberOfSuccess >= $this->quorum;
37
    }
38
}
39