@@ -42,8 +42,7 @@ discard block |
||
42 | 42 | * @class CallableTransformer |
43 | 43 | * @package Platine\Etl\Transformer |
44 | 44 | */ |
45 | -class CallableTransformer implements TransformerInterface |
|
46 | -{ |
|
45 | +class CallableTransformer implements TransformerInterface { |
|
47 | 46 | /** |
48 | 47 | * The callable to be used |
49 | 48 | * @var callable |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | * Create new instance |
55 | 54 | * @param callable $callable |
56 | 55 | */ |
57 | - public function __construct(callable $callable) |
|
58 | - { |
|
56 | + public function __construct(callable $callable) { |
|
59 | 57 | $this->callable = $callable; |
60 | 58 | } |
61 | 59 |
@@ -43,8 +43,7 @@ |
||
43 | 43 | * @class TransformerInterface |
44 | 44 | * @package Platine\Etl\Transformer |
45 | 45 | */ |
46 | -interface TransformerInterface |
|
47 | -{ |
|
46 | +interface TransformerInterface { |
|
48 | 47 | /** |
49 | 48 | * Transform the given value |
50 | 49 | * @param mixed $value |
@@ -338,7 +338,7 @@ |
||
338 | 338 | } |
339 | 339 | $this->dispatcher->dispatch(new ItemEvent(BaseEvent::TRANSFORM, $item, $key, $this)); |
340 | 340 | } catch (Exception $e) { |
341 | - /** @var ItemExceptionEvent $event */ |
|
341 | + /** @var ItemExceptionEvent $event */ |
|
342 | 342 | $event = $this->dispatcher->dispatch( |
343 | 343 | new ItemExceptionEvent(BaseEvent::TRANSFORM_EXCEPTION, $item ?? null, $key ?? null, $this, $e) |
344 | 344 | ); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
351 | - return static function () use ($output) { |
|
351 | + return static function() use ($output) { |
|
352 | 352 | foreach ($output as [$key, $value]) { |
353 | 353 | yield $key => $value; |
354 | 354 | } |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | */ |
468 | 468 | protected function defaultTransformer(): callable |
469 | 469 | { |
470 | - return function ($item, $key): Generator { |
|
470 | + return function($item, $key): Generator { |
|
471 | 471 | yield $key => $item; |
472 | 472 | }; |
473 | 473 | } |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * @class Etl |
54 | 54 | * @package Platine\Etl |
55 | 55 | */ |
56 | -class Etl |
|
57 | -{ |
|
56 | +class Etl { |
|
58 | 57 | /** |
59 | 58 | * @var callable|null |
60 | 59 | */ |
@@ -47,8 +47,7 @@ |
||
47 | 47 | * @class EtlTool |
48 | 48 | * @package Platine\Etl |
49 | 49 | */ |
50 | -class EtlTool |
|
51 | -{ |
|
50 | +class EtlTool { |
|
52 | 51 | /** |
53 | 52 | * @var callable|null |
54 | 53 | */ |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | * @class JsonExtractor |
45 | 45 | * @package Platine\Etl\Extractor |
46 | 46 | */ |
47 | -class JsonExtractor implements ExtractorInterface |
|
48 | -{ |
|
47 | +class JsonExtractor implements ExtractorInterface { |
|
49 | 48 | public const EXTRACT_AUTO = 0; |
50 | 49 | public const EXTRACT_FROM_STRING = 1; |
51 | 50 | public const EXTRACT_FROM_FILE = 2; |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | * Create new instance |
62 | 61 | * @param int $type |
63 | 62 | */ |
64 | - public function __construct(int $type = self::EXTRACT_AUTO) |
|
65 | - { |
|
63 | + public function __construct(int $type = self::EXTRACT_AUTO) { |
|
66 | 64 | $this->type = $type; |
67 | 65 | } |
68 | 66 | |
@@ -166,8 +164,7 @@ discard block |
||
166 | 164 | * @param array<string, mixed> $options |
167 | 165 | * @return $this |
168 | 166 | */ |
169 | - protected function setOptions(array $options) |
|
170 | - { |
|
167 | + protected function setOptions(array $options) { |
|
171 | 168 | if (isset($options['type']) && is_int($options['type'])) { |
172 | 169 | $this->type = $options['type']; |
173 | 170 | } |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | * @class CsvExtractor |
45 | 45 | * @package Platine\Etl\Extractor |
46 | 46 | */ |
47 | -class CsvExtractor implements ExtractorInterface |
|
48 | -{ |
|
47 | +class CsvExtractor implements ExtractorInterface { |
|
49 | 48 | public const EXTRACT_AUTO = 0; |
50 | 49 | public const EXTRACT_FROM_STRING = 1; |
51 | 50 | public const EXTRACT_FROM_FILE = 2; |
@@ -192,8 +191,7 @@ discard block |
||
192 | 191 | * @param array<string, mixed> $options |
193 | 192 | * @return $this |
194 | 193 | */ |
195 | - protected function setOptions(array $options) |
|
196 | - { |
|
194 | + protected function setOptions(array $options) { |
|
197 | 195 | if (isset($options['delimiter'])) { |
198 | 196 | $this->delimiter = $options['delimiter']; |
199 | 197 | } |
@@ -42,8 +42,7 @@ |
||
42 | 42 | * @class LoaderInterface |
43 | 43 | * @package Platine\Etl\Loader |
44 | 44 | */ |
45 | -interface LoaderInterface |
|
46 | -{ |
|
45 | +interface LoaderInterface { |
|
47 | 46 | /** |
48 | 47 | * Init loader (start a transaction, if supported) and reset loader state. |
49 | 48 | * @param array<string, mixed> $options additional options |