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

podio-community / podio-php / 5919248423

20 Aug 2023 07:35PM UTC coverage: 54.871% (+1.4%) from 53.497%
5919248423

Pull #242

github

daniel-sc
fix linter II
Pull Request #242: More fixes

181 of 181 new or added lines in 43 files covered. (100.0%)

1149 of 2094 relevant lines covered (54.87%)

34.44 hits per line

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

50.0
/models/PodioApp.php
1
<?php
2
/**
3
 * @see https://developers.podio.com/doc/applications
4
 */
5
class PodioApp extends PodioObject
6
{
7
    public function __construct($attributes = array())
8
    {
9
        parent::__construct();
12✔
10
        $this->property('app_id', 'integer', array('id' => true));
12✔
11
        $this->property('original', 'integer');
12✔
12
        $this->property('original_revision', 'integer');
12✔
13
        $this->property('status', 'string');
12✔
14
        $this->property('icon', 'string');
12✔
15
        $this->property('icon_id', 'integer');
12✔
16
        $this->property('space_id', 'integer');
12✔
17
        $this->property('owner_id', 'integer');
12✔
18
        $this->property('owner', 'hash'); // TODO: User class?
12✔
19
        $this->property('config', 'hash');
12✔
20
        $this->property('subscribed', 'boolean');
12✔
21
        $this->property('rights', 'array');
12✔
22
        $this->property('link', 'string');
12✔
23
        $this->property('url_add', 'string');
12✔
24
        $this->property('token', 'string');
12✔
25
        $this->property('url_label', 'string');
12✔
26
        $this->property('mailbox', 'string');
12✔
27

28
        $this->has_one('integration', 'Integration');
12✔
29
        $this->has_many('fields', 'AppField');
12✔
30

31
        // When app is returned as part of large collection (e.g. for stream), some config properties is moved to the main object
32
        $this->property('name', 'string');
12✔
33
        $this->property('item_name', 'string');
12✔
34

35
        $this->init($attributes);
12✔
36
    }
37

38
    /**
39
     * @see https://developers.podio.com/doc/applications/get-app-22349
40
     */
41
    public static function get(PodioClient $podio_client, $app_id, $attributes = array())
42
    {
43
        return self::member($podio_client->get("/app/{$app_id}", $attributes));
×
44
    }
45

46
    /**
47
     * @see https://developers.podio.com/doc/applications/get-all-user-apps-5902728
48
     */
49
    public static function get_all(PodioClient $podio_client, $attributes = array())
50
    {
51
        return self::listing($podio_client->get("/app/v2/", $attributes));
×
52
    }
53

54
    /**
55
     * @see https://developers.podio.com/doc/applications/get-top-apps-22476
56
     */
57
    public static function get_top(PodioClient $podio_client, $attributes = array())
58
    {
59
        return self::listing($podio_client->get("/app/top/", $attributes));
×
60
    }
61

62
    /**
63
     * @see https://developers.podio.com/doc/applications/get-top-apps-for-organization-1671395
64
     */
65
    public static function get_top_for_org(PodioClient $podio_client, $org_id, $attributes = array())
66
    {
67
        return self::listing($podio_client->get("/app/org/{$org_id}/top/", $attributes));
×
68
    }
69

70
    /**
71
     * @see https://developers.podio.com/doc/applications/get-app-on-space-by-url-label-477105
72
     */
73
    public static function get_for_url(PodioClient $podio_client, $space_id, $url_label, $attributes = array())
74
    {
75
        return self::member($podio_client->get("/app/space/{$space_id}/{$url_label}", $attributes));
×
76
    }
77

78
    /**
79
     * @see https://developers.podio.com/doc/applications/get-apps-by-space-22478
80
     */
81
    public static function get_for_space(PodioClient $podio_client, $space_id, $attributes = array())
82
    {
83
        return self::listing($podio_client->get("/app/space/{$space_id}/", $attributes));
×
84
    }
85

86
    /**
87
     * @see https://developers.podio.com/doc/applications/add-new-app-22351
88
     */
89
    public static function create(PodioClient $podio_client, $attributes = array(), $silent = false)
90
    {
91
        return self::member($podio_client->post($podio_client->url_with_options("/app/", array('silent' => $silent)), $attributes));
×
92
    }
93

94
    /**
95
     * @see https://developers.podio.com/doc/applications/update-app-22352
96
     */
97
    public static function update(PodioClient $podio_client, $app_id, $attributes = array(), $silent = false)
98
    {
99
        return $podio_client->put($podio_client->url_with_options("/app/{$app_id}", array('silent' => $silent)), $attributes);
×
100
    }
101

102
    /**
103
     * @see https://developers.podio.com/doc/applications/delete-app-43693
104
     */
105
    public static function delete(PodioClient $podio_client, $app_id, $silent = false)
106
    {
107
        return $podio_client->delete($podio_client->url_with_options("/app/{$app_id}", array('silent' => $silent)));
×
108
    }
109

110
    /**
111
     * @see https://developers.podio.com/doc/applications/install-app-22506
112
     */
113
    public static function install(PodioClient $podio_client, $app_id, $attributes = array())
114
    {
115
        $body = $podio_client->post("/app/{$app_id}/install", $attributes)->json_body();
×
116
        return $body['app_id'];
×
117
    }
118

119
    /**
120
     * @see https://developers.podio.com/doc/applications/update-app-order-22463
121
     */
122
    public static function update_org(PodioClient $podio_client, $space_id, $attributes = array())
123
    {
124
        return $podio_client->put("/app/space/{$space_id}/order", $attributes);
×
125
    }
126

127
    /**
128
     * @see https://developers.podio.com/doc/applications/activate-app-43822
129
     */
130
    public static function activate(PodioClient $podio_client, $app_id)
131
    {
132
        return $podio_client->post("/app/{$app_id}/activate");
×
133
    }
134

135
    /**
136
     * @see https://developers.podio.com/doc/applications/deactivate-app-43821
137
     */
138
    public static function deactivate(PodioClient $podio_client, $app_id)
139
    {
140
        return $podio_client->post("/app/{$app_id}/deactivate");
×
141
    }
142

143
    /**
144
     * @see https://developers.podio.com/doc/applications/get-calculations-for-app-773005
145
     */
146
    public static function calculations(PodioClient $podio_client, $app_id)
147
    {
148
        return self::listing($podio_client->get("/app/{$app_id}/calculation/"));
×
149
    }
150

151
    /**
152
     * @see https://developers.podio.com/doc/applications/get-features-43648
153
     */
154
    public static function features(PodioClient $podio_client, $attributes = array())
155
    {
156
        return $podio_client->get("/app/features/")->json_body();
×
157
    }
158

159
    /**
160
     * @see https://developers.podio.com/doc/applications/get-app-dependencies-39159
161
     */
162
    public static function dependencies(PodioClient $podio_client, $app_id)
163
    {
164
        $result = $podio_client->get("/app/{$app_id}/dependencies/")->json_body();
×
165
        $result['apps'] = self::listing($result['apps']);
×
166
        return $result;
×
167
    }
168

169
    /**
170
     * @see https://developers.podio.com/doc/applications/get-space-app-dependencies-45779
171
     */
172
    public static function dependencies_space(PodioClient $podio_client, $space_id)
173
    {
174
        $result = $podio_client->get("/space/{$space_id}/dependencies/")->json_body();
×
175
        $result['apps'] = self::listing($result['apps']);
×
176
        return $result;
×
177
    }
178

179
    /**
180
     * Activate app in space. Only applicable to Platform
181
     */
182
    public static function activate_for_space(PodioClient $podio_client, $app_id, $space_id, $attributes = array())
183
    {
184
        return $podio_client->put("/app/{$app_id}/activate/{$space_id}", $attributes);
×
185
    }
186
}
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