diff --git a/src/Result/Metric/Integer.php b/src/Result/Metric/Integer.php index 3eb509e..351fa40 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(private int $value) { } diff --git a/src/Result/Metric/Table.php b/src/Result/Metric/Table.php new file mode 100644 index 0000000..69566c9 --- /dev/null +++ b/src/Result/Metric/Table.php @@ -0,0 +1,26 @@ + $columns + * @param list> $rows + */ + public function __construct( + private array $columns, + private 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(), + ); + } +}