Notification Setup Error

We have detected an error in your notification set-up (Event-ID dab39dc24f564ec7bd4628d1305fd03c). Currently, we cannot inform you about inspection progress. Please check that the user 557058:bca11929-8c2d-43f2-8a82-c5416880d395 still has access to your repository or update the API account.

Invitations   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of the bitbucket-api package.
5
 *
6
 * (c) Alexandru G. <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Bitbucket\API;
13
14
use Psr\Http\Message\ResponseInterface;
15
16
/**
17
 * Allows repository administrators to send email invitations to
18
 * grant read, write, or admin privileges to a repository.
19
 *
20
 * @author  Alexandru G.    <[email protected]>
21
 * @see https://confluence.atlassian.com/bitbucket/invitations-endpoint-296093147.html
22
 */
23
class Invitations extends Api
24
{
25
    /**
26
     * Sending an invite
27
     *
28
     * @access public
29
     * @param  string           $account    The team or individual account.
30
     * @param  string           $repo       A repository belonging to the account.
31
     * @param  string           $email      The email recipient.
32
     * @param  string           $permission The permission the recipient is granted.
33
     * @return ResponseInterface
34 1
     */
35
    public function send($account, $repo, $email, $permission)
36 1
    {
37 1
        return $this->getClient()->setApiVersion('1.0')->post(
38 1
            sprintf('/invitations/%s/%s', $account, $repo),
39
            ['permission' => $permission, 'email' => $email]
40
        );
41
    }
42
}
43