Completed
Push — master ( ca4c91...18a32e )
by Vítězslav
04:06
created

Hooks   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 33
rs 10
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
A unregister() 0 4 1
1
<?php
2
/**
3
 * FlexiPeeHP - WebHooks.
4
 *
5
 * @link https://www.flexibee.eu/api/dokumentace/ref/web-hooks WebHooks Reference
6
 * @author     Vítězslav Dvořák <[email protected]>
7
 * @copyright  (C) 2015,2016 Spoje.Net
8
 */
9
10
namespace FlexiPeeHP;
11
12
class Hooks extends FlexiBee
13
{
14
    /**
15
     * Evidence užitá objektem.
16
     *
17
     * @var string
18
     */
19
    public $evidence = 'hoks';
20
21
    /**
22
     * Zaregistruje WebHook
23
     *
24
     * @param string $url URL skript přímající WebHook
25
     * @param string $format json|xml formát přenášených dat
26
     * @return string výsledek požadavku
27
     */
28
    public function register($url, $format = 'json')
29
    {
30
        $this->setDataValue('url', $url);
31
        $this->setDataValue('format', $format);
32
        return $this->insertToFlexiBee();
33
    }
34
35
    /**
36
     * Odregistruje webhook
37
     *
38
     * @param int $id číslo záznamu
39
     */
40
    public function unregister($id)
41
    {
42
        return $this->deleteFromFlexiBee($id);
0 ignored issues
show
Bug introduced by
The method deleteFromFlexiBee() does not seem to exist on object<FlexiPeeHP\Hooks>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
43
    }
44
}