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\Shared\Trend; us..
Decoded Output download
<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Shared\Trend;
use PhpOffice\PhpSpreadsheet\Shared\Trend\ExponentialBestFit;
use PHPUnit\Framework\TestCase;
class ExponentialBestFitTest extends TestCase
{
/**
* @dataProvider providerExponentialBestFit
*
* @param array<float> $yValues
* @param array<float> $xValues
*/
public function testExponentialBestFit(
array $expectedSlope,
array $expectedIntersect,
array $expectedGoodnessOfFit,
mixed $expectedEquation,
array $yValues,
array $xValues
): void {
$bestFit = new ExponentialBestFit($yValues, $xValues);
$slope = $bestFit->getSlope(1);
self::assertEquals($expectedSlope[0], $slope);
$slope = $bestFit->getSlope();
self::assertEquals($expectedSlope[1], $slope);
$intersect = $bestFit->getIntersect(1);
self::assertEquals($expectedIntersect[0], $intersect);
$intersect = $bestFit->getIntersect();
self::assertEquals($expectedIntersect[1], $intersect);
$equation = $bestFit->getEquation(2);
self::assertEquals($expectedEquation, $equation);
self::assertSame($expectedGoodnessOfFit[0], $bestFit->getGoodnessOfFit(6));
self::assertSame($expectedGoodnessOfFit[1], $bestFit->getGoodnessOfFit());
}
public static function providerExponentialBestFit(): array
{
return require 'tests/data/Shared/Trend/ExponentialBestFit.php';
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Shared\Trend;
use PhpOffice\PhpSpreadsheet\Shared\Trend\ExponentialBestFit;
use PHPUnit\Framework\TestCase;
class ExponentialBestFitTest extends TestCase
{
/**
* @dataProvider providerExponentialBestFit
*
* @param array<float> $yValues
* @param array<float> $xValues
*/
public function testExponentialBestFit(
array $expectedSlope,
array $expectedIntersect,
array $expectedGoodnessOfFit,
mixed $expectedEquation,
array $yValues,
array $xValues
): void {
$bestFit = new ExponentialBestFit($yValues, $xValues);
$slope = $bestFit->getSlope(1);
self::assertEquals($expectedSlope[0], $slope);
$slope = $bestFit->getSlope();
self::assertEquals($expectedSlope[1], $slope);
$intersect = $bestFit->getIntersect(1);
self::assertEquals($expectedIntersect[0], $intersect);
$intersect = $bestFit->getIntersect();
self::assertEquals($expectedIntersect[1], $intersect);
$equation = $bestFit->getEquation(2);
self::assertEquals($expectedEquation, $equation);
self::assertSame($expectedGoodnessOfFit[0], $bestFit->getGoodnessOfFit(6));
self::assertSame($expectedGoodnessOfFit[1], $bestFit->getGoodnessOfFit());
}
public static function providerExponentialBestFit(): array
{
return require 'tests/data/Shared/Trend/ExponentialBestFit.php';
}
}
Function Calls
None |
Stats
MD5 | d086488a653fe8f4b5374583ba539122 |
Eval Count | 0 |
Decode Time | 70 ms |