TemplateDumper::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
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
}