| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | 1 | public function register($url, $format = 'json') |
|
| 29 | { |
||
| 30 | 1 | $this->setDataValue('url', $url); |
|
| 31 | 1 | $this->setDataValue('format', strtoupper($format)); |
|
| 32 | |||
| 33 | 1 | $hooks = $this->getAllFromFlexibee(); |
|
| 34 | 1 | foreach ($hooks as $hook) { |
|
| 35 | 1 | if ($hook['url'] == $url) { |
|
| 36 | 1 | $this->addStatusMessage(_('Url allready registered'), 'warning'); |
|
| 37 | 1 | return false; |
|
| 38 | } |
||
| 39 | 1 | } |
|
| 40 | |||
| 41 | 1 | return $this->performRequest('hooks.xml?'.http_build_query($this->getData()), |
|
| 42 | 1 | 'PUT', 'xml'); |
|
| 43 | } |
||
| 44 | |||
| 54 | } |