Total Complexity | 7 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class Builder implements Arrayable, Jsonable |
||
9 | { |
||
10 | /** |
||
11 | * @var OfferCollection |
||
12 | */ |
||
13 | protected $offers; |
||
14 | |||
15 | /** |
||
16 | * @return OfferCollection |
||
17 | */ |
||
18 | public function offers(): OfferCollection |
||
19 | { |
||
20 | return $this->offers ?: $this->offers = new OfferCollection(); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Output an array |
||
25 | * |
||
26 | * @return array |
||
27 | */ |
||
28 | public function toArray(): array |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Return a JSON encoded string. |
||
35 | * |
||
36 | * @param bool $pretty |
||
37 | * @return string |
||
38 | */ |
||
39 | public function toJson($pretty = false): string |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * Generate an XML string |
||
46 | * @param string|null $filename |
||
47 | * @return string |
||
48 | * @throws Exceptions\MissingRequiredAttribute |
||
49 | */ |
||
50 | public function toXml(string $filename = null) |
||
64 | } |
||
65 | } |