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\Database;
use PhpOffice\PhpSpreadsheet\Calculation\Database\DStDev;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DStDevTest extends SetupTeardownDatabases
{
/**
* @dataProvider providerDStDev
*/
public function testDirectCallToDStDev(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DStDev::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
/**
* @dataProvider providerDStDev
*/
public function testDStDevAsWorksheetFormula(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DSTDEV', $database, $field, $criteria);
$result = $this->getSheet()->getCell(self::RESULT_CELL)->getCalculatedValue();
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
public static function providerDStDev(): array
{
return [
[
2.966479394838,
self::database1(),
'Yield',
[
['Tree'],
['=Apple'],
['=Pear'],
],
],
[
0.104403065089,
self::database3FilledIn(),
'Score',
[
['Subject', 'Gender'],
['English', 'Male'],
],
],
[
0.196723155729,
self::database3FilledIn(),
'Score',
[
['Subject', 'Age'],
['Math', '>8'],
],
],
'omitted field name' => [
ExcelError::VALUE(),
self::database1(),
null,
self::database1(),
],
];
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Database;
use PhpOffice\PhpSpreadsheet\Calculation\Database\DStDev;
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DStDevTest extends SetupTeardownDatabases
{
/**
* @dataProvider providerDStDev
*/
public function testDirectCallToDStDev(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DStDev::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
/**
* @dataProvider providerDStDev
*/
public function testDStDevAsWorksheetFormula(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DSTDEV', $database, $field, $criteria);
$result = $this->getSheet()->getCell(self::RESULT_CELL)->getCalculatedValue();
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
public static function providerDStDev(): array
{
return [
[
2.966479394838,
self::database1(),
'Yield',
[
['Tree'],
['=Apple'],
['=Pear'],
],
],
[
0.104403065089,
self::database3FilledIn(),
'Score',
[
['Subject', 'Gender'],
['English', 'Male'],
],
],
[
0.196723155729,
self::database3FilledIn(),
'Score',
[
['Subject', 'Age'],
['Math', '>8'],
],
],
'omitted field name' => [
ExcelError::VALUE(),
self::database1(),
null,
self::database1(),
],
];
}
}
Function Calls
None |
Stats
MD5 | c27ebb6128fd3b159bd03b1aa3b5260f |
Eval Count | 0 |
Decode Time | 86 ms |