Root::companies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * FlexiPeeHP - / related functions.
5
 *
6
 * @author     Vítězslav Dvořák <[email protected]>
7
 * @copyright  (C) 2015-2017 Spoje.Net
8
 */
9
10
namespace FlexiPeeHP;
11
12
/**
13
 * Description of Common
14
 *
15
 * @author vitex
16
 */
17
class Root extends RW {
18
19
    /**
20
     * Update HTTPS certificate
21
     * 
22
     * @param string $pem
23
     * 
24
     * @return boolean
25
     */
26
    public function uploadCertificate($pem) {
27
        $this->postFields = $pem;
28
        $this->performRequest('/certificate', 'PUT');
29
        return $this->lastResponseCode == 201;
30
    }
31
32
    /**
33
     * Get availble companies listing
34
     * 
35
     * @param array $condition applay to listing
36
     * 
37
     * @return array
38
     */
39
    public function companies($conditions = []) {
40
        return $this->getFlexiData('/c', $conditions);
41
    }
42
43
}
44