Completed
Push — master ( 3ef8ec...6ec2cc )
by
unknown
40s queued 31s
created

CustomFunction::fourthPower()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
6
7
use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcException;
8
use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Helpers;
9
10
class CustomFunction
11
{
12
    public static function fourthPower(mixed $number): float|int|string
13
    {
14
        try {
15
            $number = Helpers::validateNumericNullBool($number);
16
        } catch (CalcException $e) {
17
            return $e->getMessage();
18
        }
19
20
        return $number ** 4;
21
    }
22
}
23