Failed Conditions
Pull Request — master (#191)
by Emanuele
03:09
created
src/FacebookAds/Object/Business.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      * @param array $params
59 59
      * @return Cursor
60 60
      */
61
-    public function getAdAccounts($fields=array(), $params=array())
61
+    public function getAdAccounts($fields = array(), $params = array())
62 62
     {
63 63
         return $this->getManyByConnection(
64 64
             BusinessAdAccount::className(), $fields, $params, 'adaccounts');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @param array $params
70 70
      * @return Cursor
71 71
      */
72
-    public function getUserPermissions($fields=array(), $params=array())
72
+    public function getUserPermissions($fields = array(), $params = array())
73 73
     {
74 74
         return $this->getManyByConnection(
75 75
             UserPermission::className(), $fields, $params, 'userpermissions');
Please login to merge, or discard this patch.
Braces   +25 added lines, -50 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
 use FacebookAds\Object\Traits\CannotDelete;
32 32
 use FacebookAds\Object\Traits\FieldValidation;
33 33
 
34
-class Business extends AbstractCrudObject
35
-{
34
+class Business extends AbstractCrudObject {
36 35
     use FieldValidation;
37 36
     use CannotCreate;
38 37
     use CannotDelete;
@@ -40,16 +39,14 @@  discard block
 block discarded – undo
40 39
     /**
41 40
      * @return string
42 41
      */
43
-    protected function getEndpoint()
44
-    {
42
+    protected function getEndpoint() {
45 43
         return 'businesses';
46 44
     }
47 45
 
48 46
     /**
49 47
      * @return BusinessFields
50 48
      */
51
-    public static function getFieldsEnum()
52
-    {
49
+    public static function getFieldsEnum() {
53 50
         return BusinessFields::getInstance();
54 51
     }
55 52
 
@@ -58,8 +55,7 @@  discard block
 block discarded – undo
58 55
      * @param array $params
59 56
      * @return Cursor
60 57
      */
61
-    public function getAdAccounts($fields=array(), $params=array())
62
-    {
58
+    public function getAdAccounts($fields=array(), $params=array()) {
63 59
         return $this->getManyByConnection(
64 60
             BusinessAdAccount::className(), $fields, $params, 'adaccounts');
65 61
     }
@@ -69,8 +65,7 @@  discard block
 block discarded – undo
69 65
      * @param array $params
70 66
      * @return Cursor
71 67
      */
72
-    public function getUserPermissions($fields=array(), $params=array())
73
-    {
68
+    public function getUserPermissions($fields=array(), $params=array()) {
74 69
         return $this->getManyByConnection(
75 70
             UserPermission::className(), $fields, $params, 'userpermissions');
76 71
     }
@@ -79,8 +74,7 @@  discard block
 block discarded – undo
79 74
      * @param int $user_id
80 75
      * @param string $role
81 76
      */
82
-    public function addUserPermissionById($user_id, $role)
83
-    {
77
+    public function addUserPermissionById($user_id, $role) {
84 78
         $params = array(
85 79
             'user' => $user_id,
86 80
             'role' => $role,
@@ -94,8 +88,7 @@  discard block
 block discarded – undo
94 88
     /**
95 89
      * @param int $user_id
96 90
      */
97
-    public function deleteUserPermissionById($user_id)
98
-    {
91
+    public function deleteUserPermissionById($user_id) {
99 92
         $params = array(
100 93
             'user' => $user_id,
101 94
         );
@@ -109,8 +102,7 @@  discard block
 block discarded – undo
109 102
      * @param int $email
110 103
      * @param string $role
111 104
      */
112
-    public function inviteUserByEmail($email, $role)
113
-    {
105
+    public function inviteUserByEmail($email, $role) {
114 106
         $params = array(
115 107
             'email' => $email,
116 108
             'role' => $role,
@@ -124,8 +116,7 @@  discard block
 block discarded – undo
124 116
     /**
125 117
      * @param int $email
126 118
      */
127
-    public function deleteUserByEmail($email)
128
-    {
119
+    public function deleteUserByEmail($email) {
129 120
         $params = array(
130 121
             'email' => $email,
131 122
         );
@@ -140,8 +131,7 @@  discard block
 block discarded – undo
140 131
      * @param string $access_type
141 132
      * @param array $roles
142 133
      */
143
-    public function claimAdAccount($account_id, $access_type, $roles = array())
144
-    {
134
+    public function claimAdAccount($account_id, $access_type, $roles = array()) {
145 135
         $params = array(
146 136
             'adaccount_id' => $account_id,
147 137
             'access_type' => $access_type,
@@ -160,8 +150,7 @@  discard block
 block discarded – undo
160 150
     /**
161 151
      * @param int $account_id
162 152
      */
163
-    public function deleteAdAccount($account_id)
164
-    {
153
+    public function deleteAdAccount($account_id) {
165 154
         $params = array(
166 155
             'adaccount_id' => $account_id,
167 156
         );
@@ -172,8 +161,7 @@  discard block
 block discarded – undo
172 161
             $params);
173 162
     }
174 163
 
175
-    public function claimApp($app_id, $access_type, $roles = array())
176
-    {
164
+    public function claimApp($app_id, $access_type, $roles = array()) {
177 165
         $params = array(
178 166
             'app_id' => $app_id,
179 167
             'access_type' => $access_type,
@@ -192,8 +180,7 @@  discard block
 block discarded – undo
192 180
     /**
193 181
      * @param int $app_id
194 182
      */
195
-    public function deleteApp($app_id)
196
-    {
183
+    public function deleteApp($app_id) {
197 184
         $params = array(
198 185
             'app_id' => $app_id,
199 186
         );
@@ -203,8 +190,7 @@  discard block
 block discarded – undo
203 190
             $params);
204 191
     }
205 192
 
206
-    public function claimPage($page_id, $access_type, $roles = array())
207
-    {
193
+    public function claimPage($page_id, $access_type, $roles = array()) {
208 194
         $params = array(
209 195
             'page_id' => $page_id,
210 196
             'access_type' => $access_type,
@@ -223,8 +209,7 @@  discard block
 block discarded – undo
223 209
     /**
224 210
      * @param int $page_id
225 211
      */
226
-    public function deletePage($page_id)
227
-    {
212
+    public function deletePage($page_id) {
228 213
         $params = array(
229 214
             'page_id' => $page_id,
230 215
         );
@@ -240,8 +225,7 @@  discard block
 block discarded – undo
240 225
      * @return Cursor
241 226
      */
242 227
     public function getProjects(
243
-        array $fields = array(), array $params = array())
244
-    {
228
+        array $fields = array(), array $params = array()) {
245 229
         return $this->getManyByConnection(
246 230
             Project::className(), $fields, $params);
247 231
     }
@@ -252,8 +236,7 @@  discard block
 block discarded – undo
252 236
      * @return Cursor
253 237
      */
254 238
     public function getPages(
255
-        array $fields = array(), array $params = array())
256
-    {
239
+        array $fields = array(), array $params = array()) {
257 240
         return $this->getManyByConnection(
258 241
             Page::className(), $fields, $params);
259 242
     }
@@ -263,8 +246,7 @@  discard block
 block discarded – undo
263 246
      * @param array $params
264 247
      * @return Cursor
265 248
      */
266
-    public function getApps(array $fields = array(), array $params = array())
267
-    {
249
+    public function getApps(array $fields = array(), array $params = array()) {
268 250
         return $this->getManyByConnection(
269 251
             App::className(), $fields, $params, 'apps');
270 252
     }
@@ -274,8 +256,7 @@  discard block
 block discarded – undo
274 256
      * @param array $params
275 257
      * @return Cursor
276 258
      */
277
-    public function getClients(array $fields = array(), array $params = array())
278
-    {
259
+    public function getClients(array $fields = array(), array $params = array()) {
279 260
         return $this->getManyByConnection(
280 261
             Client::className(), $fields, $params, 'clients');
281 262
     }
@@ -286,8 +267,7 @@  discard block
 block discarded – undo
286 267
      * @return Cursor
287 268
      */
288 269
     public function getAgencies(
289
-        array $fields = array(), array $params = array())
290
-    {
270
+        array $fields = array(), array $params = array()) {
291 271
         return $this->getManyByConnection(
292 272
             Agency::className(), $fields, $params, 'agencies');
293 273
     }
@@ -298,8 +278,7 @@  discard block
 block discarded – undo
298 278
      * @return Cursor
299 279
      */
300 280
     public function getCreditCards(
301
-        array $fields = array(), array $params = array())
302
-    {
281
+        array $fields = array(), array $params = array()) {
303 282
         return $this->getManyByConnection(
304 283
             CreditCard::className(), $fields, $params, 'creditcards');
305 284
     }
@@ -310,8 +289,7 @@  discard block
 block discarded – undo
310 289
      * @return Cursor
311 290
      */
312 291
     public function getExtendedCredits(
313
-        array $fields = array(), array $params = array())
314
-    {
292
+        array $fields = array(), array $params = array()) {
315 293
         return $this->getManyByConnection(
316 294
             ExtendedCredit::className(), $fields, $params, 'extendedcredits');
317 295
     }
@@ -322,8 +300,7 @@  discard block
 block discarded – undo
322 300
      * @return Cursor
323 301
      */
324 302
     public function getProductCatalogues(
325
-        array $fields = array(), array $params = array())
326
-    {
303
+        array $fields = array(), array $params = array()) {
327 304
         return $this->getManyByConnection(
328 305
             BusinessProductCatalog::className(),
329 306
             $fields,
@@ -337,8 +314,7 @@  discard block
 block discarded – undo
337 314
      * @return Cursor
338 315
      */
339 316
     public function getSystemUsers(
340
-        array $fields = array(), array $params = array())
341
-    {
317
+        array $fields = array(), array $params = array()) {
342 318
         return $this->getManyByConnection(
343 319
             SystemUser::className(), $fields, $params);
344 320
     }
@@ -349,8 +325,7 @@  discard block
 block discarded – undo
349 325
      * @return Cursor
350 326
      */
351 327
     public function getAdsPixels(
352
-        array $fields = array(), array $params = array())
353
-    {
328
+        array $fields = array(), array $params = array()) {
354 329
         return $this->getManyByConnection(
355 330
             AdsPixel::className(), $fields, $params);
356 331
     }
Please login to merge, or discard this patch.
src/FacebookAds/Object/BroadCategoryTargeting.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,6 +24,5 @@
 block discarded – undo
24 24
 
25 25
 namespace FacebookAds\Object;
26 26
 
27
-class BroadCategoryTargeting extends AbstractObject
28
-{
27
+class BroadCategoryTargeting extends AbstractObject {
29 28
 }
Please login to merge, or discard this patch.
src/FacebookAds/Object/AdConversionPixel.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 use FacebookAds\Object\Fields\AdConversionPixelFields;
28 28
 
29
-class AdConversionPixel extends AbstractCrudObject
30
-{
29
+class AdConversionPixel extends AbstractCrudObject {
31 30
     const CHECKOUT = 'checkout';
32 31
     const REGISTRATION = 'registration';
33 32
     const LEAD = 'lead';
@@ -38,16 +37,14 @@  discard block
 block discarded – undo
38 37
     /**
39 38
      * @return string
40 39
      */
41
-    protected function getEndpoint()
42
-    {
40
+    protected function getEndpoint() {
43 41
         return 'offsitepixels';
44 42
     }
45 43
 
46 44
     /**
47 45
      * @return AdConversionPixelFields
48 46
      */
49
-    public static function getFieldsEnum()
50
-    {
47
+    public static function getFieldsEnum() {
51 48
         return AdConversionPixelFields::getInstance();
52 49
     }
53 50
 }
Please login to merge, or discard this patch.
src/FacebookAds/Object/SystemUser.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,29 +29,25 @@
 block discarded – undo
29 29
 use FacebookAds\Object\Traits\CannotDelete;
30 30
 use FacebookAds\Object\Traits\FieldValidation;
31 31
 
32
-class SystemUser extends AbstractCrudObject
33
-{
32
+class SystemUser extends AbstractCrudObject {
34 33
     use FieldValidation;
35 34
     use CannotDelete;
36 35
 
37 36
     /**
38 37
      * @return string
39 38
      */
40
-    protected function getEndpoint()
41
-    {
39
+    protected function getEndpoint() {
42 40
         return 'system_users';
43 41
     }
44 42
 
45 43
     /**
46 44
      * @return SystemUserFields
47 45
      */
48
-    public static function getFieldsEnum()
49
-    {
46
+    public static function getFieldsEnum() {
50 47
         return SystemUserFields::getInstance();
51 48
     }
52 49
 
53
-    public function invalidateAccessTokens()
54
-    {
50
+    public function invalidateAccessTokens() {
55 51
         $this->getApi()->call(
56 52
             '/'.$this->assureId().'/access_tokens',
57 53
             RequestInterface::METHOD_DELETE);
Please login to merge, or discard this patch.
src/FacebookAds/Object/Page.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,13 +27,11 @@  discard block
 block discarded – undo
27 27
 use FacebookAds\Cursor;
28 28
 use FacebookAds\Http\RequestInterface;
29 29
 
30
-class Page extends AbstractCrudObject
31
-{
30
+class Page extends AbstractCrudObject {
32 31
     /**
33 32
      * @return string
34 33
      */
35
-    public function getEndpoint()
36
-    {
34
+    public function getEndpoint() {
37 35
         return 'pages';
38 36
     }
39 37
 
@@ -66,8 +64,7 @@  discard block
 block discarded – undo
66 64
      * @param int $user_id
67 65
      * @param string $role
68 66
      */
69
-    public function addUser($business_id, $user_id, $role)
70
-    {
67
+    public function addUser($business_id, $user_id, $role) {
71 68
         $params = array(
72 69
             'business_id' => $business_id,
73 70
             'user_id' => $user_id,
@@ -85,8 +82,7 @@  discard block
 block discarded – undo
85 82
      * @param int $business_id
86 83
      * @param int $user_id
87 84
      */
88
-    public function deleteUser($business_id, $user_id)
89
-    {
85
+    public function deleteUser($business_id, $user_id) {
90 86
         $params = array(
91 87
             'business_id' => $business_id,
92 88
             'user_id' => $user_id,
@@ -103,8 +99,7 @@  discard block
 block discarded – undo
103 99
      * @param int $business_id
104 100
      * @param array $roles
105 101
      */
106
-    public function grantBusinessAccess($business_id, $roles)
107
-    {
102
+    public function grantBusinessAccess($business_id, $roles) {
108 103
         $params = array(
109 104
             'business' => $business_id,
110 105
             'permitted_roles' => $roles,
@@ -120,8 +115,7 @@  discard block
 block discarded – undo
120 115
     /**
121 116
      * @param int $business_id
122 117
      */
123
-    public function revokeBusinessAccess($business_id)
124
-    {
118
+    public function revokeBusinessAccess($business_id) {
125 119
         $params = array(
126 120
             'business' => $business_id,
127 121
         );
Please login to merge, or discard this patch.
src/FacebookAds/Object/AdsPixelStat.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,13 +26,11 @@
 block discarded – undo
26 26
 
27 27
 use FacebookAds\Object\Fields\AdsPixelStatFields;
28 28
 
29
-class AdsPixelStat extends AbstractObject
30
-{
29
+class AdsPixelStat extends AbstractObject {
31 30
     /**
32 31
      * @return AdsPixelStatFields
33 32
      */
34
-    public static function getFieldsEnum()
35
-    {
33
+    public static function getFieldsEnum() {
36 34
         return AdsPixelStatFields::getInstance();
37 35
     }
38 36
 }
Please login to merge, or discard this patch.
src/FacebookAds/Object/AdImage.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
 use FacebookAds\Object\Traits\CannotUpdate;
32 32
 use FacebookAds\Object\Traits\FieldValidation;
33 33
 
34
-class AdImage extends AbstractCrudObject
35
-{
34
+class AdImage extends AbstractCrudObject {
36 35
     use FieldValidation;
37 36
     use CannotUpdate;
38 37
 
@@ -46,8 +45,7 @@  discard block
 block discarded – undo
46 45
      * @return array
47 46
      */
48 47
     public static function createFromZip(
49
-        $file_path, $account_id, array $params = array(), Api $api = null)
50
-    {
48
+        $file_path, $account_id, array $params = array(), Api $api = null) {
51 49
         $image = new AdImage(null, $account_id, $api);
52 50
         $image->{AdImageFields::FILENAME} = $file_path;
53 51
         return $image->arrayFromZip($params);
@@ -56,24 +54,21 @@  discard block
 block discarded – undo
56 54
     /**
57 55
      * @return string
58 56
      */
59
-    protected function getEndpoint()
60
-    {
57
+    protected function getEndpoint() {
61 58
         return 'adimages';
62 59
     }
63 60
 
64 61
     /**
65 62
      * @return AdImageFields
66 63
      */
67
-    public static function getFieldsEnum()
68
-    {
64
+    public static function getFieldsEnum() {
69 65
         return AdImageFields::getInstance();
70 66
     }
71 67
 
72 68
     /**
73 69
      * @return string
74 70
      */
75
-    protected function getNodePath()
76
-    {
71
+    protected function getNodePath() {
77 72
         return '/'.$this->assureParentId().'/'.$this->getEndpoint();
78 73
     }
79 74
 
@@ -85,8 +80,7 @@  discard block
 block discarded – undo
85 80
      * @throws \Exception
86 81
      * @throws \RuntimeException
87 82
      */
88
-    public function create(array $params = array())
89
-    {
83
+    public function create(array $params = array()) {
90 84
         if ($this->data[static::FIELD_ID]) {
91 85
             throw new \Exception("Object has already an ID");
92 86
         }
@@ -129,8 +123,7 @@  discard block
 block discarded – undo
129 123
      * @param array $params Additional request parameters
130 124
      * @return $this
131 125
      */
132
-    public function read(array $fields = array(), array $params = array())
133
-    {
126
+    public function read(array $fields = array(), array $params = array()) {
134 127
         $fields = implode(',', $fields ?: static::getDefaultReadFields());
135 128
         if ($fields) {
136 129
             $params['fields'] = $fields;
@@ -159,8 +152,7 @@  discard block
 block discarded – undo
159 152
      * @return void
160 153
      * @throws \Exception
161 154
      */
162
-    public function delete(array $params = array())
163
-    {
155
+    public function delete(array $params = array()) {
164 156
         if (!$this->data[AdImageFields::HASH]) {
165 157
             throw new \Exception("AdImage hash is required to delete");
166 158
         }
@@ -178,8 +170,7 @@  discard block
 block discarded – undo
178 170
      * @return array
179 171
      * @throws \RuntimeException
180 172
      */
181
-    protected function arrayFromZip($params = array())
182
-    {
173
+    protected function arrayFromZip($params = array()) {
183 174
         if (!$this->isZipFile($this->data[AdImageFields::FILENAME])) {
184 175
             throw new \RuntimeException(
185 176
                 $this->data[AdImageFields::FILENAME]." doesn't resolve to a zip file");
@@ -220,8 +211,7 @@  discard block
 block discarded – undo
220 211
      * @param string $file_path
221 212
      * @return bool
222 213
      */
223
-    protected function isZipFile($file_path)
224
-    {
214
+    protected function isZipFile($file_path) {
225 215
         $finfo = finfo_open(FILEINFO_MIME_TYPE);
226 216
         $file_mime_type = finfo_file($finfo, $file_path);
227 217
         return $file_mime_type == 'application/zip' ||
Please login to merge, or discard this patch.
src/FacebookAds/Object/Agency.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,6 +24,5 @@
 block discarded – undo
24 24
 
25 25
 namespace FacebookAds\Object;
26 26
 
27
-class Agency extends AbstractObject
28
-{
27
+class Agency extends AbstractObject {
29 28
 }
Please login to merge, or discard this patch.
src/FacebookAds/Object/Transaction.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,6 +24,5 @@
 block discarded – undo
24 24
 
25 25
 namespace FacebookAds\Object;
26 26
 
27
-class Transaction extends AbstractObject
28
-{
27
+class Transaction extends AbstractObject {
29 28
 }
Please login to merge, or discard this patch.