@@ -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\Http\RequestInterface; |
| 30 | 30 | use FacebookAds\Http\ResponseInterface; |
| 31 | 31 | |
| 32 | -abstract class AbstractCrudObject extends AbstractObject |
|
| 33 | -{ |
|
| 32 | +abstract class AbstractCrudObject extends AbstractObject { |
|
| 34 | 33 | /** |
| 35 | 34 | * @var string |
| 36 | 35 | */ |
@@ -61,8 +60,7 @@ discard block |
||
| 61 | 60 | * @param string $parent_id Optional, needed for creating new objects. |
| 62 | 61 | * @param Api $api The Api instance this object should use to make calls |
| 63 | 62 | */ |
| 64 | - public function __construct($id = null, $parent_id = null, Api $api = null) |
|
| 65 | - { |
|
| 63 | + public function __construct($id = null, $parent_id = null, Api $api = null) { |
|
| 66 | 64 | parent::__construct(); |
| 67 | 65 | $this->data[static::FIELD_ID] = $id; |
| 68 | 66 | $this->parentId = $parent_id; |
@@ -72,24 +70,21 @@ discard block |
||
| 72 | 70 | /** |
| 73 | 71 | * @param string $id |
| 74 | 72 | */ |
| 75 | - public function setId($id) |
|
| 76 | - { |
|
| 73 | + public function setId($id) { |
|
| 77 | 74 | $this->data[static::FIELD_ID] = $id; |
| 78 | 75 | } |
| 79 | 76 | |
| 80 | 77 | /** |
| 81 | 78 | * @param string $parent_id |
| 82 | 79 | */ |
| 83 | - public function setParentId($parent_id) |
|
| 84 | - { |
|
| 80 | + public function setParentId($parent_id) { |
|
| 85 | 81 | $this->parentId = $parent_id; |
| 86 | 82 | } |
| 87 | 83 | |
| 88 | 84 | /** |
| 89 | 85 | * @param Api $api The Api instance this object should use to make calls |
| 90 | 86 | */ |
| 91 | - public function setApi(Api $api) |
|
| 92 | - { |
|
| 87 | + public function setApi(Api $api) { |
|
| 93 | 88 | $this->api = static::assureApi($api); |
| 94 | 89 | } |
| 95 | 90 | |
@@ -103,8 +98,7 @@ discard block |
||
| 103 | 98 | * @return Api |
| 104 | 99 | * @throws \InvalidArgumentException |
| 105 | 100 | */ |
| 106 | - protected static function assureApi(Api $instance = null) |
|
| 107 | - { |
|
| 101 | + protected static function assureApi(Api $instance = null) { |
|
| 108 | 102 | $instance = $instance ?: Api::instance(); |
| 109 | 103 | if (!$instance) { |
| 110 | 104 | throw new \InvalidArgumentException( |
@@ -118,8 +112,7 @@ discard block |
||
| 118 | 112 | /** |
| 119 | 113 | * @return string|null |
| 120 | 114 | */ |
| 121 | - public function getParentId() |
|
| 122 | - { |
|
| 115 | + public function getParentId() { |
|
| 123 | 116 | return $this->parentId; |
| 124 | 117 | } |
| 125 | 118 | |
@@ -127,8 +120,7 @@ discard block |
||
| 127 | 120 | * @return string |
| 128 | 121 | * @throws \Exception |
| 129 | 122 | */ |
| 130 | - protected function assureParentId() |
|
| 131 | - { |
|
| 123 | + protected function assureParentId() { |
|
| 132 | 124 | if (!$this->parentId) { |
| 133 | 125 | throw new \Exception("A parent ID is required."); |
| 134 | 126 | } |
@@ -140,8 +132,7 @@ discard block |
||
| 140 | 132 | * @return string |
| 141 | 133 | * @throws \Exception |
| 142 | 134 | */ |
| 143 | - protected function assureId() |
|
| 144 | - { |
|
| 135 | + protected function assureId() { |
|
| 145 | 136 | if (!$this->data[static::FIELD_ID]) { |
| 146 | 137 | throw new \Exception("field '".static::FIELD_ID."' is required."); |
| 147 | 138 | } |
@@ -152,8 +143,7 @@ discard block |
||
| 152 | 143 | /** |
| 153 | 144 | * @return Api |
| 154 | 145 | */ |
| 155 | - public function getApi() |
|
| 156 | - { |
|
| 146 | + public function getApi() { |
|
| 157 | 147 | return $this->api; |
| 158 | 148 | } |
| 159 | 149 | |
@@ -162,8 +152,7 @@ discard block |
||
| 162 | 152 | * |
| 163 | 153 | * @return array Key value pairs of changed variables |
| 164 | 154 | */ |
| 165 | - public function getChangedValues() |
|
| 166 | - { |
|
| 155 | + public function getChangedValues() { |
|
| 167 | 156 | return $this->changedFields; |
| 168 | 157 | } |
| 169 | 158 | |
@@ -172,16 +161,14 @@ discard block |
||
| 172 | 161 | * |
| 173 | 162 | * @return array Array of changed field names |
| 174 | 163 | */ |
| 175 | - public function getChangedFields() |
|
| 176 | - { |
|
| 164 | + public function getChangedFields() { |
|
| 177 | 165 | return array_keys($this->changedFields); |
| 178 | 166 | } |
| 179 | 167 | |
| 180 | 168 | /** |
| 181 | 169 | * Get the values which have changed, converting them to scalars |
| 182 | 170 | */ |
| 183 | - public function exportData() |
|
| 184 | - { |
|
| 171 | + public function exportData() { |
|
| 185 | 172 | $data = array(); |
| 186 | 173 | foreach ($this->changedFields as $key => $val) { |
| 187 | 174 | $data[$key] = $val instanceof AbstractObject ? $val->exportData() : $val; |
@@ -193,8 +180,7 @@ discard block |
||
| 193 | 180 | /** |
| 194 | 181 | * @return void |
| 195 | 182 | */ |
| 196 | - protected function clearHistory() |
|
| 197 | - { |
|
| 183 | + protected function clearHistory() { |
|
| 198 | 184 | $this->changedFields = array(); |
| 199 | 185 | } |
| 200 | 186 | |
@@ -202,8 +188,7 @@ discard block |
||
| 202 | 188 | * @param string $name |
| 203 | 189 | * @param mixed $value |
| 204 | 190 | */ |
| 205 | - public function __set($name, $value) |
|
| 206 | - { |
|
| 191 | + public function __set($name, $value) { |
|
| 207 | 192 | if (!array_key_exists($name, $this->data) |
| 208 | 193 | || $this->data[$name] !== $value) { |
| 209 | 194 | $this->changedFields[$name] = $value; |
@@ -214,24 +199,21 @@ discard block |
||
| 214 | 199 | /** |
| 215 | 200 | * @param string[] $fields |
| 216 | 201 | */ |
| 217 | - public static function setDefaultReadFields(array $fields = array()) |
|
| 218 | - { |
|
| 202 | + public static function setDefaultReadFields(array $fields = array()) { |
|
| 219 | 203 | static::$defaultReadFields = $fields; |
| 220 | 204 | } |
| 221 | 205 | |
| 222 | 206 | /** |
| 223 | 207 | * @return string[] |
| 224 | 208 | */ |
| 225 | - public static function getDefaultReadFields() |
|
| 226 | - { |
|
| 209 | + public static function getDefaultReadFields() { |
|
| 227 | 210 | return static::$defaultReadFields; |
| 228 | 211 | } |
| 229 | 212 | |
| 230 | 213 | /** |
| 231 | 214 | * @return string |
| 232 | 215 | */ |
| 233 | - protected function getNodePath() |
|
| 234 | - { |
|
| 216 | + protected function getNodePath() { |
|
| 235 | 217 | return '/'.$this->assureId(); |
| 236 | 218 | } |
| 237 | 219 | |
@@ -242,8 +224,7 @@ discard block |
||
| 242 | 224 | * @return $this |
| 243 | 225 | * @throws \Exception |
| 244 | 226 | */ |
| 245 | - public function create(array $params = array()) |
|
| 246 | - { |
|
| 227 | + public function create(array $params = array()) { |
|
| 247 | 228 | if ($this->data[static::FIELD_ID]) { |
| 248 | 229 | throw new \Exception("Object has already an ID"); |
| 249 | 230 | } |
@@ -283,8 +264,7 @@ discard block |
||
| 283 | 264 | * @param array $params Additional request parameters |
| 284 | 265 | * @return $this |
| 285 | 266 | */ |
| 286 | - public function read(array $fields = array(), array $params = array()) |
|
| 287 | - { |
|
| 267 | + public function read(array $fields = array(), array $params = array()) { |
|
| 288 | 268 | $fields = implode(',', $fields ?: static::getDefaultReadFields()); |
| 289 | 269 | if ($fields) { |
| 290 | 270 | $params['fields'] = $fields; |
@@ -308,8 +288,7 @@ discard block |
||
| 308 | 288 | * @param array $params Update parameters in assoc |
| 309 | 289 | * @return $this |
| 310 | 290 | */ |
| 311 | - public function update(array $params = array()) |
|
| 312 | - { |
|
| 291 | + public function update(array $params = array()) { |
|
| 313 | 292 | $this->getApi()->call( |
| 314 | 293 | $this->getNodePath(), |
| 315 | 294 | RequestInterface::METHOD_POST, |
@@ -327,8 +306,7 @@ discard block |
||
| 327 | 306 | * @param array $params |
| 328 | 307 | * @return void |
| 329 | 308 | */ |
| 330 | - public function delete(array $params = array()) |
|
| 331 | - { |
|
| 309 | + public function delete(array $params = array()) { |
|
| 332 | 310 | $this->getApi()->call( |
| 333 | 311 | $this->getNodePath(), |
| 334 | 312 | RequestInterface::METHOD_DELETE, |
@@ -345,8 +323,7 @@ discard block |
||
| 345 | 323 | * @param array $params |
| 346 | 324 | * @return $this |
| 347 | 325 | */ |
| 348 | - public function save(array $params = array()) |
|
| 349 | - { |
|
| 326 | + public function save(array $params = array()) { |
|
| 350 | 327 | if ($this->data[static::FIELD_ID]) { |
| 351 | 328 | return $this->update($params); |
| 352 | 329 | } else { |
@@ -360,8 +337,7 @@ discard block |
||
| 360 | 337 | * @return string |
| 361 | 338 | * @throws \InvalidArgumentException |
| 362 | 339 | */ |
| 363 | - protected function assureEndpoint($prototype_class, $endpoint) |
|
| 364 | - { |
|
| 340 | + protected function assureEndpoint($prototype_class, $endpoint) { |
|
| 365 | 341 | if (!$endpoint) { |
| 366 | 342 | $prototype = new $prototype_class(null, null, $this->getApi()); |
| 367 | 343 | if (!$prototype instanceof AbstractCrudObject) { |
@@ -486,8 +462,7 @@ discard block |
||
| 486 | 462 | * @param Api $api Api Object to use |
| 487 | 463 | * @return bool Returns true on success |
| 488 | 464 | */ |
| 489 | - public static function deleteIds(array $ids, Api $api = null) |
|
| 490 | - { |
|
| 465 | + public static function deleteIds(array $ids, Api $api = null) { |
|
| 491 | 466 | $batch = array(); |
| 492 | 467 | foreach ($ids as $id) { |
| 493 | 468 | $request = 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 | |
@@ -24,6 +24,5 @@ |
||
| 24 | 24 | |
| 25 | 25 | namespace FacebookAds\Object; |
| 26 | 26 | |
| 27 | -class BusinessAdAccount extends AbstractObject |
|
| 28 | -{ |
|
| 27 | +class BusinessAdAccount extends AbstractObject { |
|
| 29 | 28 | } |
@@ -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 | |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | namespace FacebookAds\Logger\CurlLogger; |
| 26 | 26 | |
| 27 | -final class JsonNode |
|
| 28 | -{ |
|
| 27 | +final class JsonNode { |
|
| 29 | 28 | /** |
| 30 | 29 | * @var int |
| 31 | 30 | */ |
@@ -51,8 +50,7 @@ discard block |
||
| 51 | 50 | * @return $this |
| 52 | 51 | * @throws \InvalidArgumentException |
| 53 | 52 | */ |
| 54 | - public static function factory($value) |
|
| 55 | - { |
|
| 53 | + public static function factory($value) { |
|
| 56 | 54 | $object = new self(); |
| 57 | 55 | switch (true) { |
| 58 | 56 | case is_object($value): |
@@ -73,16 +71,14 @@ discard block |
||
| 73 | 71 | return $object; |
| 74 | 72 | } |
| 75 | 73 | |
| 76 | - public function __construct() |
|
| 77 | - { |
|
| 74 | + public function __construct() { |
|
| 78 | 75 | $this->children = new \ArrayObject(); |
| 79 | 76 | } |
| 80 | 77 | |
| 81 | 78 | /** |
| 82 | 79 | * @return mixed |
| 83 | 80 | */ |
| 84 | - public function getValue() |
|
| 85 | - { |
|
| 81 | + public function getValue() { |
|
| 86 | 82 | return $this->value; |
| 87 | 83 | } |
| 88 | 84 | |
@@ -90,8 +86,7 @@ discard block |
||
| 90 | 86 | * @param mixed $value |
| 91 | 87 | * @return $this |
| 92 | 88 | */ |
| 93 | - public function setValue($value) |
|
| 94 | - { |
|
| 89 | + public function setValue($value) { |
|
| 95 | 90 | $this->value = $value; |
| 96 | 91 | |
| 97 | 92 | return $this; |
@@ -100,16 +95,14 @@ discard block |
||
| 100 | 95 | /** |
| 101 | 96 | * @return \ArrayObject |
| 102 | 97 | */ |
| 103 | - public function getChildren() |
|
| 104 | - { |
|
| 98 | + public function getChildren() { |
|
| 105 | 99 | return $this->children; |
| 106 | 100 | } |
| 107 | 101 | |
| 108 | 102 | /** |
| 109 | 103 | * @return int |
| 110 | 104 | */ |
| 111 | - public function getMaxTreeChildrenCount() |
|
| 112 | - { |
|
| 105 | + public function getMaxTreeChildrenCount() { |
|
| 113 | 106 | $max = $this->getChildren()->count(); |
| 114 | 107 | |
| 115 | 108 | /** @var JsonNode $child */ |
@@ -125,16 +118,14 @@ discard block |
||
| 125 | 118 | * @param int $indent |
| 126 | 119 | * @return string |
| 127 | 120 | */ |
| 128 | - protected function getPadding($indent) |
|
| 129 | - { |
|
| 121 | + protected function getPadding($indent) { |
|
| 130 | 122 | return str_repeat(' ', $indent * self::INDENT_UNIT); |
| 131 | 123 | } |
| 132 | 124 | |
| 133 | 125 | /** |
| 134 | 126 | * @return mixed |
| 135 | 127 | */ |
| 136 | - protected function getLastChildKey() |
|
| 137 | - { |
|
| 128 | + protected function getLastChildKey() { |
|
| 138 | 129 | if ($this->getChildren()->count() === 0) { |
| 139 | 130 | return null; |
| 140 | 131 | } |
@@ -149,8 +140,7 @@ discard block |
||
| 149 | 140 | * @param int $indent |
| 150 | 141 | * @return string |
| 151 | 142 | */ |
| 152 | - protected function encodeList($indent) |
|
| 153 | - { |
|
| 143 | + protected function encodeList($indent) { |
|
| 154 | 144 | $value = $this->getValue(); |
| 155 | 145 | if (empty($value) || (array_keys($value) === range(0, count($value) - 1))) { |
| 156 | 146 | $is_map = false; |
@@ -184,8 +174,7 @@ discard block |
||
| 184 | 174 | * @param int $indent |
| 185 | 175 | * @return string |
| 186 | 176 | */ |
| 187 | - public function encode($indent = 0) |
|
| 188 | - { |
|
| 177 | + public function encode($indent = 0) { |
|
| 189 | 178 | $value = $this->getValue(); |
| 190 | 179 | if (is_array($value) || is_object($value)) { |
| 191 | 180 | if ($this->getMaxTreeChildrenCount() > 2) { |
@@ -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\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 | |
@@ -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,8 +27,7 @@ |
||
| 27 | 27 | /** |
| 28 | 28 | * @method static AdSetFields getInstance() |
| 29 | 29 | */ |
| 30 | -class AdSetFields extends AbstractArchivableCrudObjectFields |
|
| 31 | -{ |
|
| 30 | +class AdSetFields extends AbstractArchivableCrudObjectFields { |
|
| 32 | 31 | const ACCOUNT_ID = 'account_id'; |
| 33 | 32 | const ADSET_SCHEDULE = 'adset_schedule'; |
| 34 | 33 | const BID_AMOUNT = 'bid_amount'; |
@@ -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,29 +29,25 @@ |
||
| 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); |