Passed
Pull Request — master (#135)
by Jordan
05:57
created

CeilAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 12
ccs 4
cts 5
cp 0.8
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A determineCarry() 0 6 3
1
<?php
2
3
namespace Samsara\Fermat\Provider\RoundingModeAdapters\Modes;
4
5
/**
6
 *
7
 */
8
class CeilAdapter extends BaseAdapter
9
{
10
11
    /**
12
     * @inheritDoc
13
     */
14 310
    public function determineCarry(int $digit, int $nextDigit): int
15
    {
16 310
        if ($this->isNegative) {
17 1
            return 0;
18
        } else {
19 310
            return $digit == 0 ? 0 : 1;
20
        }
21
    }
22
}