| Total Complexity | 8 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class File extends Component |
||
| 15 | { |
||
| 16 | public $fileName = null; |
||
| 17 | public $filePath = null; |
||
| 18 | public $folder = null; |
||
| 19 | protected $content = null; |
||
| 20 | 2 | public function getContent() { |
|
| 21 | 2 | if ($this->filePath !== null && $this->content === null) { |
|
| 22 | 1 | return file_get_contents($this->filePath); |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | return $this->content; |
|
| 26 | } |
||
| 27 | |||
| 28 | 2 | public function setContent($content) { |
|
| 32 | } |
||
| 33 | 2 | } |
|
| 34 | |||
| 35 | 9 | public function __destruct() |
|
| 40 | } |
||
| 41 | } |
||
| 42 | } |
If you suppress an error, we recommend checking for the error condition explicitly: