Code Duplication    Length = 3-5 lines in 2 locations

src/PhpSpreadsheet/Calculation/DateTime.php 1 location

@@ 1258-1262 (lines=5) @@
1255
        $dateValue = Functions::flattenSingleValue($dateValue);
1256
        $method = Functions::flattenSingleValue($method);
1257
1258
        if (!is_numeric($method)) {
1259
            return Functions::VALUE();
1260
        } elseif (($method < 1) || ($method > 2)) {
1261
            return Functions::NAN();
1262
        }
1263
        $method = floor($method);
1264
1265
        if ($dateValue === null) {

src/PhpSpreadsheet/Calculation/MathTrig.php 1 location

@@ 895-897 (lines=3) @@
892
    {
893
        $aValue = Functions::flattenSingleValue($aValue);
894
        $style = ($style === null) ? 0 : (int) Functions::flattenSingleValue($style);
895
        if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) {
896
            return Functions::VALUE();
897
        }
898
        $aValue = (int) $aValue;
899
        if ($aValue == 0) {
900
            return '';