PhpReader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A readFromFile() 0 8 2
1
<?php
2
3
/**
4
 * Phoole (PHP7.2+)
5
 *
6
 * @category  Library
7
 * @package   Phoole\Base
8
 * @copyright Copyright (c) 2019 Hong Zhang
9
 */
10
declare(strict_types=1);
11
12
namespace Phoole\Base\Reader;
13
14
/**
15
 * PhpReader
16
 *
17
 * @package Phoole\Base
18
 */
19
class PhpReader extends AbstractReader
20
{
21
    /**
22
     * {@inheritDoc}
23
     */
24
    protected function readFromFile($path)
25
    {
26
        try {
27
            return include $path;
28
        } catch (\Exception $e) {
29
            throw new \RuntimeException($e->getMessage());
30
        }
31
    }
32
}
33