1 | <?php |
||
10 | class WordPress_GitHub_Sync_Payload { |
||
11 | |||
12 | /** |
||
13 | * Application container. |
||
14 | * |
||
15 | * @var WordPress_GitHub_Sync |
||
16 | */ |
||
17 | protected $app; |
||
18 | |||
19 | /** |
||
20 | * Payload data. |
||
21 | * |
||
22 | * @var stdClass |
||
23 | */ |
||
24 | protected $data; |
||
25 | |||
26 | /** |
||
27 | * WordPress_GitHub_Sync_Payload constructor. |
||
28 | * |
||
29 | * @param WordPress_GitHub_Sync $app Application container. |
||
30 | * @param string $raw_data Raw request data. |
||
31 | */ |
||
32 | 5 | public function __construct( WordPress_GitHub_Sync $app, $raw_data ) { |
|
36 | |||
37 | /** |
||
38 | * Returns whether payload should be imported. |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | 4 | public function should_import() { |
|
78 | |||
79 | /** |
||
80 | * Returns the head commit. |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | public function get_commit() { |
||
87 | |||
88 | /** |
||
89 | * Returns the sha of the head commit. |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | 2 | public function get_commit_id() { |
|
96 | |||
97 | /** |
||
98 | * Returns the email address for the commit author. |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | 1 | public function get_author_email() { |
|
105 | |||
106 | /** |
||
107 | * Returns array commits for the payload. |
||
108 | * |
||
109 | * @return array |
||
110 | */ |
||
111 | 1 | public function get_commits() { |
|
114 | |||
115 | /** |
||
116 | * Returns the repository's full name. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function get_repository_name() { |
||
123 | |||
124 | /** |
||
125 | * Returns the payload's commit message. |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | 2 | protected function message() { |
|
132 | } |
||
133 |