Skip to content

Commit d3ebbc3

Browse files
committed
Change: data type
1 parent a8ac46d commit d3ebbc3

File tree

2 files changed

+24
-48
lines changed

2 files changed

+24
-48
lines changed

tests/open_xlsx_global_data_type.phpt

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ $filePath = $excel->fileName('tutorial.xlsx')
1919
$excel->openFile('tutorial.xlsx')
2020
->setGlobalType(\Vtiful\Kernel\Excel::TYPE_DOUBLE)
2121
->nextCellCallback(function ($row, $cell, $data) {
22-
echo 'cell:' . $cell . ', row:' . $row . PHP_EOL;
23-
var_dump($data);
22+
echo 'cell:' . $cell . ', row:' . $row .', data type:' . gettype($data) . PHP_EOL;
2423
});
2524

2625
echo '----------------' . PHP_EOL;
@@ -48,26 +47,16 @@ var_dump($excel->nextRow());
4847
@unlink(__DIR__ . '/tutorial.xlsx');
4948
?>
5049
--EXPECT--
51-
cell:0, row:0
52-
string(4) "Item"
53-
cell:1, row:0
54-
string(4) "Cost"
55-
cell:2, row:0
56-
string(3) "Int"
57-
cell:3, row:0
58-
string(6) "Double"
59-
cell:3, row:0
60-
string(12) "XLSX_ROW_END"
61-
cell:0, row:1
62-
string(6) "Item_1"
63-
cell:1, row:1
64-
string(6) "Cost_1"
65-
cell:2, row:1
66-
float(10)
67-
cell:3, row:1
68-
float(10.9999995)
69-
cell:3, row:1
70-
string(12) "XLSX_ROW_END"
50+
cell:0, row:0, data type:string
51+
cell:1, row:0, data type:string
52+
cell:2, row:0, data type:string
53+
cell:3, row:0, data type:string
54+
cell:3, row:0, data type:string
55+
cell:0, row:1, data type:string
56+
cell:1, row:1, data type:string
57+
cell:2, row:1, data type:double
58+
cell:3, row:1, data type:double
59+
cell:3, row:1, data type:string
7160
----------------
7261
array(2) {
7362
[0]=>

tests/open_xlsx_next_cell_callback_with_data_type.phpt

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,23 @@ $excel->openFile('tutorial.xlsx')
2626
\Vtiful\Kernel\Excel::TYPE_TIMESTAMP,
2727
])
2828
->nextCellCallback(function ($row, $cell, $data) {
29-
echo 'cell:' . $cell . ', row:' . $row . PHP_EOL;
30-
var_dump($data);
29+
echo 'cell:' . $cell . ', row:' . $row .', data type:' . gettype($data) . PHP_EOL;
3130
});
3231
?>
3332
--CLEAN--
3433
<?php
3534
@unlink(__DIR__ . '/tutorial.xlsx');
3635
?>
3736
--EXPECT--
38-
cell:0, row:0
39-
string(4) "Item"
40-
cell:1, row:0
41-
string(4) "Cost"
42-
cell:2, row:0
43-
string(3) "Int"
44-
cell:3, row:0
45-
string(6) "Double"
46-
cell:4, row:0
47-
string(4) "Date"
48-
cell:4, row:0
49-
string(12) "XLSX_ROW_END"
50-
cell:0, row:1
51-
string(6) "Item_1"
52-
cell:1, row:1
53-
string(6) "Cost_1"
54-
cell:2, row:1
55-
int(10)
56-
cell:3, row:1
57-
float(10.9999995)
58-
cell:4, row:1
59-
int(1568904314)
60-
cell:4, row:1
61-
string(12) "XLSX_ROW_END"
37+
cell:0, row:0, data type:string
38+
cell:1, row:0, data type:string
39+
cell:2, row:0, data type:string
40+
cell:3, row:0, data type:string
41+
cell:4, row:0, data type:string
42+
cell:4, row:0, data type:string
43+
cell:0, row:1, data type:string
44+
cell:1, row:1, data type:string
45+
cell:2, row:1, data type:integer
46+
cell:3, row:1, data type:double
47+
cell:4, row:1, data type:integer
48+
cell:4, row:1, data type:string

0 commit comments

Comments
 (0)