User::fields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 11
cts 11
cp 1
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Pinterest PHP library.
5
 *
6
 * (c) Hans Ott <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.md.
10
 *
11
 * Source: https://github.com/hansott/pinterest-php
12
 */
13
14
namespace Pinterest\Objects;
15
16
/**
17
 * This class represents a user.
18
 *
19
 * @author Hans Ott <[email protected]>
20
 */
21
final class User implements BaseObject
22
{
23
    /**
24
     * The required fields.
25
     *
26
     * @return array The required fields.
27
     */
28 8
    public static function fields()
29
    {
30
        return array(
31 8
            'id',
32 4
            'username',
33 4
            'first_name',
34 4
            'last_name',
35 4
            'bio',
36 4
            'created_at',
37 4
            'counts',
38 4
            'image',
39 4
            'url',
40 4
        );
41
    }
42
43
    /**
44
     * The user's id.
45
     *
46
     * @var string
47
     * @required
48
     */
49
    public $id;
50
51
    /**
52
     * The user's Pinterest username.
53
     *
54
     * @var string
55
     */
56
    public $username;
57
58
    /**
59
     * The user's first name.
60
     *
61
     * @var string
62
     */
63
    public $first_name;
64
65
    /**
66
     * The user's last name.
67
     *
68
     * @var string
69
     */
70
    public $last_name;
71
72
    /**
73
     * The user's bio.
74
     *
75
     * @var string
76
     */
77
    public $bio;
78
79
    /**
80
     * Timestamp of creation date.
81
     *
82
     * @var \DateTime
83
     */
84
    public $created_at;
85
86
    /**
87
     * The stats/counts of the User (follower Pins, likes, boards).
88
     *
89
     * @var Stats
90
     */
91
    public $counts;
92
93
    /**
94
     * The images that represents the user.
95
     *
96
     * This is determined by the request.
97
     *
98
     * @var array
99
     */
100
    public $image;
101
102
    /**
103
     * The url to the object on pinterest.
104
     *
105
     * @var string
106
     */
107
    public $url;
108
}
109