@@ -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 |
@@ -28,15 +28,13 @@ discard block |
||
28 | 28 | use FacebookAds\Object\CustomAudienceNormalizers\ValueNormalizerInterface; |
29 | 29 | use FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields; |
30 | 30 | |
31 | -class FirstNameInitialNormalizer implements ValueNormalizerInterface |
|
32 | -{ |
|
31 | +class FirstNameInitialNormalizer implements ValueNormalizerInterface { |
|
33 | 32 | /** |
34 | 33 | * @param string $key |
35 | 34 | * @param string $key_value |
36 | 35 | * @return boolean |
37 | 36 | */ |
38 | - public function shouldNormalize($key, $key_value) |
|
39 | - { |
|
37 | + public function shouldNormalize($key, $key_value) { |
|
40 | 38 | return $key === CustomAudienceMultikeySchemaFields::FIRST_NAME_INITIAL; |
41 | 39 | } |
42 | 40 | |
@@ -45,8 +43,7 @@ discard block |
||
45 | 43 | * @param string $key_value |
46 | 44 | * @return string |
47 | 45 | */ |
48 | - public function normalize($key, $key_value) |
|
49 | - { |
|
46 | + public function normalize($key, $key_value) { |
|
50 | 47 | return preg_replace( |
51 | 48 | '/[^a-zA-Z]/', |
52 | 49 | '', |
@@ -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 |
@@ -28,15 +28,13 @@ discard block |
||
28 | 28 | use FacebookAds\Object\CustomAudienceNormalizers\ValueNormalizerInterface; |
29 | 29 | use FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields; |
30 | 30 | |
31 | -class DateNormalizer implements ValueNormalizerInterface |
|
32 | -{ |
|
31 | +class DateNormalizer implements ValueNormalizerInterface { |
|
33 | 32 | /** |
34 | 33 | * @param string $key |
35 | 34 | * @param string $key_value |
36 | 35 | * @return boolean |
37 | 36 | */ |
38 | - public function shouldNormalize($key, $key_value) |
|
39 | - { |
|
37 | + public function shouldNormalize($key, $key_value) { |
|
40 | 38 | return in_array($key, array( |
41 | 39 | CustomAudienceMultikeySchemaFields::BIRTH_DATE, |
42 | 40 | CustomAudienceMultikeySchemaFields::BIRTH_MONTH |
@@ -48,8 +46,7 @@ discard block |
||
48 | 46 | * @param string $key_value |
49 | 47 | * @return string |
50 | 48 | */ |
51 | - public function normalize($key, $key_value) |
|
52 | - { |
|
49 | + public function normalize($key, $key_value) { |
|
53 | 50 | return str_pad( |
54 | 51 | preg_replace('/[^0-9]/', '', $key_value), |
55 | 52 | 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 |
@@ -28,15 +28,13 @@ discard block |
||
28 | 28 | use FacebookAds\Object\CustomAudienceNormalizers\ValueNormalizerInterface; |
29 | 29 | use FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields; |
30 | 30 | |
31 | -class CityNormalizer implements ValueNormalizerInterface |
|
32 | -{ |
|
31 | +class CityNormalizer implements ValueNormalizerInterface { |
|
33 | 32 | /** |
34 | 33 | * @param string $key |
35 | 34 | * @param string $key_value |
36 | 35 | * @return boolean |
37 | 36 | */ |
38 | - public function shouldNormalize($key, $key_value) |
|
39 | - { |
|
37 | + public function shouldNormalize($key, $key_value) { |
|
40 | 38 | return $key === CustomAudienceMultikeySchemaFields::CITY; |
41 | 39 | } |
42 | 40 | |
@@ -45,8 +43,7 @@ discard block |
||
45 | 43 | * @param string $key_value |
46 | 44 | * @return string |
47 | 45 | */ |
48 | - public function normalize($key, $key_value) |
|
49 | - { |
|
46 | + public function normalize($key, $key_value) { |
|
50 | 47 | return preg_replace('/[^a-zA-Z]/', '', strtolower(trim($key_value))); |
51 | 48 | } |
52 | 49 | } |
@@ -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 |
@@ -28,15 +28,13 @@ discard block |
||
28 | 28 | use FacebookAds\Object\CustomAudienceNormalizers\ValueNormalizerInterface; |
29 | 29 | use FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields; |
30 | 30 | |
31 | -class GenderNormalizer implements ValueNormalizerInterface |
|
32 | -{ |
|
31 | +class GenderNormalizer implements ValueNormalizerInterface { |
|
33 | 32 | /** |
34 | 33 | * @param string $key |
35 | 34 | * @param string $key_value |
36 | 35 | * @return boolean |
37 | 36 | */ |
38 | - public function shouldNormalize($key, $key_value) |
|
39 | - { |
|
37 | + public function shouldNormalize($key, $key_value) { |
|
40 | 38 | return $key === CustomAudienceMultikeySchemaFields::GENDER; |
41 | 39 | } |
42 | 40 | |
@@ -45,8 +43,7 @@ discard block |
||
45 | 43 | * @param string $key_value |
46 | 44 | * @return string |
47 | 45 | */ |
48 | - public function normalize($key, $key_value) |
|
49 | - { |
|
46 | + public function normalize($key, $key_value) { |
|
50 | 47 | return substr($key_value, 0, 1); |
51 | 48 | } |
52 | 49 | } |
@@ -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 |
@@ -28,15 +28,13 @@ discard block |
||
28 | 28 | use FacebookAds\Object\CustomAudienceNormalizers\ValueNormalizerInterface; |
29 | 29 | use FacebookAds\Object\Fields\CustomAudienceMultikeySchemaFields; |
30 | 30 | |
31 | -class EmailNormalizer implements ValueNormalizerInterface |
|
32 | -{ |
|
31 | +class EmailNormalizer implements ValueNormalizerInterface { |
|
33 | 32 | /** |
34 | 33 | * @param string $key |
35 | 34 | * @param string $key_value |
36 | 35 | * @return boolean |
37 | 36 | */ |
38 | - public function shouldNormalize($key, $key_value) |
|
39 | - { |
|
37 | + public function shouldNormalize($key, $key_value) { |
|
40 | 38 | return $key === CustomAudienceMultikeySchemaFields::EMAIL; |
41 | 39 | } |
42 | 40 | |
@@ -45,8 +43,7 @@ discard block |
||
45 | 43 | * @param string $key_value |
46 | 44 | * @return string |
47 | 45 | */ |
48 | - public function normalize($key, $key_value) |
|
49 | - { |
|
46 | + public function normalize($key, $key_value) { |
|
50 | 47 | return trim(strtolower($key_value), ' \t\r\n\0\x0B.'); |
51 | 48 | } |
52 | 49 | } |
@@ -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 @@ discard block |
||
27 | 27 | use FacebookAds\Http\RequestInterface; |
28 | 28 | use FacebookAds\Object\Traits\CannotUpdate; |
29 | 29 | |
30 | -abstract class AbstractAsyncJobObject extends AbstractCrudObject |
|
31 | -{ |
|
30 | +abstract class AbstractAsyncJobObject extends AbstractCrudObject { |
|
32 | 31 | use CannotUpdate; |
33 | 32 | |
34 | 33 | /** |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | /** |
40 | 39 | * @return string |
41 | 40 | */ |
42 | - protected function getCompletitionPercentageFieldName() |
|
43 | - { |
|
41 | + protected function getCompletitionPercentageFieldName() { |
|
44 | 42 | return 'async_percent_completion'; |
45 | 43 | } |
46 | 44 | |
@@ -51,8 +49,7 @@ discard block |
||
51 | 49 | * @return $this |
52 | 50 | * @throws \Exception |
53 | 51 | */ |
54 | - public function create(array $params = array()) |
|
55 | - { |
|
52 | + public function create(array $params = array()) { |
|
56 | 53 | if ($this->data[static::FIELD_ID]) { |
57 | 54 | throw new \Exception("Object has already an ID"); |
58 | 55 | } |
@@ -73,8 +70,7 @@ discard block |
||
73 | 70 | * This method won't fetch new data, you are required to call read() before |
74 | 71 | * @return bool |
75 | 72 | */ |
76 | - public function isComplete() |
|
77 | - { |
|
73 | + public function isComplete() { |
|
78 | 74 | return $this->{$this->getCompletitionPercentageFieldName()} === 100; |
79 | 75 | } |
80 | 76 |
@@ -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; |
26 | 26 |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | use FacebookAds\Http\RequestInterface; |
28 | 28 | |
29 | -abstract class AbstractArchivableCrudObject extends AbstractCrudObject |
|
30 | -{ |
|
29 | +abstract class AbstractArchivableCrudObject extends AbstractCrudObject { |
|
31 | 30 | /** |
32 | 31 | * @var string |
33 | 32 | */ |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | /** |
57 | 56 | * @return string |
58 | 57 | */ |
59 | - public function getStatusParamName() |
|
60 | - { |
|
58 | + public function getStatusParamName() { |
|
61 | 59 | return self::STATUS_PARAM_NAME; |
62 | 60 | } |
63 | 61 | |
@@ -67,8 +65,7 @@ discard block |
||
67 | 65 | * @param array $params |
68 | 66 | * @return void |
69 | 67 | */ |
70 | - public function archive(array $params = array()) |
|
71 | - { |
|
68 | + public function archive(array $params = array()) { |
|
72 | 69 | $this->getApi()->call( |
73 | 70 | $this->getNodePath(), |
74 | 71 | RequestInterface::METHOD_POST, |
@@ -84,8 +81,7 @@ discard block |
||
84 | 81 | * @param array $params |
85 | 82 | * @return void |
86 | 83 | */ |
87 | - public function delete(array $params = array()) |
|
88 | - { |
|
84 | + public function delete(array $params = array()) { |
|
89 | 85 | $this->getApi()->call( |
90 | 86 | $this->getNodePath(), |
91 | 87 | RequestInterface::METHOD_POST, |
@@ -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\Object\Fields\CustomAudienceFields; |
31 | 31 | use FacebookAds\Object\Values\CustomAudienceTypes; |
32 | 32 | |
33 | -class CustomAudience extends AbstractCrudObject |
|
34 | -{ |
|
33 | +class CustomAudience extends AbstractCrudObject { |
|
35 | 34 | /** |
36 | 35 | * @var string |
37 | 36 | * @deprecated use HashNormalizer::HASH_TYPE_SHA256 |
@@ -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 'customaudiences'; |
47 | 45 | } |
48 | 46 | |
49 | 47 | /** |
50 | 48 | * @return CustomAudienceFields |
51 | 49 | */ |
52 | - public static function getFieldsEnum() |
|
53 | - { |
|
50 | + public static function getFieldsEnum() { |
|
54 | 51 | return CustomAudienceFields::getInstance(); |
55 | 52 | } |
56 | 53 | |
@@ -182,8 +179,7 @@ discard block |
||
182 | 179 | * @param array $act_ids Array of account IDs |
183 | 180 | * @return boolean Returns true on success |
184 | 181 | */ |
185 | - public function addSharedAccounts($act_ids) |
|
186 | - { |
|
182 | + public function addSharedAccounts($act_ids) { |
|
187 | 183 | return $this->getApi()->call( |
188 | 184 | '/'.$this->assureId().'/adaccounts', |
189 | 185 | RequestInterface::METHOD_POST, |
@@ -197,8 +193,7 @@ discard block |
||
197 | 193 | * @param array $act_ids Array of Account IDs to remove |
198 | 194 | * @return boolean Returns true on success |
199 | 195 | */ |
200 | - public function removeSharedAccounts($act_ids) |
|
201 | - { |
|
196 | + public function removeSharedAccounts($act_ids) { |
|
202 | 197 | return $this->getApi()->call( |
203 | 198 | '/'.$this->assureId().'/adaccounts', |
204 | 199 | RequestInterface::METHOD_DELETE, |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
|
4 | - * |
|
5 | - * You are hereby granted a non-exclusive, worldwide, royalty-free license to |
|
6 | - * use, copy, modify, and distribute this software in source code or binary |
|
7 | - * form for use in connection with the web services and APIs provided by |
|
8 | - * Facebook. |
|
9 | - * |
|
10 | - * As with any software that integrates with the Facebook platform, your use |
|
11 | - * of this software is subject to the Facebook Developer Principles and |
|
12 | - * Policies [http://developers.facebook.com/policy/]. This copyright notice |
|
13 | - * shall be included in all copies or substantial portions of the software. |
|
14 | - * |
|
15 | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
16 | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
17 | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
18 | - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
19 | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
20 | - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
21 | - * DEALINGS IN THE SOFTWARE. |
|
22 | - * |
|
23 | - */ |
|
3 | + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
|
4 | + * |
|
5 | + * You are hereby granted a non-exclusive, worldwide, royalty-free license to |
|
6 | + * use, copy, modify, and distribute this software in source code or binary |
|
7 | + * form for use in connection with the web services and APIs provided by |
|
8 | + * Facebook. |
|
9 | + * |
|
10 | + * As with any software that integrates with the Facebook platform, your use |
|
11 | + * of this software is subject to the Facebook Developer Principles and |
|
12 | + * Policies [http://developers.facebook.com/policy/]. This copyright notice |
|
13 | + * shall be included in all copies or substantial portions of the software. |
|
14 | + * |
|
15 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
16 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
17 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
18 | + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
19 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
20 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
21 | + * DEALINGS IN THE SOFTWARE. |
|
22 | + * |
|
23 | + */ |
|
24 | 24 | |
25 | 25 | namespace FacebookAds\Object\Fields; |
26 | 26 |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | use FacebookAds\Object\Fields\AdAccountGroupUserFields; |
30 | 30 | use FacebookAds\Object\Traits\FieldValidation; |
31 | 31 | |
32 | -class AdAccountGroupUser extends AbstractObject |
|
33 | -{ |
|
32 | +class AdAccountGroupUser extends AbstractObject { |
|
34 | 33 | use FieldValidation; |
35 | 34 | |
36 | 35 | /** |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * @param string $ad_account_group_id |
63 | 62 | * @param Api $api |
64 | 63 | */ |
65 | - public function __construct($ad_account_group_id, Api $api = null) |
|
66 | - { |
|
64 | + public function __construct($ad_account_group_id, Api $api = null) { |
|
67 | 65 | $this->adAccountGroupId = $ad_account_group_id; |
68 | 66 | $this->api = $api; |
69 | 67 | } |
@@ -71,24 +69,21 @@ discard block |
||
71 | 69 | /** |
72 | 70 | * @return AdAccountGroupUserFields |
73 | 71 | */ |
74 | - public static function getFieldsEnum() |
|
75 | - { |
|
72 | + public static function getFieldsEnum() { |
|
76 | 73 | return AdAccountGroupUserFields::getInstance(); |
77 | 74 | } |
78 | 75 | |
79 | 76 | /** |
80 | 77 | * @return Api |
81 | 78 | */ |
82 | - public function getApi() |
|
83 | - { |
|
79 | + public function getApi() { |
|
84 | 80 | return $this->api; |
85 | 81 | } |
86 | 82 | |
87 | 83 | /** |
88 | 84 | * @return string |
89 | 85 | */ |
90 | - public function getParentId() |
|
91 | - { |
|
86 | + public function getParentId() { |
|
92 | 87 | return $this->adAccountGroupId; |
93 | 88 | } |
94 | 89 | |
@@ -96,8 +91,7 @@ discard block |
||
96 | 91 | * @param array $params |
97 | 92 | * @return $this |
98 | 93 | */ |
99 | - public function create(array $params = array()) |
|
100 | - { |
|
94 | + public function create(array $params = array()) { |
|
101 | 95 | return $this->save($params); |
102 | 96 | } |
103 | 97 | |
@@ -105,8 +99,7 @@ discard block |
||
105 | 99 | * @param array $params |
106 | 100 | * @return $this |
107 | 101 | */ |
108 | - public function update(array $params = array()) |
|
109 | - { |
|
102 | + public function update(array $params = array()) { |
|
110 | 103 | return $this->save($params); |
111 | 104 | } |
112 | 105 | |
@@ -114,8 +107,7 @@ discard block |
||
114 | 107 | * @return string |
115 | 108 | * @throws \Exception |
116 | 109 | */ |
117 | - protected function assureId() |
|
118 | - { |
|
110 | + protected function assureId() { |
|
119 | 111 | if (!$this->data[AdAccountGroupUserFields::UID]) { |
120 | 112 | throw new \Exception(AdAccountGroupUserFields::UID.' field must be set'); |
121 | 113 | } |
@@ -127,8 +119,7 @@ discard block |
||
127 | 119 | * @param array $params |
128 | 120 | * @return $this |
129 | 121 | */ |
130 | - public function save(array $params = array()) |
|
131 | - { |
|
122 | + public function save(array $params = array()) { |
|
132 | 123 | $this->assureId(); |
133 | 124 | |
134 | 125 | $this->getApi()->call( |
@@ -143,8 +134,7 @@ discard block |
||
143 | 134 | * @param array $params |
144 | 135 | * @throws \Exception |
145 | 136 | */ |
146 | - public function delete(array $params = array()) |
|
147 | - { |
|
137 | + public function delete(array $params = array()) { |
|
148 | 138 | if (!$this->data[AdAccountGroupUserFields::UID]) { |
149 | 139 | throw new \Exception("UID field must be set"); |
150 | 140 | } |
@@ -160,8 +150,7 @@ discard block |
||
160 | 150 | /** |
161 | 151 | * @return AdUser |
162 | 152 | */ |
163 | - public function getAdUser() |
|
164 | - { |
|
153 | + public function getAdUser() { |
|
165 | 154 | return new AdUser($this->{AdAccountGroupUserFields::UID}); |
166 | 155 | } |
167 | 156 | } |