Conditions | 4 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
76 | public static function fromFilename($filename) |
||
77 | { |
||
78 | if (!file_exists($filename) || !is_file($filename) || !is_readable($filename)) { |
||
79 | throw new RuntimeException(sprintf('Filename %s is an invalid profile file or is not readable', $filename)); |
||
80 | } |
||
81 | |||
82 | return new static(StreamUtils::create(StreamUtils::open($filename, 'r'))); |
||
83 | } |
||
84 | } |
||
85 |