Completed
Push — v4.0 ( 3a8f05...488a49 )
by
unknown
03:09
created

CollectionContent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __toString() 0 5 1
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