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
Push — develop ( d64251...3e21ba )
by Alexandru
02:18
created

User::emails()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
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;
13
14
use Buzz\Message\MessageInterface;
15
16
/**
17
 * Manages the currently authenticated account profile.
18
 *
19
 * @author  Alexandru G.    <[email protected]>
20
 */
21
class User extends Api
22
{
23
    /**
24
     * Get user profile
25
     *
26
     * @access public
27
     * @return MessageInterface
28
     */
29 1
    public function get()
30
    {
31 1
        return $this->requestGet('user/');
32
    }
33
34
    /**
35
     * Update user
36
     *
37
     * @access public
38
     * @param  array            $options Filed->value pair of account settings
39
     * @return MessageInterface
40
     *
41
     * @see https://confluence.atlassian.com/display/BITBUCKET/user+Endpoint#userEndpoint-Updateauser
42
     */
43 1
    public function update(array $options)
44
    {
45 1
        return $this->requestPut('user/', $options);
46
    }
47
48
    /**
49
     * Get a list of user privileges
50
     *
51
     * @access public
52
     * @return MessageInterface
53
     */
54 1
    public function privileges()
55
    {
56 1
        return $this->requestGet('user/privileges');
57
    }
58
59
    /**
60
     * Get a list of repositories an account follows
61
     *
62
     * @access public
63
     * @return MessageInterface
64
     */
65 1
    public function follows()
66
    {
67 1
        return $this->requestGet('user/follows');
68
    }
69
70
    /**
71
     * Get repositories
72
     *
73
     * @access public
74
     * @return User\Repositories
75
     * @codeCoverageIgnore
76
     */
77
    public function repositories()
78
    {
79
        return $this->childFactory('User\\Repositories');
80
    }
81
82
    /**
83
     * Retrieves the email for an authenticated user.
84
     *
85
     * @access public
86
     * @return MessageInterface
87
     *
88
     * @throws \InvalidArgumentException
89
     */
90 1
    public function emails()
91
    {
92 1
        return $this->getClient()->setApiVersion('2.0')->get('user/emails');
93
    }
94
}
95