| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | public function __construct($pinCode) |
||
| 12 | { |
||
| 13 | if (!is_string($pinCode)) { |
||
| 14 | throw new XsollaWebhookException(sprintf( |
||
| 15 | 'Pin code should be non-empty string. %s given', |
||
| 16 | is_object($pinCode) ? get_class($pinCode) : gettype($pinCode) |
||
| 17 | )); |
||
| 18 | } |
||
| 19 | if ('' === $pinCode) { |
||
| 20 | throw new XsollaWebhookException('Pin code should be non-empty string. Empty string given'); |
||
| 21 | } |
||
| 22 | parent::__construct(200, XsollaClient::jsonEncode(array('pin_code' => $pinCode))); |
||
| 23 | } |
||
| 24 | } |
||
| 25 |