• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

podio-community / podio-php / 5155068956

pending completion
5155068956

push

github

daniel-sc
feat: isolated client class to allow for parallel usage + extension + mocking

BREAKING CHANGE: replace static Podio with instantiable PodioClient

648 of 648 new or added lines in 66 files covered. (100.0%)

917 of 2107 relevant lines covered (43.52%)

24.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/models/PodioHook.php
1
<?php
2
/**
3
 * @see https://developers.podio.com/doc/hooks
4
 */
5
class PodioHook extends PodioObject
6
{
7
    public function __construct(PodioClient $podio_client, $attributes = array())
8
    {
9
        parent::__construct($podio_client);
×
10
        $this->property('hook_id', 'integer', array('id' => true));
×
11
        $this->property('status', 'string');
×
12
        $this->property('type', 'string');
×
13
        $this->property('url', 'string');
×
14
        $this->property('created_on', 'datetime');
×
15

16
        $this->has_one('created_by', 'ByLine');
×
17
        $this->has_one('created_via', 'Via');
×
18

19
        $this->init($attributes);
×
20
    }
21

22
    /**
23
     * @see https://developers.podio.com/doc/hooks/get-hooks-215285
24
     */
25
    public static function get_for($ref_type, $ref_id, PodioClient $podio_client)
26
    {
27
        return self::listing($podio_client->get("/hook/{$ref_type}/{$ref_id}/"), $podio_client);
×
28
    }
29

30
    /**
31
     * @see https://developers.podio.com/doc/hooks/create-hook-215056
32
     */
33
    public static function create($ref_type, $ref_id, $attributes = array(), PodioClient $podio_client)
34
    {
35
        $body = $podio_client->post("/hook/{$ref_type}/{$ref_id}/", $attributes)->json_body();
×
36
        return $body['hook_id'];
×
37
    }
38

39
    /**
40
     * @see https://developers.podio.com/doc/hooks/request-hook-verification-215232
41
     */
42
    public static function verify($hook_id, PodioClient $podio_client)
43
    {
44
        return $podio_client->post("/hook/{$hook_id}/verify/request")->json_body();
×
45
    }
46

47
    /**
48
     * @see https://developers.podio.com/doc/hooks/validate-hook-verification-215241
49
     */
50
    public static function validate($hook_id, $attributes = array(), PodioClient $podio_client)
51
    {
52
        return $podio_client->post("/hook/{$hook_id}/verify/validate", $attributes)->json_body();
×
53
    }
54

55
    /**
56
     * @see https://developers.podio.com/doc/hooks/delete-hook-215291
57
     */
58
    public static function delete($hook_id, PodioClient $podio_client)
59
    {
60
        return $podio_client->delete("/hook/{$hook_id}");
×
61
    }
62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc