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

podio-community / podio-php / 5637863962

pending completion
5637863962

push

github

daniel-sc
feat: remove PodioClient instance field from models and make all model operations static

resolves #234

94 of 94 new or added lines in 64 files covered. (100.0%)

916 of 2104 relevant lines covered (43.54%)

24.12 hits per line

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

0.0
/models/PodioTaskLabel.php
1
<?php
2
/**
3
 * @see https://developers.podio.com/doc/tasks
4
 */
5
class PodioTaskLabel extends PodioObject
6
{
7
    public const DEFAULT_COLOR = 'E9E9E9';
8

9
    public function __construct($attributes = array())
10
    {
11
        parent::__construct();
×
12
        $this->property('label_id', 'integer', array('id' => true));
×
13
        $this->property('text', 'string');
×
14
        $this->property('color', 'string');
×
15

16
        $this->init($attributes);
×
17
    }
18

19
    /**
20
     * @see https://developers.podio.com/doc/tasks/create-label-151265
21
     */
22
    public static function create(PodioClient $podio_client, $attributes = array())
23
    {
24
        if (!isset($attributes['color'])) {
×
25
            $attributes['color'] = PodioTaskLabel::DEFAULT_COLOR;
×
26
        }
27
        $body = $podio_client->post("/task/label/", $attributes)->json_body();
×
28
        return $body['label_id'];
×
29
    }
30

31
    /**
32
     * @see https://developers.podio.com/doc/tasks/get-labels-151534
33
     */
34
    public static function get_all(PodioClient $podio_client)
35
    {
36
        return self::listing($podio_client, $podio_client->get("/task/label"));
×
37
    }
38

39
    /**
40
     * @see https://developers.podio.com/doc/tasks/delete-label-151302
41
     */
42
    public static function delete(PodioClient $podio_client, $label_id)
43
    {
44
        return $podio_client->delete("/task/label/{$label_id}");
×
45
    }
46

47
    /**
48
     * @see https://developers.podio.com/doc/tasks/update-task-labels-151769
49
     */
50
    public static function update(PodioClient $podio_client, $label_id, $attributes = array())
51
    {
52
        return $podio_client->put("/task/label/{$label_id}", $attributes);
×
53
    }
54
}
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