@@ -25,7 +25,6 @@ |
||
25 | 25 | namespace FacebookAds\Object; |
26 | 26 | |
27 | 27 | use FacebookAds\Api; |
28 | -use FacebookAds\Cursor; |
|
29 | 28 | use FacebookAds\Http\RequestInterface; |
30 | 29 | use FacebookAds\Object\Fields\AdImageFields; |
31 | 30 | use FacebookAds\Object\Traits\CannotUpdate; |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -31,8 +31,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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' || |
@@ -26,8 +26,6 @@ |
||
26 | 26 | |
27 | 27 | use FacebookAds\Http\RequestInterface; |
28 | 28 | use FacebookAds\Object\Fields\AdVideoFields; |
29 | -use FacebookAds\Object\Traits\CannotDelete; |
|
30 | -use FacebookAds\Object\Traits\CannotUpdate; |
|
31 | 29 | use FacebookAds\Object\Traits\FieldValidation; |
32 | 30 | |
33 | 31 | class AdVideo extends AbstractCrudObject { |
@@ -82,7 +82,7 @@ |
||
82 | 82 | /** |
83 | 83 | * @param array $fields |
84 | 84 | * @param array $params |
85 | - * @return Cursor |
|
85 | + * @return \FacebookAds\Cursor |
|
86 | 86 | */ |
87 | 87 | public function getVideoThumbnails( |
88 | 88 | array $fields = array(), array $params = array()) |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -30,28 +30,24 @@ discard block |
||
30 | 30 | use FacebookAds\Object\Traits\CannotUpdate; |
31 | 31 | use FacebookAds\Object\Traits\FieldValidation; |
32 | 32 | |
33 | -class AdVideo extends AbstractCrudObject |
|
34 | -{ |
|
33 | +class AdVideo 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 'advideos'; |
43 | 41 | } |
44 | 42 | |
45 | 43 | /** |
46 | 44 | * @return AdVideoFields |
47 | 45 | */ |
48 | - public static function getFieldsEnum() |
|
49 | - { |
|
46 | + public static function getFieldsEnum() { |
|
50 | 47 | return AdVideoFields::getInstance(); |
51 | 48 | } |
52 | 49 | |
53 | - public function create(array $params = array()) |
|
54 | - { |
|
50 | + public function create(array $params = array()) { |
|
55 | 51 | $data = $this->exportData(); |
56 | 52 | $source = null; |
57 | 53 | if (array_key_exists(AdVideoFields::SOURCE, $data)) { |
@@ -85,8 +81,7 @@ discard block |
||
85 | 81 | * @return Cursor |
86 | 82 | */ |
87 | 83 | public function getVideoThumbnails( |
88 | - array $fields = array(), array $params = array()) |
|
89 | - { |
|
84 | + array $fields = array(), array $params = array()) { |
|
90 | 85 | return $this->getManyByConnection( |
91 | 86 | VideoThumbnail::className(), $fields, $params, 'thumbnails'); |
92 | 87 | } |
@@ -24,7 +24,6 @@ |
||
24 | 24 | |
25 | 25 | namespace FacebookAds\Object; |
26 | 26 | |
27 | -use FacebookAds\Api; |
|
28 | 27 | use FacebookAds\Object\Fields\ProductCatalogFields; |
29 | 28 | use FacebookAds\Object\Traits\FieldValidation; |
30 | 29 | use FacebookAds\Http\RequestInterface; |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -30,23 +30,20 @@ discard block |
||
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 | |
@@ -56,8 +53,7 @@ discard block |
||
56 | 53 | * @return Cursor |
57 | 54 | */ |
58 | 55 | public function getProducts( |
59 | - array $fields = array(), array $params = array()) |
|
60 | - { |
|
56 | + array $fields = array(), array $params = array()) { |
|
61 | 57 | return $this->getManyByConnection( |
62 | 58 | Product::className(), $fields, $params); |
63 | 59 | } |
@@ -68,8 +64,7 @@ discard block |
||
68 | 64 | * @return Cursor |
69 | 65 | */ |
70 | 66 | public function getProductSets( |
71 | - array $fields = array(), array $params = array()) |
|
72 | - { |
|
67 | + array $fields = array(), array $params = array()) { |
|
73 | 68 | return $this->getManyByConnection( |
74 | 69 | ProductSet::className(), $fields, $params); |
75 | 70 | } |
@@ -80,8 +75,7 @@ discard block |
||
80 | 75 | * @return Cursor |
81 | 76 | */ |
82 | 77 | public function getProductFeeds( |
83 | - array $fields = array(), array $params = array()) |
|
84 | - { |
|
78 | + array $fields = array(), array $params = array()) { |
|
85 | 79 | return $this->getManyByConnection( |
86 | 80 | ProductFeed::className(), $fields, $params); |
87 | 81 | } |
@@ -89,8 +83,7 @@ discard block |
||
89 | 83 | /** |
90 | 84 | * @return array |
91 | 85 | */ |
92 | - public function getExternalEventSources() |
|
93 | - { |
|
86 | + public function getExternalEventSources() { |
|
94 | 87 | $response = $this->getApi()->call( |
95 | 88 | '/'.$this->assureId().'/external_event_sources', |
96 | 89 | RequestInterface::METHOD_GET); |
@@ -102,8 +95,7 @@ discard block |
||
102 | 95 | * @param array $pixel_ids |
103 | 96 | * @return bool |
104 | 97 | */ |
105 | - public function setExternalEventSources(array $pixel_ids) |
|
106 | - { |
|
98 | + public function setExternalEventSources(array $pixel_ids) { |
|
107 | 99 | return $this->modifyExternalEventSources( |
108 | 100 | RequestInterface::METHOD_POST, |
109 | 101 | $pixel_ids); |
@@ -113,8 +105,7 @@ discard block |
||
113 | 105 | * @param array $pixel_ids |
114 | 106 | * @return bool |
115 | 107 | */ |
116 | - public function removeExternalEventSources(array $pixel_ids) |
|
117 | - { |
|
108 | + public function removeExternalEventSources(array $pixel_ids) { |
|
118 | 109 | return $this->modifyExternalEventSources( |
119 | 110 | RequestInterface::METHOD_DELETE, |
120 | 111 | $pixel_ids); |
@@ -125,8 +116,7 @@ discard block |
||
125 | 116 | * @param array $pixel_ids |
126 | 117 | * @return bool |
127 | 118 | */ |
128 | - protected function modifyExternalEventSources($method, array $pixel_ids) |
|
129 | - { |
|
119 | + protected function modifyExternalEventSources($method, array $pixel_ids) { |
|
130 | 120 | $params = array( |
131 | 121 | ProductCatalogFields::EXTERNAL_EVENT_SOURCES => $pixel_ids, |
132 | 122 | ); |
@@ -143,8 +133,7 @@ discard block |
||
143 | 133 | * @param int $user_id |
144 | 134 | * @param string $role |
145 | 135 | */ |
146 | - public function addUserPermission($user_id, $role) |
|
147 | - { |
|
136 | + public function addUserPermission($user_id, $role) { |
|
148 | 137 | $params = array( |
149 | 138 | 'user' => $user_id, |
150 | 139 | 'role' => $role, |
@@ -158,8 +147,7 @@ discard block |
||
158 | 147 | /** |
159 | 148 | * @param int $user_id |
160 | 149 | */ |
161 | - public function deleteUserPermission($user_id) |
|
162 | - { |
|
150 | + public function deleteUserPermission($user_id) { |
|
163 | 151 | $params = array( |
164 | 152 | 'user' => $user_id, |
165 | 153 | ); |
@@ -25,7 +25,6 @@ |
||
25 | 25 | namespace FacebookAds\Object; |
26 | 26 | |
27 | 27 | use FacebookAds\Object\Fields\ProductFeedUploadFields; |
28 | -use FacebookAds\Object\Traits\CannotCreate; |
|
29 | 28 | use FacebookAds\Object\Traits\CannotDelete; |
30 | 29 | use FacebookAds\Object\Traits\CannotUpdate; |
31 | 30 | use FacebookAds\Cursor; |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -30,24 +30,21 @@ discard block |
||
30 | 30 | use FacebookAds\Object\Traits\CannotDelete; |
31 | 31 | use FacebookAds\Object\Traits\CannotUpdate; |
32 | 32 | |
33 | -class ProductFeedUpload extends AbstractCrudObject |
|
34 | -{ |
|
33 | +class ProductFeedUpload extends AbstractCrudObject { |
|
35 | 34 | use CannotDelete; |
36 | 35 | use CannotUpdate; |
37 | 36 | |
38 | 37 | /** |
39 | 38 | * @return string |
40 | 39 | */ |
41 | - protected function getEndpoint() |
|
42 | - { |
|
40 | + protected function getEndpoint() { |
|
43 | 41 | return 'uploads'; |
44 | 42 | } |
45 | 43 | |
46 | 44 | /** |
47 | 45 | * @return ProductFeedUploadFields |
48 | 46 | */ |
49 | - public static function getFieldsEnum() |
|
50 | - { |
|
47 | + public static function getFieldsEnum() { |
|
51 | 48 | return ProductFeedUploadFields::getInstance(); |
52 | 49 | } |
53 | 50 | |
@@ -56,8 +53,7 @@ discard block |
||
56 | 53 | * @param array $params |
57 | 54 | * @return Cursor |
58 | 55 | */ |
59 | - public function getErrors(array $fields = array(), array $params = array()) |
|
60 | - { |
|
56 | + public function getErrors(array $fields = array(), array $params = array()) { |
|
61 | 57 | return $this->getManyByConnection( |
62 | 58 | ProductFeedUploadError::className(), $fields, $params); |
63 | 59 | } |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -29,8 +29,7 @@ |
||
29 | 29 | /** |
30 | 30 | * @method static AdAccountFields getInstance() |
31 | 31 | */ |
32 | -class AdAccountFields extends AbstractEnum |
|
33 | -{ |
|
32 | +class AdAccountFields extends AbstractEnum { |
|
34 | 33 | const ACCOUNT_GROUPS = 'account_groups'; |
35 | 34 | const ACCOUNT_ID = 'account_id'; |
36 | 35 | const ACCOUNT_STATUS = 'account_status'; |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -27,15 +27,13 @@ discard block |
||
27 | 27 | use FacebookAds\Http\RequestInterface; |
28 | 28 | use FacebookAds\Http\ResponseInterface; |
29 | 29 | |
30 | -class NullLogger implements LoggerInterface |
|
31 | -{ |
|
30 | +class NullLogger implements LoggerInterface { |
|
32 | 31 | /** |
33 | 32 | * @param string $level |
34 | 33 | * @param string $message |
35 | 34 | * @param array $context |
36 | 35 | */ |
37 | - public function log($level, $message, array $context = array()) |
|
38 | - { |
|
36 | + public function log($level, $message, array $context = array()) { |
|
39 | 37 | } |
40 | 38 | |
41 | 39 | /** |
@@ -43,8 +41,7 @@ discard block |
||
43 | 41 | * @param RequestInterface $request |
44 | 42 | * @param array $context |
45 | 43 | */ |
46 | - public function logRequest($level, RequestInterface $request, array $context = array()) |
|
47 | - { |
|
44 | + public function logRequest($level, RequestInterface $request, array $context = array()) { |
|
48 | 45 | } |
49 | 46 | |
50 | 47 | /** |
@@ -52,7 +49,6 @@ discard block |
||
52 | 49 | * @param ResponseInterface $response |
53 | 50 | * @param array $context |
54 | 51 | */ |
55 | - public function logResponse($level, ResponseInterface $response, array $context = array()) |
|
56 | - { |
|
52 | + public function logResponse($level, ResponseInterface $response, array $context = array()) { |
|
57 | 53 | } |
58 | 54 | } |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | use FacebookAds\Object\Fields\AdAccountGroupAccountFields; |
30 | 30 | use FacebookAds\Object\Traits\FieldValidation; |
31 | 31 | |
32 | -class AdAccountGroupAccount extends AbstractObject |
|
33 | -{ |
|
32 | +class AdAccountGroupAccount extends AbstractObject { |
|
34 | 33 | use FieldValidation; |
35 | 34 | |
36 | 35 | /** |
@@ -47,8 +46,7 @@ discard block |
||
47 | 46 | * @param string $ad_account_group_id |
48 | 47 | * @param Api $api |
49 | 48 | */ |
50 | - public function __construct($ad_account_group_id, Api $api = null) |
|
51 | - { |
|
49 | + public function __construct($ad_account_group_id, Api $api = null) { |
|
52 | 50 | $this->adAccountGroupId = $ad_account_group_id; |
53 | 51 | $this->api = $api; |
54 | 52 | } |
@@ -56,24 +54,21 @@ discard block |
||
56 | 54 | /** |
57 | 55 | * @return AdAccountGroupAccountFields |
58 | 56 | */ |
59 | - public static function getFieldsEnum() |
|
60 | - { |
|
57 | + public static function getFieldsEnum() { |
|
61 | 58 | return AdAccountGroupAccountFields::getInstance(); |
62 | 59 | } |
63 | 60 | |
64 | 61 | /** |
65 | 62 | * @return Api |
66 | 63 | */ |
67 | - public function getApi() |
|
68 | - { |
|
64 | + public function getApi() { |
|
69 | 65 | return $this->api; |
70 | 66 | } |
71 | 67 | |
72 | 68 | /** |
73 | 69 | * @return string |
74 | 70 | */ |
75 | - public function getParentId() |
|
76 | - { |
|
71 | + public function getParentId() { |
|
77 | 72 | return $this->adAccountGroupId; |
78 | 73 | } |
79 | 74 | |
@@ -81,8 +76,7 @@ discard block |
||
81 | 76 | * @param array $params |
82 | 77 | * @return $this |
83 | 78 | */ |
84 | - public function create(array $params = array()) |
|
85 | - { |
|
79 | + public function create(array $params = array()) { |
|
86 | 80 | return $this->save($params); |
87 | 81 | } |
88 | 82 | |
@@ -90,8 +84,7 @@ discard block |
||
90 | 84 | * @param array $params |
91 | 85 | * @return $this |
92 | 86 | */ |
93 | - public function update(array $params = array()) |
|
94 | - { |
|
87 | + public function update(array $params = array()) { |
|
95 | 88 | return $this->save($params); |
96 | 89 | } |
97 | 90 | |
@@ -99,8 +92,7 @@ discard block |
||
99 | 92 | * @return string |
100 | 93 | * @throws \Exception |
101 | 94 | */ |
102 | - protected function assureId() |
|
103 | - { |
|
95 | + protected function assureId() { |
|
104 | 96 | if (!$this->data[AdAccountGroupAccountFields::ACCOUNT_ID]) { |
105 | 97 | throw new \Exception( |
106 | 98 | AdAccountGroupAccountFields::ACCOUNT_ID." field must be set"); |
@@ -113,8 +105,7 @@ discard block |
||
113 | 105 | * @param array $params |
114 | 106 | * @return $this |
115 | 107 | */ |
116 | - public function save(array $params = array()) |
|
117 | - { |
|
108 | + public function save(array $params = array()) { |
|
118 | 109 | $account_data = array('account_ids' => $this->assureId()); |
119 | 110 | |
120 | 111 | $this->getApi()->call( |
@@ -129,8 +120,7 @@ discard block |
||
129 | 120 | * @param array $params |
130 | 121 | * @throws \Exception |
131 | 122 | */ |
132 | - public function delete(array $params = array()) |
|
133 | - { |
|
123 | + public function delete(array $params = array()) { |
|
134 | 124 | $this->getApi()->call( |
135 | 125 | '/'.$this->adAccountGroupId.'/adaccounts/'.$this->assureId(), |
136 | 126 | RequestInterface::METHOD_DELETE, |
@@ -142,8 +132,7 @@ discard block |
||
142 | 132 | /** |
143 | 133 | * @return AdAccount |
144 | 134 | */ |
145 | - public function getAdAccount() |
|
146 | - { |
|
135 | + public function getAdAccount() { |
|
147 | 136 | return new AdAccount( |
148 | 137 | 'act_'.$this->{AdAccountGroupAccountFields::ACCOUNT_ID}); |
149 | 138 | } |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -207,7 +207,7 @@ |
||
207 | 207 | |
208 | 208 | /** |
209 | 209 | * @param array $array |
210 | - * @param mixed $key |
|
210 | + * @param string $key |
|
211 | 211 | * @return mixed |
212 | 212 | */ |
213 | 213 | protected function removeArrayKey(array &$array, $key) |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | use FacebookAds\Http\ResponseInterface; |
30 | 30 | use FacebookAds\Logger\CurlLogger\JsonAwareParameters; |
31 | 31 | |
32 | -class CurlLogger implements LoggerInterface |
|
33 | -{ |
|
32 | +class CurlLogger implements LoggerInterface { |
|
34 | 33 | /** |
35 | 34 | * @var string |
36 | 35 | */ |
@@ -79,16 +78,14 @@ discard block |
||
79 | 78 | /** |
80 | 79 | * @param resource $handle |
81 | 80 | */ |
82 | - public function __construct($handle = null) |
|
83 | - { |
|
81 | + public function __construct($handle = null) { |
|
84 | 82 | $this->handle = is_resource($handle) ? $handle : STDOUT; |
85 | 83 | } |
86 | 84 | |
87 | 85 | /** |
88 | 86 | * @return bool |
89 | 87 | */ |
90 | - public function isJsonPrettyPrint() |
|
91 | - { |
|
88 | + public function isJsonPrettyPrint() { |
|
92 | 89 | return $this->jsonPrettyPrint; |
93 | 90 | } |
94 | 91 | |
@@ -96,8 +93,7 @@ discard block |
||
96 | 93 | * @param bool $json_pretty_print |
97 | 94 | * @return $this |
98 | 95 | */ |
99 | - public function setJsonPrettyPrint($json_pretty_print) |
|
100 | - { |
|
96 | + public function setJsonPrettyPrint($json_pretty_print) { |
|
101 | 97 | $this->jsonPrettyPrint = $json_pretty_print; |
102 | 98 | |
103 | 99 | return $this; |
@@ -107,8 +103,7 @@ discard block |
||
107 | 103 | * @param string $method |
108 | 104 | * @return string |
109 | 105 | */ |
110 | - public static function getMethodFlag($method) |
|
111 | - { |
|
106 | + public static function getMethodFlag($method) { |
|
112 | 107 | switch ($method) { |
113 | 108 | case RequestInterface::METHOD_GET: |
114 | 109 | return static::METHOD_GET_FLAG; |
@@ -126,8 +121,7 @@ discard block |
||
126 | 121 | * @param string $value |
127 | 122 | * @return string |
128 | 123 | */ |
129 | - public static function getParamFlag($method, $value) |
|
130 | - { |
|
124 | + public static function getParamFlag($method, $value) { |
|
131 | 125 | return $method === RequestInterface::METHOD_POST |
132 | 126 | ? static::PARAM_POST_FLAG |
133 | 127 | : (strstr($value, "\n") |
@@ -140,8 +134,7 @@ discard block |
||
140 | 134 | * @param int $indent |
141 | 135 | * @return string |
142 | 136 | */ |
143 | - protected function indent($string, $indent) |
|
144 | - { |
|
137 | + protected function indent($string, $indent) { |
|
145 | 138 | return str_replace("\n", " \n".str_repeat(' ', $indent), $string); |
146 | 139 | } |
147 | 140 | |
@@ -151,8 +144,7 @@ discard block |
||
151 | 144 | * @param bool $is_file |
152 | 145 | * @return string |
153 | 146 | */ |
154 | - protected function processParams(Parameters $params, $method, $is_file) |
|
155 | - { |
|
147 | + protected function processParams(Parameters $params, $method, $is_file) { |
|
156 | 148 | $chunks = array(); |
157 | 149 | if ($this->isJsonPrettyPrint()) { |
158 | 150 | $params = new JsonAwareParameters($params); |
@@ -181,8 +173,7 @@ discard block |
||
181 | 173 | * @param RequestInterface $request |
182 | 174 | * @return string |
183 | 175 | */ |
184 | - protected function processUrl(RequestInterface $request) |
|
185 | - { |
|
176 | + protected function processUrl(RequestInterface $request) { |
|
186 | 177 | return $request->getProtocol().$request->getDomain() |
187 | 178 | .'/v'.$request->getGraphVersion().$request->getPath(); |
188 | 179 | } |
@@ -190,8 +181,7 @@ discard block |
||
190 | 181 | /** |
191 | 182 | * @param string $buffer |
192 | 183 | */ |
193 | - protected function flush($buffer) |
|
194 | - { |
|
184 | + protected function flush($buffer) { |
|
195 | 185 | fwrite($this->handle, $buffer.PHP_EOL.PHP_EOL); |
196 | 186 | } |
197 | 187 | |
@@ -200,8 +190,7 @@ discard block |
||
200 | 190 | * @param string $message |
201 | 191 | * @param array $context |
202 | 192 | */ |
203 | - public function log($level, $message, array $context = array()) |
|
204 | - { |
|
193 | + public function log($level, $message, array $context = array()) { |
|
205 | 194 | // We only care about requests |
206 | 195 | } |
207 | 196 | |
@@ -210,8 +199,7 @@ discard block |
||
210 | 199 | * @param mixed $key |
211 | 200 | * @return mixed |
212 | 201 | */ |
213 | - protected function removeArrayKey(array &$array, $key) |
|
214 | - { |
|
202 | + protected function removeArrayKey(array &$array, $key) { |
|
215 | 203 | if (array_key_exists($key, $array)) { |
216 | 204 | $value = $array[$key]; |
217 | 205 | unset($array[$key]); |
@@ -226,8 +214,7 @@ discard block |
||
226 | 214 | * @param array $params |
227 | 215 | * @return array |
228 | 216 | */ |
229 | - protected function sortParams(array $params) |
|
230 | - { |
|
217 | + protected function sortParams(array $params) { |
|
231 | 218 | $access_token = $this->removeArrayKey($params, 'access_token'); |
232 | 219 | $appsecret_proof = $this->removeArrayKey($params, 'appsecret_proof'); |
233 | 220 | $access_token !== null && $params['access_token'] = $access_token; |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-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 | - */ |
|
3 | + * Copyright (c) 2014-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 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | use FacebookAds\Object\Traits\CannotUpdate; |
32 | 32 | use FacebookAds\Object\Traits\FieldValidation; |
33 | 33 | |
34 | -class AdUser extends AbstractCrudObject |
|
35 | -{ |
|
34 | +class AdUser extends AbstractCrudObject { |
|
36 | 35 | use FieldValidation; |
37 | 36 | use CannotDelete; |
38 | 37 | use CannotCreate; |
@@ -41,16 +40,14 @@ discard block |
||
41 | 40 | /** |
42 | 41 | * @return string |
43 | 42 | */ |
44 | - protected function getEndpoint() |
|
45 | - { |
|
43 | + protected function getEndpoint() { |
|
46 | 44 | return 'users'; |
47 | 45 | } |
48 | 46 | |
49 | 47 | /** |
50 | 48 | * @return AdUserFields |
51 | 49 | */ |
52 | - public static function getFieldsEnum() |
|
53 | - { |
|
50 | + public static function getFieldsEnum() { |
|
54 | 51 | return AdUserFields::getInstance(); |
55 | 52 | } |
56 | 53 | |
@@ -60,8 +57,7 @@ discard block |
||
60 | 57 | * @return Cursor |
61 | 58 | */ |
62 | 59 | public function getAdAccounts( |
63 | - array $fields = array(), array $params = array()) |
|
64 | - { |
|
60 | + array $fields = array(), array $params = array()) { |
|
65 | 61 | return $this->getManyByConnection(AdAccount::className(), $fields, $params); |
66 | 62 | } |
67 | 63 | |
@@ -71,8 +67,7 @@ discard block |
||
71 | 67 | * @return Cursor |
72 | 68 | */ |
73 | 69 | public function getAdAccountGroups( |
74 | - array $fields = array(), array $params = array()) |
|
75 | - { |
|
70 | + array $fields = array(), array $params = array()) { |
|
76 | 71 | return $this->getManyByConnection( |
77 | 72 | AdAccountGroup::className(), |
78 | 73 | $fields, |