diff --git a/src/core/etl/src/Flow/ETL/Memory/ArrayMemory.php b/src/core/etl/src/Flow/ETL/Memory/ArrayMemory.php index cf136f3d0..c1e2b839c 100644 --- a/src/core/etl/src/Flow/ETL/Memory/ArrayMemory.php +++ b/src/core/etl/src/Flow/ETL/Memory/ArrayMemory.php @@ -9,20 +9,13 @@ final class ArrayMemory implements \Countable, Memory { /** - * @var array> - */ - public array $data; - - /** - * @param array $memory + * @param array> $memory * * @throws InvalidArgumentException */ - public function __construct(array $memory = []) + public function __construct(private array $memory = []) { $this->assertMemoryStructure($memory); - /** @var array> $memory */ - $this->data = $memory; } /** @@ -36,7 +29,7 @@ public function chunks(int $size) : array $chunks = []; - foreach (\array_chunk($this->data, $size) as $chunk) { + foreach (\array_chunk($this->memory, $size) as $chunk) { $chunks[] = new self($chunk); } @@ -45,7 +38,7 @@ public function chunks(int $size) : array public function count() : int { - return \count($this->data); + return \count($this->memory); } /** @@ -55,7 +48,7 @@ public function count() : int */ public function dump() : array { - return $this->data; + return $this->memory; } /** @@ -70,7 +63,7 @@ public function flatValues() : array { $data = []; - foreach ($this->data as $entry) { + foreach ($this->memory as $entry) { $data[] = \array_values($entry); } @@ -86,7 +79,7 @@ public function map(callable $callback) : array { $data = []; - foreach ($this->data as $entry) { + foreach ($this->memory as $entry) { $data[] = $callback($entry); } @@ -100,7 +93,7 @@ public function save(array $data) : void { $this->assertMemoryStructure($data); - $this->data = \array_merge($this->data, $data); + $this->memory = \array_merge($this->memory, $data); } /**