Passed
Pull Request — master (#4390)
by Owen
13:00
created

CustomFunction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fourthPower() 0 9 2
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