Pin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 110
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 110
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fields() 0 17 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 pin.
18
 *
19
 * @author Hans Ott <[email protected]>
20
 */
21
final class Pin implements BaseObject
22
{
23
    /**
24
     * The required fields.
25
     *
26
     * @return array The required fields.
27
     */
28 12
    public static function fields()
29
    {
30
        return array(
31 12
            'id',
32 6
            'link',
33 6
            'url',
34 6
            'board',
35 6
            'created_at',
36 6
            'note',
37 6
            'color',
38 6
            'counts',
39 6
            'media',
40 6
            'attribution',
41 6
            'image',
42 6
            'metadata',
43 6
        );
44
    }
45
46
    /**
47
     * The Pin's id.
48
     *
49
     * @var string
50
     * @required
51
     */
52
    public $id;
53
54
    /**
55
     * The URL of the web page where the Pin was created.
56
     *
57
     * @var string
58
     */
59
    public $link;
60
61
    /**
62
     * The url to the object on pinterest.
63
     *
64
     * @var string
65
     */
66
    public $url;
67
68
    /**
69
     * The board the Pin is in.
70
     *
71
     * @var Board
72
     */
73
    public $board;
74
75
    /**
76
     * ISO 8601 Timestamp of creation date.
77
     *
78
     * @var \DateTime
79
     */
80
    public $created_at;
81
82
    /**
83
     * The description of the Pin by the creator.
84
     *
85
     * @var string
86
     */
87
    public $note;
88
89
    /**
90
     * The dominant color of the Pin image.
91
     *
92
     * @var string
93
     */
94
    public $color;
95
96
    /**
97
     * The stats/counts of the Pin (saves and comments).
98
     *
99
     * @var Stats
100
     */
101
    public $counts;
102
103
    /**
104
     * Information about the media type, including whether it's an "image" or "video".
105
     *
106
     * @var array
107
     */
108
    public $media;
109
110
    /**
111
     * Attribution information.
112
     *
113
     * @var array
114
     */
115
    public $attribution;
116
117
    /**
118
     * The images that represents the Pin. This is determined by the request.
119
     *
120
     * @var array
121
     */
122
    public $image;
123
124
    /**
125
     * Extra information including Pin type (recipe, article, etc.) and related data (ingredients, author, etc).
126
     *
127
     * @var array
128
     */
129
    public $metadata;
130
}
131