Conditions | 2 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
54 | 4 | public function insert($callback) |
|
55 | { |
||
56 | try { |
||
57 | 4 | if (!is_callable($callback)) { |
|
58 | 2 | throw new \InvalidArgumentException('Argument $callback can not be called as a function'); |
|
59 | } |
||
60 | |||
61 | // |
||
62 | 2 | $this->request->header('Transfer-Encoding', 'chunked'); |
|
63 | 2 | $this->request->setReadFunction($callback); |
|
64 | 2 | $this->curlerRolling->execOne($this->request, true); |
|
65 | 2 | $statement = new Statement($this->request); |
|
66 | 2 | $statement->error(); |
|
67 | 2 | return $statement; |
|
68 | } finally { |
||
69 | 4 | fclose($this->source); |
|
70 | } |
||
73 |