Completed
Push — master ( 2683bd...cf87f7 )
by Jordan
21s queued 13s
created

CeilAdapter::determineCarry()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3.072

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 4
c 1
b 0
f 0
nc 3
nop 2
dl 0
loc 6
ccs 4
cts 5
cp 0.8
crap 3.072
rs 10
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
}