diff --git a/src/Result/Metric/Integer.php b/src/Result/Metric/Integer.php index 3eb509e..338f24b 100644 --- a/src/Result/Metric/Integer.php +++ b/src/Result/Metric/Integer.php @@ -4,9 +4,9 @@ namespace Panaly\Result\Metric; -final class Integer implements Value +final readonly class Integer implements Value { - public function __construct(private readonly int $value) + public function __construct(public int $value) { } diff --git a/src/Result/Metric/Table.php b/src/Result/Metric/Table.php new file mode 100644 index 0000000..a843d5a --- /dev/null +++ b/src/Result/Metric/Table.php @@ -0,0 +1,26 @@ + $columns + * @param list> $rows + */ + public function __construct( + public array $columns, + public array $rows, + ) { + } + + /** @return list> */ + public function compute(): array + { + return array_merge([$this->columns], $this->rows); + } +} diff --git a/tests/Result/Metric/TableResultTest.php b/tests/Result/Metric/TableResultTest.php new file mode 100644 index 0000000..e130ea8 --- /dev/null +++ b/tests/Result/Metric/TableResultTest.php @@ -0,0 +1,24 @@ +compute(), + ); + } +}