Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
88.89% covered (warning)
88.89%
8 / 9
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ArgumentList
88.89% covered (warning)
88.89%
8 / 9
66.67% covered (warning)
66.67%
2 / 3
5.03
0.00% covered (danger)
0.00%
0 / 1
 offsetGet
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 toTypescript
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
 toJavascript
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2namespace Apie\TypescriptCodeBuilder\Lists;
3
4use Apie\Core\Lists\ItemList;
5use Apie\TypescriptCodeBuilder\Dto\FunctionArgument;
6
7class ArgumentList extends ItemList
8{
9    public function offsetGet(mixed $offset): FunctionArgument
10    {
11        return parent::offsetGet($offset);
12    }
13
14    public function toTypescript(): string
15    {
16        $list = [];
17        foreach ($this as $argument) {
18            $list[] = $argument->toTypescript();
19        }
20        return implode(', ', $list);
21    }
22
23    public function toJavascript(): string
24    {
25        $list = [];
26        foreach ($this as $argument) {
27            $list[] = $argument->toJavascript();
28        }
29        return implode(', ', $list);
30    }
31}