Code Duplication    Length = 3-5 lines in 2 locations

src/PhpSpreadsheet/Calculation/DateTime.php 1 location

@@ 1234-1238 (lines=5) @@
1231
        $dateValue = Functions::flattenSingleValue($dateValue);
1232
        $method = Functions::flattenSingleValue($method);
1233
1234
        if (!is_numeric($method)) {
1235
            return Functions::VALUE();
1236
        } elseif (($method < 1) || ($method > 2)) {
1237
            return Functions::NAN();
1238
        }
1239
        $method = floor($method);
1240
1241
        if ($dateValue === null) {

src/PhpSpreadsheet/Calculation/MathTrig.php 1 location

@@ 917-919 (lines=3) @@
914
    {
915
        $aValue = Functions::flattenSingleValue($aValue);
916
        $style = (is_null($style))    ? 0 :    (integer) Functions::flattenSingleValue($style);
917
        if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) {
918
            return Functions::VALUE();
919
        }
920
        $aValue = (integer) $aValue;
921
        if ($aValue == 0) {
922
            return '';