mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-11 14:27:05 +00:00
641f86dc80
A continuation of PR #3859. Change code that would be flagged if we were to run Phpstan at level 9 (we currently run level 8). I may or may not follow up with source code (454 level-9 problems remain for src), but there is no reason to avoid the effort for samples. No changes are made to src.
27 lines
844 B
PHP
27 lines
844 B
PHP
<?php
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
|
require __DIR__ . '/../../Header.php';
|
|
|
|
$category = 'Engineering';
|
|
$functionName = 'BESSELK';
|
|
$description = 'Returns the modified Bessel function, which is equivalent to the Bessel functions evaluated for purely imaginary arguments';
|
|
|
|
$helper->titles($category, $functionName, $description);
|
|
|
|
// Create new PhpSpreadsheet object
|
|
$spreadsheet = new Spreadsheet();
|
|
$worksheet = $spreadsheet->getActiveSheet();
|
|
|
|
for ($n = 0; $n <= 5; ++$n) {
|
|
for ($x = 0; $x <= 5; $x = $x + 0.25) {
|
|
Calculation::getInstance($spreadsheet)->flushInstance();
|
|
$formula = "BESSELK({$x}, {$n})";
|
|
$worksheet->setCellValue('A1', "=$formula");
|
|
|
|
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValue());
|
|
}
|
|
}
|