File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Camillebaronnet \ETL \Loader ;
4+
5+ use Generator ;
6+
7+ class Debug implements LoaderInterface, StreamLoaderInterface
8+ {
9+ public function __invoke (array $ data )
10+ {
11+ return dump ($ data );
12+ }
13+
14+ public function stream (Generator $ collection ): void
15+ {
16+ foreach ($ collection as $ row ) {
17+ dump ($ row );
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Camillebaronnet \ETL \Transformer ;
4+
5+ class Sleep implements TransformInterface
6+ {
7+ public $ seconds = 1 ;
8+
9+ /**
10+ * The saved context, hydrated by the __invoke.
11+ *
12+ * @var array
13+ */
14+ protected $ context = [];
15+
16+ /**
17+ * The class entry point.
18+ */
19+ public function __invoke (array $ data ): array
20+ {
21+ sleep ($ this ->seconds );
22+
23+ return $ data ;
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments