Passed
Push — master ( 0f9932...7bc3f9 )
by Brent
03:42
created

FileParser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 11 2
1
<?php
2
3
namespace brendt\stitcher\parser;
4
5
use brendt\stitcher\Config;
6
use Symfony\Component\Finder\Finder;
7
8
class FileParser implements Parser {
9
10
    /**
11
     * @param $path
12
     *
13
     * @return string
14
     */
15
    public function parse($path) {
16
        $finder = new Finder();
17
        $files = $finder->files()->in(Config::get('directories.src'))->path(trim($path, '/'));
18
        $data = '';
19
20
        foreach ($files as $file) {
21
            $data .= $file->getContents();
22
        }
23
24
        return $data;
25
    }
26
27
}
28