@@ -111,7 +111,7 @@ |
||
111 | 111 | return count( |
112 | 112 | array_filter( |
113 | 113 | $current, |
114 | - function ($cell) { |
|
114 | + function($cell) { |
|
115 | 115 | return $cell !== null; |
116 | 116 | } |
117 | 117 | ) |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | public function transform( |
67 | 67 | mixed $value, |
68 | - int|string $key, |
|
68 | + int | string $key, |
|
69 | 69 | Etl $etl, |
70 | 70 | array $options = [] |
71 | 71 | ): Generator { |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function transform( |
57 | 57 | mixed $value, |
58 | - int|string $key, |
|
58 | + int | string $key, |
|
59 | 59 | Etl $etl, |
60 | 60 | array $options = [] |
61 | 61 | ): Generator; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * The key |
53 | 53 | * @var int|string|null |
54 | 54 | */ |
55 | - protected int|string|null $key; |
|
55 | + protected int | string | null $key; |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * The exception that is raised |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function __construct( |
80 | 80 | string $name, |
81 | 81 | mixed $item, |
82 | - int|string|null $key, |
|
82 | + int | string | null $key, |
|
83 | 83 | Etl $etl, |
84 | 84 | Throwable $exception |
85 | 85 | ) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * Return the key |
103 | 103 | * @return int|string|null |
104 | 104 | */ |
105 | - public function getKey(): int|string|null |
|
105 | + public function getKey(): int | string | null |
|
106 | 106 | { |
107 | 107 | return $this->key; |
108 | 108 | } |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * @class ItemExceptionEvent |
41 | 41 | * @package Platine\Etl\Event |
42 | 42 | */ |
43 | -class ItemExceptionEvent extends BaseEvent |
|
44 | -{ |
|
43 | +class ItemExceptionEvent extends BaseEvent { |
|
45 | 44 | /** |
46 | 45 | * The item |
47 | 46 | * @var mixed |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * The key |
52 | 52 | * @var int|string |
53 | 53 | */ |
54 | - protected int|string $key; |
|
54 | + protected int | string $key; |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Create new instance |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function __construct( |
64 | 64 | string $name, |
65 | 65 | mixed $item, |
66 | - int|string $key, |
|
66 | + int | string $key, |
|
67 | 67 | Etl $etl |
68 | 68 | ) { |
69 | 69 | parent::__construct($name, $etl); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * Return the key |
85 | 85 | * @return int|string |
86 | 86 | */ |
87 | - public function getKey(): int|string |
|
87 | + public function getKey(): int | string |
|
88 | 88 | { |
89 | 89 | return $this->key; |
90 | 90 | } |
@@ -39,8 +39,7 @@ |
||
39 | 39 | * @class ItemEvent |
40 | 40 | * @package Platine\Etl\Event |
41 | 41 | */ |
42 | -class ItemEvent extends BaseEvent |
|
43 | -{ |
|
42 | +class ItemEvent extends BaseEvent { |
|
44 | 43 | /** |
45 | 44 | * The item |
46 | 45 | * @var mixed |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * @param int|string $key |
275 | 275 | * @return void |
276 | 276 | */ |
277 | - protected function skip(mixed $item, int|string $key): void |
|
277 | + protected function skip(mixed $item, int | string $key): void |
|
278 | 278 | { |
279 | 279 | $this->isSkip = false; |
280 | 280 | $this->dispatcher->dispatch(new ItemEvent(BaseEvent::SKIP, $item, $key, $this)); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | * @param int|string $key |
286 | 286 | * @return void |
287 | 287 | */ |
288 | - protected function stop(mixed $item, int|string $key): void |
|
288 | + protected function stop(mixed $item, int | string $key): void |
|
289 | 289 | { |
290 | 290 | $this->dispatcher->dispatch(new ItemEvent( |
291 | 291 | BaseEvent::STOP, |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | * @param int|string $key |
375 | 375 | * @return callable |
376 | 376 | */ |
377 | - protected function transform(mixed $item, int|string $key): callable |
|
377 | + protected function transform(mixed $item, int | string $key): callable |
|
378 | 378 | { |
379 | 379 | $tranformed = ($this->transform)($item, $key, $this, $this->options); |
380 | 380 | if (!$tranformed instanceof Generator) { |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | } |
399 | 399 | } |
400 | 400 | |
401 | - return static function () use ($output) { |
|
401 | + return static function() use ($output) { |
|
402 | 402 | foreach ($output as [$key, $value]) { |
403 | 403 | yield $key => $value; |
404 | 404 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * @param int|string $key |
412 | 412 | * @return void |
413 | 413 | */ |
414 | - protected function initLoader(mixed $item, int|string $key): void |
|
414 | + protected function initLoader(mixed $item, int | string $key): void |
|
415 | 415 | { |
416 | 416 | $this->dispatcher->dispatch(new ItemEvent(BaseEvent::LOADER_INIT, $item, $key, $this)); |
417 | 417 | if ($this->init === null) { |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | protected function load( |
435 | 435 | iterable $data, |
436 | 436 | mixed $item, |
437 | - int|string $key, |
|
437 | + int | string $key, |
|
438 | 438 | bool $flush, |
439 | 439 | int &$flushCounter, |
440 | 440 | int &$totalCounter |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | */ |
534 | 534 | protected function defaultTransformer(): callable |
535 | 535 | { |
536 | - return function ($item, $key): Generator { |
|
536 | + return function($item, $key): Generator { |
|
537 | 537 | yield $key => $item; |
538 | 538 | }; |
539 | 539 | } |