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