Failed Conditions
Push — master ( 81ead6...837ea5 )
by
unknown
13:08
created

AdsInsightsFields::getFieldTypes()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 91
Code Lines 89

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 91
rs 8.518
cc 1
eloc 89
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
4
 *
5
 * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
 * use, copy, modify, and distribute this software in source code or binary
7
 * form for use in connection with the web services and APIs provided by
8
 * Facebook.
9
 *
10
 * As with any software that integrates with the Facebook platform, your use
11
 * of this software is subject to the Facebook Developer Principles and
12
 * Policies [http://developers.facebook.com/policy/]. This copyright notice
13
 * shall be included in all copies or substantial portions of the software.
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
 * DEALINGS IN THE SOFTWARE.
22
 *
23
 */
24
25
namespace FacebookAds\Object\Fields;
26
27
use FacebookAds\Enum\AbstractEnum;
28
29
/**
30
 * This class is auto-genereated.
31
 *
32
 * For any issues or feature requests related to this class, please let us know
33
 * on github and we'll fix in our codegen framework. We'll not be able to accept
34
 * pull request for this class.
35
 *
36
 */
37
38
class AdsInsightsFields extends AbstractEnum {
39
40
  const ACCOUNT_ID = 'account_id';
41
  const ACCOUNT_NAME = 'account_name';
42
  const ACTION_VALUES = 'action_values';
43
  const ACTIONS = 'actions';
44
  const AD_ID = 'ad_id';
45
  const AD_NAME = 'ad_name';
46
  const ADSET_ID = 'adset_id';
47
  const ADSET_NAME = 'adset_name';
48
  const AGE = 'age';
49
  const APP_STORE_CLICKS = 'app_store_clicks';
50
  const BUYING_TYPE = 'buying_type';
51
  const CALL_TO_ACTION_CLICKS = 'call_to_action_clicks';
52
  const CAMPAIGN_ID = 'campaign_id';
53
  const CAMPAIGN_NAME = 'campaign_name';
54
  const CANVAS_AVG_VIEW_PERCENT = 'canvas_avg_view_percent';
55
  const CANVAS_AVG_VIEW_TIME = 'canvas_avg_view_time';
56
  const CLICKS = 'clicks';
57
  const COST_PER_10_SEC_VIDEO_VIEW = 'cost_per_10_sec_video_view';
58
  const COST_PER_ACTION_TYPE = 'cost_per_action_type';
59
  const COST_PER_ESTIMATED_AD_RECALLERS = 'cost_per_estimated_ad_recallers';
60
  const COST_PER_INLINE_LINK_CLICK = 'cost_per_inline_link_click';
61
  const COST_PER_INLINE_POST_ENGAGEMENT = 'cost_per_inline_post_engagement';
62
  const COST_PER_TOTAL_ACTION = 'cost_per_total_action';
63
  const COST_PER_UNIQUE_ACTION_TYPE = 'cost_per_unique_action_type';
64
  const COST_PER_UNIQUE_CLICK = 'cost_per_unique_click';
65
  const COST_PER_UNIQUE_INLINE_LINK_CLICK = 'cost_per_unique_inline_link_click';
66
  const COUNTRY = 'country';
67
  const CPC = 'cpc';
68
  const CPM = 'cpm';
69
  const CPP = 'cpp';
70
  const CTR = 'ctr';
71
  const DATE_START = 'date_start';
72
  const DATE_STOP = 'date_stop';
73
  const DEEPLINK_CLICKS = 'deeplink_clicks';
74
  const ESTIMATED_AD_RECALL_RATE = 'estimated_ad_recall_rate';
75
  const ESTIMATED_AD_RECALLERS = 'estimated_ad_recallers';
76
  const FREQUENCY = 'frequency';
77
  const FREQUENCY_VALUE = 'frequency_value';
78
  const GENDER = 'gender';
79
  const HOURLY_STATS_AGGREGATED_BY_ADVERTISER_TIME_ZONE = 'hourly_stats_aggregated_by_advertiser_time_zone';
80
  const HOURLY_STATS_AGGREGATED_BY_AUDIENCE_TIME_ZONE = 'hourly_stats_aggregated_by_audience_time_zone';
81
  const IMPRESSION_DEVICE = 'impression_device';
82
  const IMPRESSIONS = 'impressions';
83
  const INLINE_LINK_CLICK_CTR = 'inline_link_click_ctr';
84
  const INLINE_LINK_CLICKS = 'inline_link_clicks';
85
  const INLINE_POST_ENGAGEMENT = 'inline_post_engagement';
86
  const NEWSFEED_AVG_POSITION = 'newsfeed_avg_position';
87
  const NEWSFEED_CLICKS = 'newsfeed_clicks';
88
  const NEWSFEED_IMPRESSIONS = 'newsfeed_impressions';
89
  const OBJECTIVE = 'objective';
90
  const PLACE_PAGE_ID = 'place_page_id';
91
  const PLACE_PAGE_NAME = 'place_page_name';
92
  const PLACEMENT = 'placement';
93
  const PRODUCT_ID = 'product_id';
94
  const REACH = 'reach';
95
  const REGION = 'region';
96
  const RELEVANCE_SCORE = 'relevance_score';
97
  const SOCIAL_CLICKS = 'social_clicks';
98
  const SOCIAL_IMPRESSIONS = 'social_impressions';
99
  const SOCIAL_REACH = 'social_reach';
100
  const SOCIAL_SPEND = 'social_spend';
101
  const SPEND = 'spend';
102
  const TOTAL_ACTION_VALUE = 'total_action_value';
103
  const TOTAL_ACTIONS = 'total_actions';
104
  const TOTAL_UNIQUE_ACTIONS = 'total_unique_actions';
105
  const UNIQUE_ACTIONS = 'unique_actions';
106
  const UNIQUE_CLICKS = 'unique_clicks';
107
  const UNIQUE_CTR = 'unique_ctr';
108
  const UNIQUE_IMPRESSIONS = 'unique_impressions';
109
  const UNIQUE_INLINE_LINK_CLICK_CTR = 'unique_inline_link_click_ctr';
110
  const UNIQUE_INLINE_LINK_CLICKS = 'unique_inline_link_clicks';
111
  const UNIQUE_LINK_CLICKS_CTR = 'unique_link_clicks_ctr';
112
  const UNIQUE_SOCIAL_CLICKS = 'unique_social_clicks';
113
  const UNIQUE_SOCIAL_IMPRESSIONS = 'unique_social_impressions';
114
  const VIDEO_10_SEC_WATCHED_ACTIONS = 'video_10_sec_watched_actions';
115
  const VIDEO_15_SEC_WATCHED_ACTIONS = 'video_15_sec_watched_actions';
116
  const VIDEO_30_SEC_WATCHED_ACTIONS = 'video_30_sec_watched_actions';
117
  const VIDEO_AVG_PCT_WATCHED_ACTIONS = 'video_avg_pct_watched_actions';
118
  const VIDEO_AVG_SEC_WATCHED_ACTIONS = 'video_avg_sec_watched_actions';
119
  const VIDEO_COMPLETE_WATCHED_ACTIONS = 'video_complete_watched_actions';
120
  const VIDEO_P100_WATCHED_ACTIONS = 'video_p100_watched_actions';
121
  const VIDEO_P25_WATCHED_ACTIONS = 'video_p25_watched_actions';
122
  const VIDEO_P50_WATCHED_ACTIONS = 'video_p50_watched_actions';
123
  const VIDEO_P75_WATCHED_ACTIONS = 'video_p75_watched_actions';
124
  const VIDEO_P95_WATCHED_ACTIONS = 'video_p95_watched_actions';
125
  const WEBSITE_CLICKS = 'website_clicks';
126
  const WEBSITE_CTR = 'website_ctr';
127
128
  public function getFieldTypes() {
129
    return array(
130
      'account_id' => 'string',
131
      'account_name' => 'string',
132
      'action_values' => 'list<AdsActionStats>',
133
      'actions' => 'list<AdsActionStats>',
134
      'ad_id' => 'string',
135
      'ad_name' => 'string',
136
      'adset_id' => 'string',
137
      'adset_name' => 'string',
138
      'age' => 'string',
139
      'app_store_clicks' => 'unsigned int',
140
      'buying_type' => 'string',
141
      'call_to_action_clicks' => 'unsigned int',
142
      'campaign_id' => 'string',
143
      'campaign_name' => 'string',
144
      'canvas_avg_view_percent' => 'float',
145
      'canvas_avg_view_time' => 'float',
146
      'clicks' => 'unsigned int',
147
      'cost_per_10_sec_video_view' => 'list<AdsActionStats>',
148
      'cost_per_action_type' => 'list<AdsActionStats>',
149
      'cost_per_estimated_ad_recallers' => 'float',
150
      'cost_per_inline_link_click' => 'float',
151
      'cost_per_inline_post_engagement' => 'float',
152
      'cost_per_total_action' => 'float',
153
      'cost_per_unique_action_type' => 'list<AdsActionStats>',
154
      'cost_per_unique_click' => 'float',
155
      'cost_per_unique_inline_link_click' => 'float',
156
      'country' => 'string',
157
      'cpc' => 'float',
158
      'cpm' => 'float',
159
      'cpp' => 'float',
160
      'ctr' => 'float',
161
      'date_start' => 'string',
162
      'date_stop' => 'string',
163
      'deeplink_clicks' => 'unsigned int',
164
      'estimated_ad_recall_rate' => 'float',
165
      'estimated_ad_recallers' => 'unsigned int',
166
      'frequency' => 'float',
167
      'frequency_value' => 'string',
168
      'gender' => 'string',
169
      'hourly_stats_aggregated_by_advertiser_time_zone' => 'string',
170
      'hourly_stats_aggregated_by_audience_time_zone' => 'string',
171
      'impression_device' => 'string',
172
      'impressions' => 'string',
173
      'inline_link_click_ctr' => 'float',
174
      'inline_link_clicks' => 'unsigned int',
175
      'inline_post_engagement' => 'unsigned int',
176
      'newsfeed_avg_position' => 'float',
177
      'newsfeed_clicks' => 'unsigned int',
178
      'newsfeed_impressions' => 'unsigned int',
179
      'objective' => 'string',
180
      'place_page_id' => 'string',
181
      'place_page_name' => 'string',
182
      'placement' => 'string',
183
      'product_id' => 'string',
184
      'reach' => 'unsigned int',
185
      'region' => 'string',
186
      'relevance_score' => 'AdgroupRelevanceScore',
187
      'social_clicks' => 'unsigned int',
188
      'social_impressions' => 'Object',
189
      'social_reach' => 'unsigned int',
190
      'social_spend' => 'float',
191
      'spend' => 'float',
192
      'total_action_value' => 'float',
193
      'total_actions' => 'unsigned int',
194
      'total_unique_actions' => 'unsigned int',
195
      'unique_actions' => 'list<AdsActionStats>',
196
      'unique_clicks' => 'unsigned int',
197
      'unique_ctr' => 'float',
198
      'unique_impressions' => 'unsigned int',
199
      'unique_inline_link_click_ctr' => 'float',
200
      'unique_inline_link_clicks' => 'unsigned int',
201
      'unique_link_clicks_ctr' => 'float',
202
      'unique_social_clicks' => 'unsigned int',
203
      'unique_social_impressions' => 'unsigned int',
204
      'video_10_sec_watched_actions' => 'list<AdsActionStats>',
205
      'video_15_sec_watched_actions' => 'list<AdsActionStats>',
206
      'video_30_sec_watched_actions' => 'list<AdsActionStats>',
207
      'video_avg_pct_watched_actions' => 'list<AdsActionStats>',
208
      'video_avg_sec_watched_actions' => 'list<AdsActionStats>',
209
      'video_complete_watched_actions' => 'list<AdsActionStats>',
210
      'video_p100_watched_actions' => 'list<AdsActionStats>',
211
      'video_p25_watched_actions' => 'list<AdsActionStats>',
212
      'video_p50_watched_actions' => 'list<AdsActionStats>',
213
      'video_p75_watched_actions' => 'list<AdsActionStats>',
214
      'video_p95_watched_actions' => 'list<AdsActionStats>',
215
      'website_clicks' => 'unsigned int',
216
      'website_ctr' => 'list<AdsActionStats>',
217
    );
218
  }
219
}
220