Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0987 |
Changes | 0 |
1 | <?php |
||
44 | 1 | public function __construct($inputName) |
|
45 | { |
||
46 | 1 | if (!isset($_FILES[$inputName])) |
|
47 | { |
||
48 | throw new RuntimeException(sprintf("Could not find uploaded file for input name `%s`", $inputName)); |
||
49 | } |
||
50 | 1 | $upload = (object) $_FILES[$inputName]; |
|
51 | 1 | if ($upload->error) |
|
52 | { |
||
53 | throw new RuntimeException(sprintf("Upload failed for input name `%s`, error code: `%s`", $inputName, $upload->error), $upload->error); |
||
54 | } |
||
55 | 1 | $this->fileName = $upload->name; |
|
56 | 1 | $this->tempName = $upload->tmp_name; |
|
57 | 1 | } |
|
58 | |||
70 |