Conditions | 4 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
39 | 3 | public function updateValue ($text) |
|
40 | { |
||
41 | 3 | if (!is_scalar($text) || (is_object($text) && method_exists($text, '__toString'))) |
|
42 | { |
||
43 | 2 | throw new \InvalidArgumentException('$text is expected to have a string representation'); |
|
44 | } |
||
45 | |||
46 | 1 | $url = sprintf("%s/%d/columns/%s/text.json", self::apiEndpoint(), $this->board_id, $this->column_id); |
|
47 | $postParams = array( |
||
48 | 1 | "pulse_id" => $this->pulse_id, |
|
49 | 1 | "text" => (string)$text |
|
50 | ); |
||
51 | |||
52 | 1 | $result = self::sendPut($url, $postParams); |
|
53 | 1 | $this->setValue($result); |
|
54 | 1 | } |
|
55 | |||
60 | } |