TemplateDumper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
A dump() 0 6 1
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2015-10-09
5
 */
6
namespace Net\Bazzline\Component\Template;
7
8
class TemplateDumper
9
{
10
    /**
11
     * @param TemplateInterface $template
12
     * @param string $filePath
13
     * @return bool
14
     */
15
    public function __invoke(TemplateInterface $template, $filePath)
16
    {
17
        return $this->dump($template, $filePath);
18
    }
19
20
    /**
21
     * @param TemplateInterface $template
22
     * @param string $filePath
23
     * @return bool
24
     */
25
    public function dump(TemplateInterface $template, $filePath)
26
    {
27
        $wasSuccessful = (file_put_contents($filePath, $template->render()) !== false);
28
29
        return $wasSuccessful;
30
    }
31
}