Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.1406 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
43 | 15 | public function __construct() |
|
44 | { |
||
45 | 15 | $tmpdir = sys_get_temp_dir(); |
|
46 | 15 | if (!is_writable($tmpdir)) { |
|
47 | throw new RuntimeException('Temporary files directory is not writable'); |
||
48 | } |
||
49 | |||
50 | 15 | $tmpfile = tmpfile(); |
|
51 | 15 | if (!is_resource($tmpfile)) { |
|
52 | throw new RuntimeException('Temporary file cannot be created or opened'); |
||
53 | } |
||
54 | |||
55 | 15 | parent::__construct($tmpfile); |
|
56 | } |
||
58 |