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.

Completed
Pull Request — develop ( #56 )
by
unknown
27:17 queued 12:20
created

Emails::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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\Users;
13
14
use Bitbucket\API\Api;
15
use Buzz\Message\MessageInterface;
16
17
/**
18
 * List, change, or create an email address.
19
 *
20
 * @author  Alexandru G.    <[email protected]>
21
 */
22
class Emails extends Api
23
{
24
    /**
25
     * Get a list of user's email addresses
26
     *
27
     * @access public
28
     * @param  string           $account The name of an individual or team account.
29
     * @return MessageInterface
30
     */
31 1
    public function all($account)
32
    {
33 1
        return $this->getClient()->setApiVersion('2.0')->get(
34 1
            sprintf('users/%s/emails', $account)
35
        );
36
    }
37
38
    /**
39
     * Gets an individual email address associated with an account.
40
     *
41
     * This can be used to check if specified email address is primary,
42
     * or if is active.
43
     *
44
     * @access public
45
     * @param  string           $account The name of an individual or team account.
46
     * @param  string           $email   The email address to get.
47
     * @return MessageInterface
48
     */
49 1
    public function get($account, $email)
50
    {
51 1
        return $this->getClient()->setApiVersion('2.0')->get(
52 1
            sprintf('users/%s/emails/%s', $account, $email)
53
        );
54
    }
55
}
56