| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 35 | public function upload($type, $file, $candidateId = null) |
||
| 36 | { |
||
| 37 | if ($candidateId !== null) { |
||
| 38 | $this->setAttribute('candidate_id', $candidateId); |
||
| 39 | } |
||
| 40 | |||
| 41 | $response = $this->uploadRequest($this->processPath('candidates/:candidate_id/documents', |
||
| 42 | ['candidate_id' => $this->getAttribute('candidate_id')]), |
||
| 43 | ['multipart' => [ |
||
| 44 | ['name' => 'type', 'contents' => $type], |
||
| 45 | ['name' => 'file', 'contents' => fopen($file, 'rb')], |
||
| 46 | ], |
||
| 47 | ]); |
||
| 48 | $this->setAttributes([]); |
||
| 49 | $this->setValues($response); |
||
| 50 | |||
| 51 | return $this; |
||
| 52 | } |
||
| 59 |