@@ -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 ProductFields getInstance() |
31 | 31 | */ |
32 | -class ProductFields extends AbstractEnum |
|
33 | -{ |
|
32 | +class ProductFields extends AbstractEnum { |
|
34 | 33 | const ID = 'id'; |
35 | 34 | const AGE_GROUP = 'age_group'; |
36 | 35 | const AVAILABILITY = 'availability'; |
@@ -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 AdsPixelStatFields getInstance() |
31 | 31 | */ |
32 | -class AdsPixelStatFields extends AbstractEnum |
|
33 | -{ |
|
32 | +class AdsPixelStatFields extends AbstractEnum { |
|
34 | 33 | const AGGREGATION = 'aggregation'; |
35 | 34 | const DATA = 'data'; |
36 | 35 | const TIMESTAMP = 'timestamps'; |
@@ -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\Enum; |
26 | 26 | |
27 | -abstract class AbstractEnum implements EnumInstanceInterface |
|
28 | -{ |
|
27 | +abstract class AbstractEnum implements EnumInstanceInterface { |
|
29 | 28 | /** |
30 | 29 | * @var array|null |
31 | 30 | */ |
@@ -54,16 +53,14 @@ discard block |
||
54 | 53 | /** |
55 | 54 | * @return string |
56 | 55 | */ |
57 | - public static function className() |
|
58 | - { |
|
56 | + public static function className() { |
|
59 | 57 | return get_called_class(); |
60 | 58 | } |
61 | 59 | |
62 | 60 | /** |
63 | 61 | * @return AbstractEnum |
64 | 62 | */ |
65 | - public static function getInstance() |
|
66 | - { |
|
63 | + public static function getInstance() { |
|
67 | 64 | $fqn = get_called_class(); |
68 | 65 | if (!array_key_exists($fqn, static::$instances)) { |
69 | 66 | static::$instances[$fqn] = new static(); |
@@ -75,8 +72,7 @@ discard block |
||
75 | 72 | /** |
76 | 73 | * @return array |
77 | 74 | */ |
78 | - public function getArrayCopy() |
|
79 | - { |
|
75 | + public function getArrayCopy() { |
|
80 | 76 | if ($this->map === null) { |
81 | 77 | $this->map = (new \ReflectionClass(get_called_class())) |
82 | 78 | ->getConstants(); |
@@ -88,8 +84,7 @@ discard block |
||
88 | 84 | /** |
89 | 85 | * @return array |
90 | 86 | */ |
91 | - public function getNames() |
|
92 | - { |
|
87 | + public function getNames() { |
|
93 | 88 | if ($this->names === null) { |
94 | 89 | $this->names = array_keys($this->getArrayCopy()); |
95 | 90 | } |
@@ -100,8 +95,7 @@ discard block |
||
100 | 95 | /** |
101 | 96 | * @return array |
102 | 97 | */ |
103 | - public function getValues() |
|
104 | - { |
|
98 | + public function getValues() { |
|
105 | 99 | if ($this->values === null) { |
106 | 100 | $this->values = array_values($this->getArrayCopy()); |
107 | 101 | } |
@@ -112,8 +106,7 @@ discard block |
||
112 | 106 | /** |
113 | 107 | * @return array |
114 | 108 | */ |
115 | - public function getValuesMap() |
|
116 | - { |
|
109 | + public function getValuesMap() { |
|
117 | 110 | if ($this->valuesMap === null) { |
118 | 111 | $this->valuesMap = array_fill_keys($this->getValues(), null); |
119 | 112 | } |
@@ -125,8 +118,7 @@ discard block |
||
125 | 118 | * @param string|int|float $name |
126 | 119 | * @return mixed |
127 | 120 | */ |
128 | - public function getValueForName($name) |
|
129 | - { |
|
121 | + public function getValueForName($name) { |
|
130 | 122 | return array_key_exists($name, $this->getArrayCopy()) |
131 | 123 | ? $this->getArrayCopy()[$name] |
132 | 124 | : null; |
@@ -137,8 +129,7 @@ discard block |
||
137 | 129 | * @return mixed |
138 | 130 | * @throws \InvalidArgumentException |
139 | 131 | */ |
140 | - public function assureValueForName($name) |
|
141 | - { |
|
132 | + public function assureValueForName($name) { |
|
142 | 133 | $value = $this->getValueForName($name); |
143 | 134 | if ($value === null) { |
144 | 135 | throw new \InvalidArgumentException('Unknown name "'.$name.'" in '.static::className()); |
@@ -151,8 +142,7 @@ discard block |
||
151 | 142 | * @param string|int|float $name |
152 | 143 | * @return bool |
153 | 144 | */ |
154 | - public function isValid($name) |
|
155 | - { |
|
145 | + public function isValid($name) { |
|
156 | 146 | return array_key_exists($name, $this->getArrayCopy()); |
157 | 147 | } |
158 | 148 | |
@@ -160,8 +150,7 @@ discard block |
||
160 | 150 | * @param string|int|float $name |
161 | 151 | * @throws \InvalidArgumentException |
162 | 152 | */ |
163 | - public function assureIsValid($name) |
|
164 | - { |
|
153 | + public function assureIsValid($name) { |
|
165 | 154 | if (!array_key_exists($name, $this->getArrayCopy())) { |
166 | 155 | throw new \InvalidArgumentException('Unknown name "'.$name.'" in '.static::className()); |
167 | 156 | } |
@@ -171,8 +160,7 @@ discard block |
||
171 | 160 | * @param string|int|float $value |
172 | 161 | * @return bool |
173 | 162 | */ |
174 | - public function isValidValue($value) |
|
175 | - { |
|
163 | + public function isValidValue($value) { |
|
176 | 164 | return array_key_exists($value, $this->getValuesMap()); |
177 | 165 | } |
178 | 166 | |
@@ -180,8 +168,7 @@ discard block |
||
180 | 168 | * @param mixed $value |
181 | 169 | * @throws \InvalidArgumentException |
182 | 170 | */ |
183 | - public function assureIsValidValue($value) |
|
184 | - { |
|
171 | + public function assureIsValidValue($value) { |
|
185 | 172 | if (!$this->isValidValue($value)) { |
186 | 173 | throw new \InvalidArgumentException('"'.$value.'", not a valid value in '.static::className()); |
187 | 174 | } |
@@ -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 |
@@ -26,15 +26,13 @@ discard block |
||
26 | 26 | |
27 | 27 | use FacebookAds\Enum\EmptyEnum; |
28 | 28 | |
29 | -abstract class AbstractObject |
|
30 | -{ |
|
29 | +abstract class AbstractObject { |
|
31 | 30 | /** |
32 | 31 | * @var mixed[] set of key value pairs representing data |
33 | 32 | */ |
34 | 33 | protected $data = array(); |
35 | 34 | |
36 | - public function __construct() |
|
37 | - { |
|
35 | + public function __construct() { |
|
38 | 36 | $this->data = static::getFieldsEnum()->getValuesMap(); |
39 | 37 | } |
40 | 38 | |
@@ -43,8 +41,7 @@ discard block |
||
43 | 41 | * @return mixed |
44 | 42 | * @throws \InvalidArgumentException |
45 | 43 | */ |
46 | - public function __get($name) |
|
47 | - { |
|
44 | + public function __get($name) { |
|
48 | 45 | if (array_key_exists($name, $this->data)) { |
49 | 46 | return $this->data[$name]; |
50 | 47 | } else { |
@@ -56,8 +53,7 @@ discard block |
||
56 | 53 | * @param string $name |
57 | 54 | * @param mixed $value |
58 | 55 | */ |
59 | - public function __set($name, $value) |
|
60 | - { |
|
56 | + public function __set($name, $value) { |
|
61 | 57 | $this->data[$name] = $value; |
62 | 58 | } |
63 | 59 | |
@@ -65,8 +61,7 @@ discard block |
||
65 | 61 | * @param string $name |
66 | 62 | * @return boolean |
67 | 63 | */ |
68 | - public function __isset($name) |
|
69 | - { |
|
64 | + public function __isset($name) { |
|
70 | 65 | return array_key_exists($name, $this->data); |
71 | 66 | } |
72 | 67 | |
@@ -74,8 +69,7 @@ discard block |
||
74 | 69 | * @param array |
75 | 70 | * @return $this |
76 | 71 | */ |
77 | - public function setData(array $data) |
|
78 | - { |
|
72 | + public function setData(array $data) { |
|
79 | 73 | foreach ($data as $key => $value) { |
80 | 74 | $this->{$key} = $value; |
81 | 75 | } |
@@ -89,8 +83,7 @@ discard block |
||
89 | 83 | * @param array |
90 | 84 | * @return $this |
91 | 85 | */ |
92 | - public function setDataWithoutValidation(array $data) |
|
93 | - { |
|
86 | + public function setDataWithoutValidation(array $data) { |
|
94 | 87 | foreach ($data as $key => $value) { |
95 | 88 | $this->data[$key] = $value; |
96 | 89 | } |
@@ -101,8 +94,7 @@ discard block |
||
101 | 94 | /** |
102 | 95 | * @return array |
103 | 96 | */ |
104 | - public function getData() |
|
105 | - { |
|
97 | + public function getData() { |
|
106 | 98 | return $this->data; |
107 | 99 | } |
108 | 100 | |
@@ -110,8 +102,7 @@ discard block |
||
110 | 102 | * @param mixed $value |
111 | 103 | * @return mixed |
112 | 104 | */ |
113 | - protected function exportValue($value) |
|
114 | - { |
|
105 | + protected function exportValue($value) { |
|
115 | 106 | switch (true) { |
116 | 107 | case $value === null: |
117 | 108 | break; |
@@ -134,32 +125,28 @@ discard block |
||
134 | 125 | /** |
135 | 126 | * @return array |
136 | 127 | */ |
137 | - public function exportData() |
|
138 | - { |
|
128 | + public function exportData() { |
|
139 | 129 | return $this->exportValue($this->data); |
140 | 130 | } |
141 | 131 | |
142 | 132 | /** |
143 | 133 | * @return EmptyEnum |
144 | 134 | */ |
145 | - public static function getFieldsEnum() |
|
146 | - { |
|
135 | + public static function getFieldsEnum() { |
|
147 | 136 | return EmptyEnum::getInstance(); |
148 | 137 | } |
149 | 138 | |
150 | 139 | /** |
151 | 140 | * @return array |
152 | 141 | */ |
153 | - public static function getFields() |
|
154 | - { |
|
142 | + public static function getFields() { |
|
155 | 143 | return static::getFieldsEnum()->getValues(); |
156 | 144 | } |
157 | 145 | |
158 | 146 | /** |
159 | 147 | * @return string |
160 | 148 | */ |
161 | - public static function className() |
|
162 | - { |
|
149 | + public static function className() { |
|
163 | 150 | return get_called_class(); |
164 | 151 | } |
165 | 152 | } |
@@ -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 AdLabelFields getInstance() |
31 | 31 | */ |
32 | -class AdLabelFields extends AbstractEnum |
|
33 | -{ |
|
32 | +class AdLabelFields extends AbstractEnum { |
|
34 | 33 | const ID = 'id'; |
35 | 34 | const NAME = 'name'; |
36 | 35 | } |
@@ -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 |
@@ -26,13 +26,11 @@ |
||
26 | 26 | |
27 | 27 | use FacebookAds\Object\Fields\VideoThumbnailFields; |
28 | 28 | |
29 | -class VideoThumbnail extends AbstractObject |
|
30 | -{ |
|
29 | +class VideoThumbnail extends AbstractObject { |
|
31 | 30 | /** |
32 | 31 | * @return VideoThumbnailFields |
33 | 32 | */ |
34 | - public static function getFieldsEnum() |
|
35 | - { |
|
33 | + public static function getFieldsEnum() { |
|
36 | 34 | return VideoThumbnailFields::getInstance(); |
37 | 35 | } |
38 | 36 | } |
@@ -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 ProductCatalogFields getInstance() |
31 | 31 | */ |
32 | -class ProductCatalogFields extends AbstractEnum |
|
33 | -{ |
|
32 | +class ProductCatalogFields extends AbstractEnum { |
|
34 | 33 | const ID = 'id'; |
35 | 34 | const BUSINESS = 'business'; |
36 | 35 | const EXTERNAL_EVENT_SOURCES = 'external_event_sources'; |
@@ -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 CreditCard extends AbstractObject |
|
28 | -{ |
|
27 | +class CreditCard extends AbstractObject { |
|
29 | 28 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
93 | - * @return Api|null |
|
93 | + * @return Api |
|
94 | 94 | */ |
95 | 95 | public static function instance() |
96 | 96 | { |
@@ -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,8 +30,7 @@ discard block |
||
30 | 30 | use FacebookAds\Logger\LoggerInterface; |
31 | 31 | use FacebookAds\Logger\NullLogger; |
32 | 32 | |
33 | -class Api |
|
34 | -{ |
|
33 | +class Api { |
|
35 | 34 | /** |
36 | 35 | * @var string |
37 | 36 | */ |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | * @param string $access_token |
81 | 80 | * @return static |
82 | 81 | */ |
83 | - public static function init($app_id, $app_secret, $access_token) |
|
84 | - { |
|
82 | + public static function init($app_id, $app_secret, $access_token) { |
|
85 | 83 | $session = new Session($app_id, $app_secret, $access_token); |
86 | 84 | $api = new static(new Client(), $session); |
87 | 85 | static::setInstance($api); |
@@ -92,16 +90,14 @@ discard block |
||
92 | 90 | /** |
93 | 91 | * @return Api|null |
94 | 92 | */ |
95 | - public static function instance() |
|
96 | - { |
|
93 | + public static function instance() { |
|
97 | 94 | return static::$instance; |
98 | 95 | } |
99 | 96 | |
100 | 97 | /** |
101 | 98 | * @param Api $instance |
102 | 99 | */ |
103 | - public static function setInstance(Api $instance) |
|
104 | - { |
|
100 | + public static function setInstance(Api $instance) { |
|
105 | 101 | static::$instance = $instance; |
106 | 102 | } |
107 | 103 | |
@@ -109,8 +105,7 @@ discard block |
||
109 | 105 | * @param string $string |
110 | 106 | * @return string |
111 | 107 | */ |
112 | - public static function base64UrlEncode($string) |
|
113 | - { |
|
108 | + public static function base64UrlEncode($string) { |
|
114 | 109 | $str = strtr(base64_encode($string), '+/', '-_'); |
115 | 110 | $str = str_replace('=', '', $str); |
116 | 111 | return $str; |
@@ -151,8 +146,7 @@ discard block |
||
151 | 146 | * @param RequestInterface $request |
152 | 147 | * @return ResponseInterface |
153 | 148 | */ |
154 | - public function executeRequest(RequestInterface $request) |
|
155 | - { |
|
149 | + public function executeRequest(RequestInterface $request) { |
|
156 | 150 | $this->getLogger()->logRequest('debug', $request); |
157 | 151 | $response = $request->execute(); |
158 | 152 | $this->getLogger()->logResponse('debug', $response); |
@@ -163,8 +157,7 @@ discard block |
||
163 | 157 | /** |
164 | 158 | * @return string |
165 | 159 | */ |
166 | - public function getDefaultGraphVersion() |
|
167 | - { |
|
160 | + public function getDefaultGraphVersion() { |
|
168 | 161 | if ($this->defaultGraphVersion === null) { |
169 | 162 | $match = array(); |
170 | 163 | if (preg_match("/^\d+\.\d+/", static::VERSION, $match)) { |
@@ -178,8 +171,7 @@ discard block |
||
178 | 171 | /** |
179 | 172 | * @param string $version |
180 | 173 | */ |
181 | - public function setDefaultGraphVersion($version) |
|
182 | - { |
|
174 | + public function setDefaultGraphVersion($version) { |
|
183 | 175 | $this->defaultGraphVersion = $version; |
184 | 176 | } |
185 | 177 | |
@@ -204,24 +196,21 @@ discard block |
||
204 | 196 | /** |
205 | 197 | * @return Session |
206 | 198 | */ |
207 | - public function getSession() |
|
208 | - { |
|
199 | + public function getSession() { |
|
209 | 200 | return $this->session; |
210 | 201 | } |
211 | 202 | |
212 | 203 | /** |
213 | 204 | * @param LoggerInterface $logger |
214 | 205 | */ |
215 | - public function setLogger(LoggerInterface $logger) |
|
216 | - { |
|
206 | + public function setLogger(LoggerInterface $logger) { |
|
217 | 207 | $this->logger = $logger; |
218 | 208 | } |
219 | 209 | |
220 | 210 | /** |
221 | 211 | * @return LoggerInterface |
222 | 212 | */ |
223 | - public function getLogger() |
|
224 | - { |
|
213 | + public function getLogger() { |
|
225 | 214 | if ($this->logger === null) { |
226 | 215 | $this->logger = new NullLogger(); |
227 | 216 | } |
@@ -232,8 +221,7 @@ discard block |
||
232 | 221 | /** |
233 | 222 | * @return Client |
234 | 223 | */ |
235 | - public function getHttpClient() |
|
236 | - { |
|
224 | + public function getHttpClient() { |
|
237 | 225 | return $this->httpClient; |
238 | 226 | } |
239 | 227 | } |