mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-25 01:58:21 +00:00
37b6ca4979
Its defaults are to unescape within single quotes, and escape within double quotes and here-docs. Right now, it leaves everything as-is, which means our code is inconsistent and need not be. Further, although dealing with complex regular expressions will never be easy, I find it much easier to figure out what's going on when superfluous back-slashes are removed. These changes were all made automatically using the "fix" script, so should be reliable. They, of course, pass all unit tests.
87 lines
2.0 KiB
PHP
87 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
|
|
|
return [
|
|
[
|
|
'ABCDE,FGHIJ',
|
|
[',', true, 'ABCDE', 'FGHIJ'],
|
|
],
|
|
[
|
|
'ABCDEFGHIJ',
|
|
['', true, 'ABCDE', 'FGHIJ'],
|
|
],
|
|
[
|
|
'1-2-3',
|
|
['-', true, 1, 2, 3],
|
|
],
|
|
[
|
|
'A-B-C-E',
|
|
['-', true, 'A', 'B', 'C', null, 'E'],
|
|
],
|
|
[
|
|
'A-B-C--E',
|
|
['-', false, 'A', 'B', 'C', null, 'E'],
|
|
],
|
|
[
|
|
'A-B-C-',
|
|
['-', false, 'A', 'B', 'C', null],
|
|
],
|
|
[
|
|
'A-B-C--',
|
|
['-', false, 'A', 'B', 'C', null, null],
|
|
],
|
|
[
|
|
'<<::>>',
|
|
['::', true, '<<', '>>'],
|
|
],
|
|
[
|
|
'Καλό απόγευμα',
|
|
[' ', true, 'Καλό', 'απόγευμα'],
|
|
],
|
|
[
|
|
'Boolean-TRUE',
|
|
['-', true, 'Boolean', '', true],
|
|
],
|
|
[
|
|
'Boolean-TRUE',
|
|
['-', true, 'Boolean', ' ', true],
|
|
],
|
|
[
|
|
'Boolean--TRUE',
|
|
['-', false, 'Boolean', '', true],
|
|
],
|
|
[
|
|
'C:\Users\Mark\Documents\notes.doc',
|
|
['\\', true, 'C:', 'Users', 'Mark', 'Documents', 'notes.doc'],
|
|
],
|
|
'no argument' => ['exception', []],
|
|
'one argument' => ['exception', ['-']],
|
|
'two arguments' => ['exception', ['-', true]],
|
|
'three arguments' => ['a', ['-', true, 'a']],
|
|
'boolean as string' => ['TRUE-FALSE-TRUE', ['-', true, true, false, true]],
|
|
'result too long' => [
|
|
'#CALC!',
|
|
[
|
|
',',
|
|
true,
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
|
|
'abcde',
|
|
],
|
|
],
|
|
'result just fits' => [
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5) . ',abcd',
|
|
[
|
|
',',
|
|
true,
|
|
str_repeat('Ԁ', DataType::MAX_STRING_LENGTH - 5),
|
|
'abcd',
|
|
],
|
|
],
|
|
'propagate REF' => ['#REF!', [',', true, '1', '=sheet99!A1', '3']],
|
|
'propagate NUM' => ['#NUM!', [',', true, '1', '=SQRT(-1)', '3']],
|
|
'propagate DIV0' => ['#DIV/0!', [',', true, '1', '=12/0', '3']],
|
|
];
|