mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-03 22:19:19 +00:00
Reorganize Samples
The samples have become unwieldy when running them from a browser. In particular, the drop-down lists are fixed size with no scrolling, and many of them are now just too large. I have moved all the Calculation samples up a level, and broken several categories (Basic, Chart, DateTime, Engineering, Financial, and Reader) into several pieces. Convert-Online (now found in the Engineering category) had a number of different problems which are now resolved. It is the only member with any significant code change.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/samples/Header.php';
|
||||
@@ -1,15 +1,5 @@
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$formula of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\DataValidation\\:\\:setFormula1\\(\\) expects string, int given\\.$#"
|
||||
count: 1
|
||||
path: samples/Basic/15_Datavalidation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$formula of method PhpOffice\\\\PhpSpreadsheet\\\\Cell\\\\DataValidation\\:\\:setFormula2\\(\\) expects string, int given\\.$#"
|
||||
count: 1
|
||||
path: samples/Basic/15_Datavalidation.php
|
||||
|
||||
-
|
||||
message: "#^Strict comparison using \\=\\=\\= between mixed and null will always evaluate to false\\.$#"
|
||||
count: 1
|
||||
|
||||
@@ -47,8 +47,8 @@ $validation->setErrorTitle('Input error');
|
||||
$validation->setError('Only numbers between 10 and 20 are allowed!');
|
||||
$validation->setPromptTitle('Allowed input');
|
||||
$validation->setPrompt('Only numbers between 10 and 20 are allowed.');
|
||||
$validation->setFormula1(10);
|
||||
$validation->setFormula2(20);
|
||||
$validation->setFormula1('10');
|
||||
$validation->setFormula2('20');
|
||||
|
||||
$validation = $spreadsheet->getActiveSheet()->getCell('B5')->getDataValidation();
|
||||
$validation->setType(DataValidation::TYPE_LIST);
|
||||
@@ -1,19 +1,19 @@
|
||||
<?php
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Xlsx as XLsxReader;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx as XLsxWriter;
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Xlsx as XlsxReader;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx as XlsxWriter;
|
||||
|
||||
require __DIR__ . '/../Header.php';
|
||||
|
||||
$sampleSpreadsheet = require __DIR__ . '/../templates/sampleSpreadsheet.php';
|
||||
$filename = $helper->getTemporaryFilename();
|
||||
$writer = new XLsxWriter($sampleSpreadsheet);
|
||||
$writer = new XlsxWriter($sampleSpreadsheet);
|
||||
$callStartTime = microtime(true);
|
||||
$writer->save($filename);
|
||||
$helper->logWrite($writer, $filename, $callStartTime);
|
||||
|
||||
$callStartTime = microtime(true);
|
||||
$reader = new XLsxReader();
|
||||
$reader = new XlsxReader();
|
||||
$spreadsheet = $reader->load($filename);
|
||||
$helper->logRead('Xlsx', $filename, $callStartTime);
|
||||
unlink($filename);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user