Code Duplication    Length = 26-26 lines in 2 locations

src/PhpSpreadsheet/Calculation/Statistical.php 2 locations

@@ 2294-2319 (lines=26) @@
2291
     *
2292
     * @return float
2293
     */
2294
    public static function MAXA(...$args)
2295
    {
2296
        $returnValue = null;
2297
2298
        // Loop through arguments
2299
        $aArgs = Functions::flattenArray($args);
2300
        foreach ($aArgs as $arg) {
2301
            // Is it a numeric value?
2302
            if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
2303
                if (is_bool($arg)) {
2304
                    $arg = (int) $arg;
2305
                } elseif (is_string($arg)) {
2306
                    $arg = 0;
2307
                }
2308
                if ((is_null($returnValue)) || ($arg > $returnValue)) {
2309
                    $returnValue = $arg;
2310
                }
2311
            }
2312
        }
2313
2314
        if (is_null($returnValue)) {
2315
            return 0;
2316
        }
2317
2318
        return $returnValue;
2319
    }
2320
2321
    /**
2322
     * MAXIF.
@@ 2457-2482 (lines=26) @@
2454
     *
2455
     * @return float
2456
     */
2457
    public static function MINA(...$args)
2458
    {
2459
        $returnValue = null;
2460
2461
        // Loop through arguments
2462
        $aArgs = Functions::flattenArray($args);
2463
        foreach ($aArgs as $arg) {
2464
            // Is it a numeric value?
2465
            if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
2466
                if (is_bool($arg)) {
2467
                    $arg = (int) $arg;
2468
                } elseif (is_string($arg)) {
2469
                    $arg = 0;
2470
                }
2471
                if ((is_null($returnValue)) || ($arg < $returnValue)) {
2472
                    $returnValue = $arg;
2473
                }
2474
            }
2475
        }
2476
2477
        if (is_null($returnValue)) {
2478
            return 0;
2479
        }
2480
2481
        return $returnValue;
2482
    }
2483
2484
    /**
2485
     * MINIF.