@@ -40,8 +40,7 @@ |
||
40 | 40 | * @class NullLoader |
41 | 41 | * @package Platine\Etl\Loader |
42 | 42 | */ |
43 | -class NullLoader implements LoaderInterface |
|
44 | -{ |
|
43 | +class NullLoader implements LoaderInterface { |
|
45 | 44 | /** |
46 | 45 | * {@inheritodc} |
47 | 46 | */ |
@@ -53,7 +53,7 @@ |
||
53 | 53 | /** |
54 | 54 | * {@inheritodc} |
55 | 55 | */ |
56 | - public function load(Generator $items, int|string $key, Etl $etl): void |
|
56 | + public function load(Generator $items, int | string $key, Etl $etl): void |
|
57 | 57 | { |
58 | 58 | foreach ($items as $value) { |
59 | 59 | continue; |
@@ -41,8 +41,7 @@ |
||
41 | 41 | * @class CsvFileLoader |
42 | 42 | * @package Platine\Etl\Loader |
43 | 43 | */ |
44 | -class CsvFileLoader implements LoaderInterface |
|
45 | -{ |
|
44 | +class CsvFileLoader implements LoaderInterface { |
|
46 | 45 | /** |
47 | 46 | * The file to be used |
48 | 47 | * @var SplFileObject |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @param string $escapeString |
84 | 84 | */ |
85 | 85 | public function __construct( |
86 | - SplFileObject|string $file, |
|
86 | + SplFileObject | string $file, |
|
87 | 87 | array $keys = [], |
88 | 88 | string $delimiter = ',', |
89 | 89 | string $enclosure = '"', |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | /** |
141 | 141 | * {@inheritodc} |
142 | 142 | */ |
143 | - public function load(Generator $items, int|string $key, Etl $etl): void |
|
143 | + public function load(Generator $items, int | string $key, Etl $etl): void |
|
144 | 144 | { |
145 | 145 | foreach ($items as $value) { |
146 | 146 | $this->file->fputcsv( |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | * @class ArrayLoader |
41 | 41 | * @package Platine\Etl\Loader |
42 | 42 | */ |
43 | -class ArrayLoader implements LoaderInterface |
|
44 | -{ |
|
43 | +class ArrayLoader implements LoaderInterface { |
|
45 | 44 | /** |
46 | 45 | * The data |
47 | 46 | * @var array<mixed> |
@@ -59,8 +58,7 @@ discard block |
||
59 | 58 | * @param bool $preserveKeys |
60 | 59 | * @param array<mixed> $data |
61 | 60 | */ |
62 | - public function __construct(bool $preserveKeys = true, array &$data = []) |
|
63 | - { |
|
61 | + public function __construct(bool $preserveKeys = true, array &$data = []) { |
|
64 | 62 | $this->data = &$data; |
65 | 63 | $this->preserveKeys = $preserveKeys; |
66 | 64 | } |
@@ -79,7 +79,7 @@ |
||
79 | 79 | /** |
80 | 80 | * {@inheritodc} |
81 | 81 | */ |
82 | - public function load(Generator $items, int|string $key, Etl $etl): void |
|
82 | + public function load(Generator $items, int | string $key, Etl $etl): void |
|
83 | 83 | { |
84 | 84 | foreach ($items as $value) { |
85 | 85 | if ($this->preserveKeys) { |
@@ -42,8 +42,7 @@ |
||
42 | 42 | * @class JsonFileLoader |
43 | 43 | * @package Platine\Etl\Loader |
44 | 44 | */ |
45 | -class JsonFileLoader implements LoaderInterface |
|
46 | -{ |
|
45 | +class JsonFileLoader implements LoaderInterface { |
|
47 | 46 | /** |
48 | 47 | * The file to be used |
49 | 48 | * @var SplFileObject |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param int $depth |
78 | 78 | */ |
79 | 79 | public function __construct( |
80 | - SplFileObject|string $file, |
|
80 | + SplFileObject | string $file, |
|
81 | 81 | int $options = 0, |
82 | 82 | int $depth = 512 |
83 | 83 | ) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * {@inheritodc} |
110 | 110 | */ |
111 | - public function load(Generator $items, int|string $key, Etl $etl): void |
|
111 | + public function load(Generator $items, int | string $key, Etl $etl): void |
|
112 | 112 | { |
113 | 113 | foreach ($items as $k => $v) { |
114 | 114 | $this->data[$k] = $v; |
@@ -42,8 +42,7 @@ discard block |
||
42 | 42 | * @package Platine\Etl\Iterator |
43 | 43 | * @implements IteratorAggregate<int|string, mixed> |
44 | 44 | */ |
45 | -class FileLineIterator implements IteratorAggregate |
|
46 | -{ |
|
45 | +class FileLineIterator implements IteratorAggregate { |
|
47 | 46 | /** |
48 | 47 | * The file to be used |
49 | 48 | * @var SplFileObject |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | * Create new instance |
55 | 54 | * @param SplFileObject $file |
56 | 55 | */ |
57 | - public function __construct(SplFileObject $file) |
|
58 | - { |
|
56 | + public function __construct(SplFileObject $file) { |
|
59 | 57 | $this->file = $file; |
60 | 58 | } |
61 | 59 |
@@ -42,6 +42,5 @@ |
||
42 | 42 | * @package Platine\Etl\Iterator |
43 | 43 | * @extends Traversable<int|string, mixed> |
44 | 44 | */ |
45 | -interface CsvIteratorInterface extends Traversable |
|
46 | -{ |
|
45 | +interface CsvIteratorInterface extends Traversable { |
|
47 | 46 | } |
@@ -43,6 +43,5 @@ |
||
43 | 43 | * @package Platine\Etl\Iterator |
44 | 44 | * @extends Traversable<int|string, mixed> |
45 | 45 | */ |
46 | -interface StringIteratorInterface extends Traversable |
|
47 | -{ |
|
46 | +interface StringIteratorInterface extends Traversable { |
|
48 | 47 | } |
@@ -39,6 +39,5 @@ |
||
39 | 39 | * @class EtlException |
40 | 40 | * @package Platine\Etl\Exception |
41 | 41 | */ |
42 | -class EtlException extends RuntimeException |
|
43 | -{ |
|
42 | +class EtlException extends RuntimeException { |
|
44 | 43 | } |
@@ -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 |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param SplFileObject|string $file |
123 | 123 | * @return iterable<int|string, mixed> |
124 | 124 | */ |
125 | - protected function extractFromFile(SplFileObject|string $file): iterable |
|
125 | + protected function extractFromFile(SplFileObject | string $file): iterable |
|
126 | 126 | { |
127 | 127 | if ($file instanceof SplFileObject) { |
128 | 128 | $file = $file->getPathname(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param array<mixed>|string $data |
144 | 144 | * @return iterable<int|string, mixed> |
145 | 145 | */ |
146 | - protected function extractAuto(array|string $data): iterable |
|
146 | + protected function extractAuto(array | string $data): iterable |
|
147 | 147 | { |
148 | 148 | if (is_array($data)) { |
149 | 149 | return $this->extractFromArray($data); |