GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Members::update()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Cloudflare\Organizations;
4
5
use Cloudflare\Api;
6
7
/**
8
 * CloudFlare API wrapper
9
 *
10
 * Organization Members
11
 *
12
 * @author James Bell <[email protected]>
13
 *
14
 * @version 1
15
 */
16 View Code Duplication
class Members extends Api
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    /**
19
     * List members (permission needed: #organization:read)
20
     * List all members of a organization
21
     *
22
     * @param string $organization_identifier
23
     */
24
    public function members($organization_identifier)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
25
    {
26
        return $this->get('/organizations/'.$organization_identifier.'/members');
27
    }
28
29
    /**
30
     * Member details (permission needed: #organization:read)
31
     * Get information about a specific member of an organization
32
     *
33
     * @param string $organization_identifier
34
     * @param string $identifier
35
     */
36
    public function details($organization_identifier, $identifier)
37
    {
38
        return $this->get('/organizations/'.$organization_identifier.'/members/'.$identifier);
39
    }
40
41
    /**
42
     * Update member roles (permission needed: #organization:edit)
43
     * Change the Roles of an Organization's Member
44
     *
45
     * @param string     $organization_identifier
46
     * @param string     $identifier
47
     * @param array|null $roles                   Array of Roles associated with this Member
48
     */
49
    public function update($organization_identifier, $identifier, array $roles = null)
50
    {
51
        $data = [
52
            'roles' => $roles,
53
        ];
54
55
        return $this->patch('/organizations/'.$organization_identifier.'/members/'.$identifier, $data);
56
    }
57
58
    /**
59
     * Remove member (permission needed: #organization:edit)
60
     * Remove a member from an organization
61
     *
62
     * @param string $organization_identifier
63
     * @param string $identifier
64
     */
65
    public function delete_member($organization_identifier, $identifier)
66
    {
67
        return $this->delete('/organizations/'.$organization_identifier.'/members/'.$identifier);
68
    }
69
}
70