@@ -145,8 +145,7 @@ |
||
145 | 145 | $normalizers = new \ArrayObject(array( |
146 | 146 | new HashNormalizer() |
147 | 147 | )); |
148 | - } |
|
149 | - else { |
|
148 | + } else { |
|
150 | 149 | $normalizers = clone $this->getNormalizers(); |
151 | 150 | $normalizers->append(new HashNormalizer()); |
152 | 151 | } |
@@ -38,8 +38,8 @@ |
||
38 | 38 | const HASH_TYPE_SHA256 = 'sha256'; |
39 | 39 | |
40 | 40 | /** |
41 | - * @var \ArrayObject |
|
42 | - */ |
|
41 | + * @var \ArrayObject |
|
42 | + */ |
|
43 | 43 | protected $normalizers; |
44 | 44 | |
45 | 45 | /** |
@@ -25,7 +25,6 @@ |
||
25 | 25 | namespace FacebookAds\Object; |
26 | 26 | |
27 | 27 | use FacebookAds\Http\RequestInterface; |
28 | -use FacebookAds\Object\Values\CustomAudienceTypes; |
|
29 | 28 | use FacebookAds\Object\Fields\CustomAudienceFields; |
30 | 29 | use FacebookAds\Object\CustomAudienceNormalizers\HashNormalizer; |
31 | 30 | use FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields; |
@@ -21,6 +21,10 @@ |
||
21 | 21 | private $allow_file_upload; |
22 | 22 | private $file_counter; |
23 | 23 | |
24 | + /** |
|
25 | + * @param string $endpoint |
|
26 | + * @param string $api_type |
|
27 | + */ |
|
24 | 28 | public function __construct( |
25 | 29 | Api $api, |
26 | 30 | $id, |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace FacebookAds; |
4 | 4 | |
5 | 5 | use FacebookAds\Cursor; |
6 | -use FacebookAds\AbstractObject; |
|
7 | 6 | |
8 | 7 | class ApiRequest { |
9 | 8 | protected $api; |
@@ -156,6 +156,9 @@ discard block |
||
156 | 156 | return false; |
157 | 157 | } |
158 | 158 | |
159 | + /** |
|
160 | + * @param string $prefix |
|
161 | + */ |
|
159 | 162 | private function startsWith($string, $prefix) { |
160 | 163 | return $prefix === "" || |
161 | 164 | strrpos($string, $prefix, -strlen($string)) !== false; |
@@ -182,12 +185,18 @@ discard block |
||
182 | 185 | return false; |
183 | 186 | } |
184 | 187 | |
188 | + /** |
|
189 | + * @param string $collection |
|
190 | + */ |
|
185 | 191 | public function isTypeCollection($type, $collection) { |
186 | 192 | $len_of_collection = strlen($collection); |
187 | 193 | $typeCollection = substr($type, 0, $len_of_collection); |
188 | 194 | return ($collection === $typeCollection); |
189 | 195 | } |
190 | 196 | |
197 | + /** |
|
198 | + * @param string $collection |
|
199 | + */ |
|
191 | 200 | public function getTypeFromCollection($type, $collection) { |
192 | 201 | return explode(",", trim(substr($type, strlen($collection)), "<>")); |
193 | 202 | } |
@@ -331,7 +331,7 @@ |
||
331 | 331 | * @param array $fields Fields to request |
332 | 332 | * @param array $params Additional filters for the reading |
333 | 333 | * @param string|null $endpoint |
334 | - * @return AbstractObject |
|
334 | + * @return null|AbstractCrudObject |
|
335 | 335 | */ |
336 | 336 | protected function getOneByConnection( |
337 | 337 | $prototype_class, |
@@ -208,7 +208,7 @@ |
||
208 | 208 | array_merge($this->exportData(), $params)); |
209 | 209 | $this->clearHistory(); |
210 | 210 | $data = $response->getContent(); |
211 | - if (!isset($params['execution_options'])){ |
|
211 | + if (!isset($params['execution_options'])) { |
|
212 | 212 | $id = is_string($data) ? $data : $data[static::FIELD_ID]; |
213 | 213 | /** @var AbstractCrudObject $this */ |
214 | 214 | if ($this instanceof CanRedownloadInterface |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | } |
71 | 71 | throw new \InvalidArgumentException( |
72 | 72 | 'Object ID must be an integer or integer string but was passed "' |
73 | - .(string)$id.'" ('.gettype($id).').'.(string)$extra_message); |
|
73 | + .(string) $id.'" ('.gettype($id).').'.(string) $extra_message); |
|
74 | 74 | } |
75 | 75 | $this->data[static::FIELD_ID] = $id; |
76 | 76 | |
77 | 77 | if (!is_null($parent_id)) { |
78 | - $warning_message = "\$parent_id as a parameter of constructor is being " . |
|
78 | + $warning_message = "\$parent_id as a parameter of constructor is being ". |
|
79 | 79 | "deprecated, please try not to use this in new code.\n"; |
80 | 80 | error_log($warning_message); |
81 | 81 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | array_merge($this->exportData(), $params)); |
236 | 236 | $this->clearHistory(); |
237 | 237 | $data = $response->getContent(); |
238 | - if (!isset($params['execution_options'])){ |
|
238 | + if (!isset($params['execution_options'])) { |
|
239 | 239 | $id = is_string($data) ? $data : $data[static::FIELD_ID]; |
240 | 240 | /** @var AbstractCrudObject $this */ |
241 | 241 | if ($this instanceof CanRedownloadInterface |
@@ -25,7 +25,6 @@ |
||
25 | 25 | namespace FacebookAds\Object; |
26 | 26 | |
27 | 27 | use FacebookAds\ApiRequest; |
28 | -use FacebookAds\Cursor; |
|
29 | 28 | use FacebookAds\Http\RequestInterface; |
30 | 29 | use FacebookAds\TypeChecker; |
31 | 30 | use FacebookAds\Object\Fields\AdImageFields; |
@@ -93,7 +93,7 @@ |
||
93 | 93 | |
94 | 94 | /** |
95 | 95 | * @param array|string $array |
96 | - * @param string|int $key |
|
96 | + * @param string $key |
|
97 | 97 | * @param mixed $default |
98 | 98 | * @return mixed |
99 | 99 | */ |