Completed
Pull Request — master (#470)
by Claus
01:32
created

FileSource::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
namespace TYPO3Fluid\Fluid\Core\Parser;
4
5
/*
6
 * This file belongs to the package "TYPO3 Fluid".
7
 * See LICENSE.txt that was shipped with this package.
8
 */
9
10
/**
11
 * Source reflecting a piece of Fluid source code,
12
 * contained within a template file.
13
 */
14
class FileSource extends Source
15
{
16
    public $source = '';
17
    public $filePathAndFilename = '';
18
    public $bytes = [];
19
    public $length = 0;
20
21
    public function __construct(string $filePathAndFilename)
22
    {
23
        $this->filePathAndFilename = $filePathAndFilename;
24
        parent::__construct(file_get_contents($filePathAndFilename));
25
    }
26
}
27