Completed
Pull Request — master (#191)
by Emanuele
03:10
created
src/FacebookAds/Object/ProductSet.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,23 +28,20 @@
 block discarded – undo
28 28
 use FacebookAds\Object\Fields\ProductSetFields;
29 29
 use FacebookAds\Object\Traits\FieldValidation;
30 30
 
31
-class ProductSet extends AbstractCrudObject
32
-{
31
+class ProductSet extends AbstractCrudObject {
33 32
     use FieldValidation;
34 33
 
35 34
     /**
36 35
      * @return string
37 36
      */
38
-    protected function getEndpoint()
39
-    {
37
+    protected function getEndpoint() {
40 38
         return 'product_sets';
41 39
     }
42 40
 
43 41
     /**
44 42
      * @return ProductSetFields
45 43
      */
46
-    public static function getFieldsEnum()
47
-    {
44
+    public static function getFieldsEnum() {
48 45
         return ProductSetFields::getInstance();
49 46
     }
50 47
 
Please login to merge, or discard this patch.
src/FacebookAds/Object/ReachFrequencyPrediction.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
 use FacebookAds\Object\Traits\FieldValidation;
30 30
 use FacebookAds\Object\Values\ReachFrequencyPredictionActions;
31 31
 
32
-class ReachFrequencyPrediction extends AbstractCrudObject
33
-{
32
+class ReachFrequencyPrediction extends AbstractCrudObject {
34 33
     use FieldValidation;
35 34
 
36 35
     /**
@@ -46,16 +45,14 @@  discard block
 block discarded – undo
46 45
     /**
47 46
      * @return string
48 47
      */
49
-    protected function getEndpoint()
50
-    {
48
+    protected function getEndpoint() {
51 49
         return 'reachfrequencypredictions';
52 50
     }
53 51
 
54 52
     /**
55 53
      * @return ReachFrequencyPredictionFields
56 54
      */
57
-    public static function getFieldsEnum()
58
-    {
55
+    public static function getFieldsEnum() {
59 56
         return ReachFrequencyPredictionFields::getInstance();
60 57
     }
61 58
 
@@ -95,8 +92,7 @@  discard block
 block discarded – undo
95 92
     /**
96 93
      * @return ReachFrequencyPrediction
97 94
      */
98
-    public function cancel()
99
-    {
95
+    public function cancel() {
100 96
         $params = array(
101 97
             ReachFrequencyPredictionFields::PREDICTION_ID => $this->assureId(),
102 98
             ReachFrequencyPredictionFields::ACTION
Please login to merge, or discard this patch.
src/FacebookAds/Object/AdCreative.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,24 +29,21 @@
 block discarded – undo
29 29
 use FacebookAds\Object\Traits\AdLabelAwareCrudObjectTrait;
30 30
 use FacebookAds\Object\Traits\FieldValidation;
31 31
 
32
-class AdCreative extends AbstractCrudObject
33
-{
32
+class AdCreative extends AbstractCrudObject {
34 33
     use FieldValidation;
35 34
     use AdLabelAwareCrudObjectTrait;
36 35
 
37 36
     /**
38 37
      * @return string
39 38
      */
40
-    protected function getEndpoint()
41
-    {
39
+    protected function getEndpoint() {
42 40
         return 'adcreatives';
43 41
     }
44 42
 
45 43
     /**
46 44
      * @return AdCreativeFields
47 45
      */
48
-    public static function getFieldsEnum()
49
-    {
46
+    public static function getFieldsEnum() {
50 47
         return AdCreativeFields::getInstance();
51 48
     }
52 49
 
Please login to merge, or discard this patch.
src/FacebookAds/Object/ProductFeed.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,23 +28,20 @@  discard block
 block discarded – undo
28 28
 use FacebookAds\Object\Fields\ProductFeedFields;
29 29
 use FacebookAds\Object\Traits\FieldValidation;
30 30
 
31
-class ProductFeed extends AbstractCrudObject
32
-{
31
+class ProductFeed extends AbstractCrudObject {
33 32
     use FieldValidation;
34 33
 
35 34
     /**
36 35
      * @return string
37 36
      */
38
-    protected function getEndpoint()
39
-    {
37
+    protected function getEndpoint() {
40 38
         return 'product_feeds';
41 39
     }
42 40
 
43 41
     /**
44 42
      * @return ProductFeedFields
45 43
      */
46
-    public static function getFieldsEnum()
47
-    {
44
+    public static function getFieldsEnum() {
48 45
         return ProductFeedFields::getInstance();
49 46
     }
50 47
 
@@ -53,8 +50,7 @@  discard block
 block discarded – undo
53 50
      * @param array $params
54 51
      * @return Cursor
55 52
      */
56
-    public function getUploads(array $fields = array(), array $params = array())
57
-    {
53
+    public function getUploads(array $fields = array(), array $params = array()) {
58 54
         return $this->getManyByConnection(ProductFeedUpload::className(), $fields, $params);
59 55
     }
60 56
 
Please login to merge, or discard this patch.
src/FacebookAds/Object/Business.php 1 patch
Braces   +17 added lines, -34 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(BusinessAdAccount::className(), $fields, $params, 'adaccounts');
64 60
     }
65 61
 
@@ -68,8 +64,7 @@  discard block
 block discarded – undo
68 64
      * @param array $params
69 65
      * @return Cursor
70 66
      */
71
-    public function getUserPermissions($fields = array(), $params = array())
72
-    {
67
+    public function getUserPermissions($fields = array(), $params = array()) {
73 68
         return $this->getManyByConnection(UserPermission::className(), $fields, $params, 'userpermissions');
74 69
     }
75 70
 
@@ -77,8 +72,7 @@  discard block
 block discarded – undo
77 72
      * @param int $user_id
78 73
      * @param string $role
79 74
      */
80
-    public function addUserPermissionById($user_id, $role)
81
-    {
75
+    public function addUserPermissionById($user_id, $role) {
82 76
         $params = array(
83 77
             'user' => $user_id,
84 78
             'role' => $role,
@@ -93,8 +87,7 @@  discard block
 block discarded – undo
93 87
     /**
94 88
      * @param int $user_id
95 89
      */
96
-    public function deleteUserPermissionById($user_id)
97
-    {
90
+    public function deleteUserPermissionById($user_id) {
98 91
         $params = array(
99 92
             'user' => $user_id,
100 93
         );
@@ -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,
@@ -125,8 +117,7 @@  discard block
 block discarded – undo
125 117
     /**
126 118
      * @param int $email
127 119
      */
128
-    public function deleteUserByEmail($email)
129
-    {
120
+    public function deleteUserByEmail($email) {
130 121
         $params = array(
131 122
             'email' => $email,
132 123
         );
@@ -142,8 +133,7 @@  discard block
 block discarded – undo
142 133
      * @param string $access_type
143 134
      * @param array $roles
144 135
      */
145
-    public function claimAdAccount($account_id, $access_type, $roles = array())
146
-    {
136
+    public function claimAdAccount($account_id, $access_type, $roles = array()) {
147 137
         $params = array(
148 138
             'adaccount_id' => $account_id,
149 139
             'access_type' => $access_type,
@@ -163,8 +153,7 @@  discard block
 block discarded – undo
163 153
     /**
164 154
      * @param int $account_id
165 155
      */
166
-    public function deleteAdAccount($account_id)
167
-    {
156
+    public function deleteAdAccount($account_id) {
168 157
         $params = array(
169 158
             'adaccount_id' => $account_id,
170 159
         );
@@ -176,8 +165,7 @@  discard block
 block discarded – undo
176 165
         );
177 166
     }
178 167
 
179
-    public function claimApp($app_id, $access_type, $roles = array())
180
-    {
168
+    public function claimApp($app_id, $access_type, $roles = array()) {
181 169
         $params = array(
182 170
             'app_id' => $app_id,
183 171
             'access_type' => $access_type,
@@ -197,8 +185,7 @@  discard block
 block discarded – undo
197 185
     /**
198 186
      * @param int $app_id
199 187
      */
200
-    public function deleteApp($app_id)
201
-    {
188
+    public function deleteApp($app_id) {
202 189
         $params = array(
203 190
             'app_id' => $app_id,
204 191
         );
@@ -209,8 +196,7 @@  discard block
 block discarded – undo
209 196
         );
210 197
     }
211 198
 
212
-    public function claimPage($page_id, $access_type, $roles = array())
213
-    {
199
+    public function claimPage($page_id, $access_type, $roles = array()) {
214 200
         $params = array(
215 201
             'page_id' => $page_id,
216 202
             'access_type' => $access_type,
@@ -230,8 +216,7 @@  discard block
 block discarded – undo
230 216
     /**
231 217
      * @param int $page_id
232 218
      */
233
-    public function deletePage($page_id)
234
-    {
219
+    public function deletePage($page_id) {
235 220
         $params = array(
236 221
             'page_id' => $page_id,
237 222
         );
@@ -271,8 +256,7 @@  discard block
 block discarded – undo
271 256
      * @param array $params
272 257
      * @return Cursor
273 258
      */
274
-    public function getApps(array $fields = array(), array $params = array())
275
-    {
259
+    public function getApps(array $fields = array(), array $params = array()) {
276 260
         return $this->getManyByConnection(App::className(), $fields, $params, 'apps');
277 261
     }
278 262
 
@@ -281,8 +265,7 @@  discard block
 block discarded – undo
281 265
      * @param array $params
282 266
      * @return Cursor
283 267
      */
284
-    public function getClients(array $fields = array(), array $params = array())
285
-    {
268
+    public function getClients(array $fields = array(), array $params = array()) {
286 269
         return $this->getManyByConnection(Client::className(), $fields, $params, 'clients');
287 270
     }
288 271
 
Please login to merge, or discard this patch.
src/FacebookAds/Object/ProductCatalog.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -30,23 +30,20 @@  discard block
 block discarded – undo
30 30
 use FacebookAds\Object\Fields\ProductCatalogFields;
31 31
 use FacebookAds\Object\Traits\FieldValidation;
32 32
 
33
-class ProductCatalog extends AbstractCrudObject
34
-{
33
+class ProductCatalog extends AbstractCrudObject {
35 34
     use FieldValidation;
36 35
 
37 36
     /**
38 37
      * @return string
39 38
      */
40
-    protected function getEndpoint()
41
-    {
39
+    protected function getEndpoint() {
42 40
         return 'product_catalogs';
43 41
     }
44 42
 
45 43
     /**
46 44
      * @return ProductCatalogFields
47 45
      */
48
-    public static function getFieldsEnum()
49
-    {
46
+    public static function getFieldsEnum() {
50 47
         return ProductCatalogFields::getInstance();
51 48
     }
52 49
 
@@ -89,8 +86,7 @@  discard block
 block discarded – undo
89 86
     /**
90 87
      * @return array
91 88
      */
92
-    public function getExternalEventSources()
93
-    {
89
+    public function getExternalEventSources() {
94 90
         $response = $this->getApi()->call(
95 91
             '/'.$this->assureId().'/external_event_sources',
96 92
             RequestInterface::METHOD_GET
@@ -103,8 +99,7 @@  discard block
 block discarded – undo
103 99
      * @param array $pixel_ids
104 100
      * @return bool
105 101
      */
106
-    public function setExternalEventSources(array $pixel_ids)
107
-    {
102
+    public function setExternalEventSources(array $pixel_ids) {
108 103
         return $this->modifyExternalEventSources(
109 104
             RequestInterface::METHOD_POST,
110 105
             $pixel_ids
@@ -115,8 +110,7 @@  discard block
 block discarded – undo
115 110
      * @param array $pixel_ids
116 111
      * @return bool
117 112
      */
118
-    public function removeExternalEventSources(array $pixel_ids)
119
-    {
113
+    public function removeExternalEventSources(array $pixel_ids) {
120 114
         return $this->modifyExternalEventSources(
121 115
             RequestInterface::METHOD_DELETE,
122 116
             $pixel_ids
@@ -128,8 +122,7 @@  discard block
 block discarded – undo
128 122
      * @param array $pixel_ids
129 123
      * @return bool
130 124
      */
131
-    protected function modifyExternalEventSources($method, array $pixel_ids)
132
-    {
125
+    protected function modifyExternalEventSources($method, array $pixel_ids) {
133 126
         $params = array(
134 127
             ProductCatalogFields::EXTERNAL_EVENT_SOURCES => $pixel_ids,
135 128
         );
@@ -147,8 +140,7 @@  discard block
 block discarded – undo
147 140
      * @param int $user_id
148 141
      * @param string $role
149 142
      */
150
-    public function addUserPermission($user_id, $role)
151
-    {
143
+    public function addUserPermission($user_id, $role) {
152 144
         $params = array(
153 145
             'user' => $user_id,
154 146
             'role' => $role,
@@ -163,8 +155,7 @@  discard block
 block discarded – undo
163 155
     /**
164 156
      * @param int $user_id
165 157
      */
166
-    public function deleteUserPermission($user_id)
167
-    {
158
+    public function deleteUserPermission($user_id) {
168 159
         $params = array(
169 160
             'user' => $user_id,
170 161
         );
Please login to merge, or discard this patch.
src/FacebookAds/Object/AdsPixel.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,24 +30,21 @@  discard block
 block discarded – undo
30 30
 use FacebookAds\Object\Traits\CannotDelete;
31 31
 use FacebookAds\Object\Traits\FieldValidation;
32 32
 
33
-class AdsPixel extends AbstractCrudObject
34
-{
33
+class AdsPixel extends AbstractCrudObject {
35 34
     use CannotDelete;
36 35
     use FieldValidation;
37 36
 
38 37
     /**
39 38
      * @return AdsPixelsFields
40 39
      */
41
-    public static function getFieldsEnum()
42
-    {
40
+    public static function getFieldsEnum() {
43 41
         return AdsPixelsFields::getInstance();
44 42
     }
45 43
 
46 44
     /**
47 45
      * @return string
48 46
      */
49
-    protected function getEndpoint()
50
-    {
47
+    protected function getEndpoint() {
51 48
         return 'adspixels';
52 49
     }
53 50
 
@@ -55,8 +52,7 @@  discard block
 block discarded – undo
55 52
      * @param int $business_id
56 53
      * @param string $account_id
57 54
      */
58
-    public function sharePixelWithAdAccount($business_id, $account_id)
59
-    {
55
+    public function sharePixelWithAdAccount($business_id, $account_id) {
60 56
         $this->getApi()->call(
61 57
             '/'.$this->assureId().'/shared_accounts',
62 58
             RequestInterface::METHOD_POST,
@@ -71,8 +67,7 @@  discard block
 block discarded – undo
71 67
      * @param $business_id
72 68
      * @param $account_id
73 69
      */
74
-    public function unsharePixelWithAdAccount($business_id, $account_id)
75
-    {
70
+    public function unsharePixelWithAdAccount($business_id, $account_id) {
76 71
         $this->getApi()->call(
77 72
             '/'.$this->assureId().'/shared_accounts',
78 73
             RequestInterface::METHOD_DELETE,
@@ -87,8 +82,7 @@  discard block
 block discarded – undo
87 82
      * @param int $business_id
88 83
      * @param int $agency_id
89 84
      */
90
-    public function sharePixelWithAgency($business_id, $agency_id)
91
-    {
85
+    public function sharePixelWithAgency($business_id, $agency_id) {
92 86
         $this->getApi()->call(
93 87
             '/'.$this->assureId().'/shared_agencies',
94 88
             RequestInterface::METHOD_POST,
@@ -103,8 +97,7 @@  discard block
 block discarded – undo
103 97
      * @param int $business_id
104 98
      * @param int $agency_id
105 99
      */
106
-    public function unsharePixelWithAgency($business_id, $agency_id)
107
-    {
100
+    public function unsharePixelWithAgency($business_id, $agency_id) {
108 101
         $this->getApi()->call(
109 102
             '/'.$this->assureId().'/shared_agencies',
110 103
             RequestInterface::METHOD_DELETE,
Please login to merge, or discard this patch.