Skip to content

Commit 2c7294f

Browse files
authored
Add openspout/openspout bridge as a replacement of box/spout (#86)
* Add openspout/openspout bridge as a replacement of box/spout * Fix phpstan * Fix checkstyle * Re-add ability to set the sheet name during flat file write * Update docs * Fixed tests
1 parent bb81f79 commit 2c7294f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1523
-26
lines changed

.github/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
- 'src/batch-doctrine-persistence/**'
1212
'yokai/batch-league-flysystem':
1313
- 'src/batch-league-flysystem/**'
14+
'yokai/batch-openspout':
15+
- 'src/batch-openspout/**'
1416
'yokai/batch-symfony-console':
1517
- 'src/batch-symfony-console/**'
1618
'yokai/batch-symfony-framework':

.github/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ changelog:
1313
labels: ['yokai/batch-doctrine-persistence']
1414
- title: 'Changes made to the `league/flysystem` bridge: `yokai/batch-league-flysystem`'
1515
labels: ['yokai/batch-league-flysystem']
16+
- title: 'Changes made to the `openspout/openspout` bridge: `yokai/batch-openspout`'
17+
labels: ['yokai/batch-openspout']
1618
- title: 'Changes made to the `symfony/console` bridge: `yokai/batch-symfony-console`'
1719
labels: ['yokai/batch-symfony-console']
1820
- title: 'Changes made to the `symfony/framework-bundle` bridge: `yokai/batch-symfony-framework`'

MAINTAINER.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ see https://github.com/yokai-php/batch-src/releases/tag/{created tag}
3636
- https://github.com/yokai-php/batch-doctrine-orm/releases/new
3737
- https://github.com/yokai-php/batch-doctrine-persistence/releases/new
3838
- https://github.com/yokai-php/batch-league-flysystem/releases/new
39+
- https://github.com/yokai-php/batch-openspout/releases/new
3940
- https://github.com/yokai-php/batch-symfony-console/releases/new
4041
- https://github.com/yokai-php/batch-symfony-framework/releases/new
4142
- https://github.com/yokai-php/batch-symfony-messenger/releases/new

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ Some bridges to popular packages :
1515

1616
| Bridge with | |
1717
|------------------------------------------------------------------------------------|----------------------------------------------------------------|
18-
| [`box/spout`](https://github.com/yokai-php/batch-box-spout) | Read/Write from/to CSV/ODS/XLSX |
18+
| `DEPRECATED` [`box/spout`](https://github.com/yokai-php/batch-box-spout) | Read/Write from/to CSV/ODS/XLSX |
1919
| [`doctrine/dbal`](https://github.com/yokai-php/batch-doctrine-dbal) | Read/Write from/to SQL databases |
2020
| [`doctrine/orm`](https://github.com/yokai-php/batch-doctrine-orm) | Read from Doctrine ORM entities |
2121
| [`doctrine/persistence`](https://github.com/yokai-php/batch-doctrine-persistence) | Write to Doctrine ORM/ODM objects |
2222
| [`league/flysystem`](https://github.com/yokai-php/batch-league-flysystem) | Copy/Move files in a job / Trigger job when file found |
23+
| [`openspout/openspout`](https://github.com/yokai-php/batch-openspout) | Read/Write from/to CSV/ODS/XLSX |
2324
| [`symfony/console`](https://github.com/yokai-php/batch-symfony-console) | Add command to trigger jobs and async job launcher via command |
2425
| [`symfony/framework-bundle`](https://github.com/yokai-php/batch-symfony-framework) | Bundle to integrate with Symfony framework |
2526
| [`symfony/messenger`](https://github.com/yokai-php/batch-symfony-messenger) | Trigger jobs using message dispatch |

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"doctrine/orm": "^2.8",
2020
"doctrine/persistence": "^2.0|^3.0",
2121
"league/flysystem": "^3.0",
22+
"openspout/openspout": "^4.0",
2223
"psr/container": "^1.0",
2324
"psr/event-dispatcher": "^1.0",
2425
"psr/log": "^1.0|^2.0|^3.0",
@@ -50,6 +51,7 @@
5051
"yokai/batch-doctrine-orm": "self.version",
5152
"yokai/batch-doctrine-persistence": "self.version",
5253
"yokai/batch-league-flysystem": "self.version",
54+
"yokai/batch-openspout": "self.version",
5355
"yokai/batch-symfony-console": "self.version",
5456
"yokai/batch-symfony-framework": "self.version",
5557
"yokai/batch-symfony-messenger": "self.version",
@@ -64,6 +66,7 @@
6466
"Yokai\\Batch\\Bridge\\Doctrine\\ORM\\": "src/batch-doctrine-orm/src/",
6567
"Yokai\\Batch\\Bridge\\Doctrine\\Persistence\\": "src/batch-doctrine-persistence/src/",
6668
"Yokai\\Batch\\Bridge\\League\\Flysystem\\": "src/batch-league-flysystem/src/",
69+
"Yokai\\Batch\\Bridge\\OpenSpout\\": "src/batch-openspout/src/",
6770
"Yokai\\Batch\\Bridge\\Symfony\\Console\\": "src/batch-symfony-console/src/",
6871
"Yokai\\Batch\\Bridge\\Symfony\\Framework\\": "src/batch-symfony-framework/src/",
6972
"Yokai\\Batch\\Bridge\\Symfony\\Messenger\\": "src/batch-symfony-messenger/src/",
@@ -83,6 +86,7 @@
8386
"Yokai\\Batch\\Tests\\Bridge\\Doctrine\\ORM\\": "src/batch-doctrine-orm/tests/",
8487
"Yokai\\Batch\\Tests\\Bridge\\Doctrine\\Persistence\\": "src/batch-doctrine-persistence/tests/",
8588
"Yokai\\Batch\\Tests\\Bridge\\League\\Flysystem\\": "src/batch-league-flysystem/tests/",
89+
"Yokai\\Batch\\Tests\\Bridge\\OpenSpout\\": "src/batch-openspout/tests/",
8690
"Yokai\\Batch\\Tests\\Bridge\\Symfony\\Console\\": "src/batch-symfony-console/tests/",
8791
"Yokai\\Batch\\Tests\\Bridge\\Symfony\\Framework\\": "src/batch-symfony-framework/tests/",
8892
"Yokai\\Batch\\Tests\\Bridge\\Symfony\\Messenger\\": "src/batch-symfony-messenger/tests/",

phpstan-baseline.neon

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,66 @@ parameters:
100100
count: 1
101101
path: src/batch-doctrine-dbal/src/JobExecutionRowNormalizer.php
102102

103+
-
104+
message: "#^Method Yokai\\\\Batch\\\\Bridge\\\\OpenSpout\\\\Reader\\\\FlatFileReader\\:\\:rows\\(\\) has parameter \\$reader with generic interface OpenSpout\\\\Reader\\\\ReaderInterface but does not specify its types\\: T$#"
105+
count: 1
106+
path: src/batch-openspout/src/Reader/FlatFileReader.php
107+
108+
-
109+
message: "#^Parameter \\#1 \\$headers of method Yokai\\\\Batch\\\\Bridge\\\\OpenSpout\\\\Reader\\\\HeaderStrategy\\:\\:setHeaders\\(\\) expects array\\<int, string\\>, array\\<bool\\|DateInterval\\|DateTimeInterface\\|float\\|int\\|string\\|null\\> given\\.$#"
110+
count: 1
111+
path: src/batch-openspout/src/Reader/FlatFileReader.php
112+
113+
-
114+
message: "#^Parameter \\#1 \\$options of class OpenSpout\\\\Reader\\\\CSV\\\\Reader constructor expects OpenSpout\\\\Reader\\\\CSV\\\\Options\\|null, OpenSpout\\\\Reader\\\\CSV\\\\Options\\|OpenSpout\\\\Reader\\\\ODS\\\\Options\\|OpenSpout\\\\Reader\\\\XLSX\\\\Options\\|null given\\.$#"
115+
count: 1
116+
path: src/batch-openspout/src/Reader/FlatFileReader.php
117+
118+
-
119+
message: "#^Parameter \\#1 \\$options of class OpenSpout\\\\Reader\\\\ODS\\\\Reader constructor expects OpenSpout\\\\Reader\\\\ODS\\\\Options\\|null, OpenSpout\\\\Reader\\\\CSV\\\\Options\\|OpenSpout\\\\Reader\\\\ODS\\\\Options\\|OpenSpout\\\\Reader\\\\XLSX\\\\Options\\|null given\\.$#"
120+
count: 1
121+
path: src/batch-openspout/src/Reader/FlatFileReader.php
122+
123+
-
124+
message: "#^Parameter \\#1 \\$options of class OpenSpout\\\\Reader\\\\XLSX\\\\Reader constructor expects OpenSpout\\\\Reader\\\\XLSX\\\\Options\\|null, OpenSpout\\\\Reader\\\\CSV\\\\Options\\|OpenSpout\\\\Reader\\\\ODS\\\\Options\\|OpenSpout\\\\Reader\\\\XLSX\\\\Options\\|null given\\.$#"
125+
count: 1
126+
path: src/batch-openspout/src/Reader/FlatFileReader.php
127+
128+
-
129+
message: "#^Parameter \\#1 \\$row of method Yokai\\\\Batch\\\\Bridge\\\\OpenSpout\\\\Reader\\\\HeaderStrategy\\:\\:getItem\\(\\) expects array\\<int, string\\>, array\\<bool\\|DateInterval\\|DateTimeInterface\\|float\\|int\\|string\\|null\\> given\\.$#"
130+
count: 1
131+
path: src/batch-openspout/src/Reader/FlatFileReader.php
132+
133+
-
134+
message: "#^Method Yokai\\\\Batch\\\\Bridge\\\\OpenSpout\\\\Reader\\\\SheetFilter\\:\\:list\\(\\) has parameter \\$reader with generic interface OpenSpout\\\\Reader\\\\ReaderInterface but does not specify its types\\: T$#"
135+
count: 1
136+
path: src/batch-openspout/src/Reader/SheetFilter.php
137+
138+
-
139+
message: "#^Method Yokai\\\\Batch\\\\Bridge\\\\OpenSpout\\\\Reader\\\\SheetFilter\\:\\:list\\(\\) return type with generic interface OpenSpout\\\\Reader\\\\SheetInterface does not specify its types\\: T$#"
140+
count: 1
141+
path: src/batch-openspout/src/Reader/SheetFilter.php
142+
143+
-
144+
message: "#^PHPDoc tag @var for variable \\$sheet contains generic interface OpenSpout\\\\Reader\\\\SheetInterface but does not specify its types\\: T$#"
145+
count: 1
146+
path: src/batch-openspout/src/Reader/SheetFilter.php
147+
148+
-
149+
message: "#^Parameter \\#1 \\$options of class OpenSpout\\\\Writer\\\\CSV\\\\Writer constructor expects OpenSpout\\\\Writer\\\\CSV\\\\Options\\|null, OpenSpout\\\\Writer\\\\CSV\\\\Options\\|OpenSpout\\\\Writer\\\\ODS\\\\Options\\|OpenSpout\\\\Writer\\\\XLSX\\\\Options\\|null given\\.$#"
150+
count: 1
151+
path: src/batch-openspout/src/Writer/FlatFileWriter.php
152+
153+
-
154+
message: "#^Parameter \\#1 \\$options of class OpenSpout\\\\Writer\\\\ODS\\\\Writer constructor expects OpenSpout\\\\Writer\\\\ODS\\\\Options\\|null, OpenSpout\\\\Writer\\\\CSV\\\\Options\\|OpenSpout\\\\Writer\\\\ODS\\\\Options\\|OpenSpout\\\\Writer\\\\XLSX\\\\Options\\|null given\\.$#"
155+
count: 1
156+
path: src/batch-openspout/src/Writer/FlatFileWriter.php
157+
158+
-
159+
message: "#^Parameter \\#1 \\$options of class OpenSpout\\\\Writer\\\\XLSX\\\\Writer constructor expects OpenSpout\\\\Writer\\\\XLSX\\\\Options\\|null, OpenSpout\\\\Writer\\\\CSV\\\\Options\\|OpenSpout\\\\Writer\\\\ODS\\\\Options\\|OpenSpout\\\\Writer\\\\XLSX\\\\Options\\|null given\\.$#"
160+
count: 1
161+
path: src/batch-openspout/src/Writer/FlatFileWriter.php
162+
103163
-
104164
message: "#^Cannot access offset 'connection' on mixed\\.$#"
105165
count: 1

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ parameters:
1010
- src/batch-doctrine-orm/src/
1111
- src/batch-doctrine-persistence/src/
1212
- src/batch-league-flysystem/src/
13+
- src/batch-openspout/src/
1314
- src/batch-symfony-console/src/
1415
- src/batch-symfony-framework/src/
1516
- src/batch-symfony-messenger/src/

scripts/split-branch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ remote batch-doctrine-dbal git@github.com:yokai-php/batch-doctrine-dbal.g
3030
remote batch-doctrine-orm git@github.com:yokai-php/batch-doctrine-orm.git
3131
remote batch-doctrine-persistence git@github.com:yokai-php/batch-doctrine-persistence.git
3232
remote batch-league-flysystem git@github.com:yokai-php/batch-league-flysystem.git
33+
remote batch-openspout git@github.com:yokai-php/batch-openspout.git
3334
remote batch-symfony-console git@github.com:yokai-php/batch-symfony-console.git
3435
remote batch-symfony-framework git@github.com:yokai-php/batch-symfony-framework.git
3536
remote batch-symfony-messenger git@github.com:yokai-php/batch-symfony-messenger.git
@@ -43,6 +44,7 @@ split 'src/batch-doctrine-dbal' batch-doctrine-dbal
4344
split 'src/batch-doctrine-orm' batch-doctrine-orm
4445
split 'src/batch-doctrine-persistence' batch-doctrine-persistence
4546
split 'src/batch-league-flysystem' batch-league-flysystem
47+
split 'src/batch-openspout' batch-openspout
4648
split 'src/batch-symfony-console' batch-symfony-console
4749
split 'src/batch-symfony-framework' batch-symfony-framework
4850
split 'src/batch-symfony-messenger' batch-symfony-messenger

scripts/split-tag

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ remote batch-doctrine-dbal git@github.com:yokai-php/batch-doctrine-dbal.g
3030
remote batch-doctrine-orm git@github.com:yokai-php/batch-doctrine-orm.git
3131
remote batch-doctrine-persistence git@github.com:yokai-php/batch-doctrine-persistence.git
3232
remote batch-league-flysystem git@github.com:yokai-php/batch-league-flysystem.git
33+
remote batch-openspout git@github.com:yokai-php/batch-openspout.git
3334
remote batch-symfony-console git@github.com:yokai-php/batch-symfony-console.git
3435
remote batch-symfony-framework git@github.com:yokai-php/batch-symfony-framework.git
3536
remote batch-symfony-messenger git@github.com:yokai-php/batch-symfony-messenger.git
@@ -43,6 +44,7 @@ split 'src/batch-doctrine-dbal' batch-doctrine-dbal
4344
split 'src/batch-doctrine-orm' batch-doctrine-orm
4445
split 'src/batch-doctrine-persistence' batch-doctrine-persistence
4546
split 'src/batch-league-flysystem' batch-league-flysystem
47+
split 'src/batch-openspout' batch-openspout
4648
split 'src/batch-symfony-console' batch-symfony-console
4749
split 'src/batch-symfony-framework' batch-symfony-framework
4850
split 'src/batch-symfony-messenger' batch-symfony-messenger

src/batch-box-spout/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
[`box/spout`](https://github.com/box/spout) bridge for [Batch](https://github.com/yokai-php/batch) processing library.
77

88

9+
## :warning: DEPRECATED
10+
11+
This library is deprecated because the package it relies on was also deprecated.
12+
The library has been replaced with [`openspout/openspout`](https://github.com/openspout/openspout).
13+
And this bridge was replaced with [`yokai/batch-openspout`](https://github.com/yokai-php/batch-openspout).
14+
15+
916
## :warning: BETA
1017

1118
This library is following [semver](https://semver.org/).

0 commit comments

Comments
 (0)