Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Calculation\Funct..

Decoded Output download

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;

class GcdTest extends AllSetupTeardown
{
    /**
     * @dataProvider providerGCD
     */
    public function testGCD(mixed $expectedResult, mixed ...$args): void
    {
        $this->mightHaveException($expectedResult);
        $sheet = $this->getSheet();
        $row = 0;
        foreach ($args as $arg) {
            ++$row;
            if ($arg !== null) {
                $sheet->getCell("A$row")->setValue($arg);
            }
        }
        if ($row < 1) {
            $sheet->getCell('B1')->setValue('=GCD()');
        } else {
            $sheet->getCell('B1')->setValue("=GCD(A1:A$row)");
        }
        $result = $sheet->getCell('B1')->getCalculatedValue();
        self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
    }

    public static function providerGCD(): array
    {
        return require 'tests/data/Calculation/MathTrig/GCD.php';
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;

class GcdTest extends AllSetupTeardown
{
    /**
     * @dataProvider providerGCD
     */
    public function testGCD(mixed $expectedResult, mixed ...$args): void
    {
        $this->mightHaveException($expectedResult);
        $sheet = $this->getSheet();
        $row = 0;
        foreach ($args as $arg) {
            ++$row;
            if ($arg !== null) {
                $sheet->getCell("A$row")->setValue($arg);
            }
        }
        if ($row < 1) {
            $sheet->getCell('B1')->setValue('=GCD()');
        } else {
            $sheet->getCell('B1')->setValue("=GCD(A1:A$row)");
        }
        $result = $sheet->getCell('B1')->getCalculatedValue();
        self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
    }

    public static function providerGCD(): array
    {
        return require 'tests/data/Calculation/MathTrig/GCD.php';
    }
}

Function Calls

None

Variables

None

Stats

MD5 e469a9a538cefeb375e2d6eaa4e092aa
Eval Count 0
Decode Time 95 ms