Completed
Push — v4.0 ( 488a49...f4158b )
by
unknown
01:49
created

CollectionContent::appendParts()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace League\Plates\Content;
4
5
use League\Plates\Content;
6
7
class CollectionContent implements Content
8
{
9
    private $parts;
10
11
    public function __construct(array $parts) {
12
        $this->parts = $parts;
13
    }
14
15
    public function __toString() {
16
        return array_reduce($this->parts, function($acc, $part) {
17
            return $acc . $part;
18
        }, '');
19
    }
20
21
    public function appendParts(array $parts) {
22
        return new self(array_merge($this->parts, $parts));
23
    }
24
}
25