1 | <?php |
||
33 | class CustomAudienceMultiKey extends AbstractCrudObject { |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | const HASH_TYPE_SHA256 = 'sha256'; |
||
39 | |||
40 | /** |
||
41 | * @var \ArrayObject |
||
42 | */ |
||
43 | protected $normalizers; |
||
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | protected function getEndpoint() { |
||
51 | |||
52 | /** |
||
53 | * @return CustomAudienceFields |
||
54 | */ |
||
55 | public static function getFieldsEnum() { |
||
58 | |||
59 | /** |
||
60 | * @return \ArrayObject |
||
61 | */ |
||
62 | public function getNormalizers() { |
||
63 | if ($this->normalizers === null) { |
||
64 | $this->normalizers = new \ArrayObject(array( |
||
65 | new CustomAudienceNormalizers\EmailNormalizer(), |
||
66 | new CustomAudienceNormalizers\PhoneNormalizer(), |
||
67 | new CustomAudienceNormalizers\MadidNormalizer(), |
||
68 | new CustomAudienceNormalizers\GenderNormalizer(), |
||
69 | new CustomAudienceNormalizers\BirthYearNormalizer(), |
||
70 | new CustomAudienceNormalizers\DateNormalizer(), |
||
71 | new CustomAudienceNormalizers\FirstNameNormalizer(), |
||
72 | new CustomAudienceNormalizers\LastNameNormalizer(), |
||
73 | new CustomAudienceNormalizers\FirstNameInitialNormalizer(), |
||
74 | new CustomAudienceNormalizers\StateNormalizer(), |
||
75 | new CustomAudienceNormalizers\CityNormalizer(), |
||
76 | new CustomAudienceNormalizers\ZipNormalizer(), |
||
77 | new CustomAudienceNormalizers\CountryNormalizer(), |
||
78 | )); |
||
79 | } |
||
80 | return $this->normalizers; |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * Add users to the AdCustomAudiences. There is no max on the total number of |
||
85 | * users that can be added to an audience, but up to 10000 users can be added |
||
86 | * at a given time. |
||
87 | * |
||
88 | * @param array $users |
||
89 | * @param array $types |
||
90 | * @param bool $is_hashed |
||
91 | * @param bool $is_normalized |
||
92 | * @return array |
||
93 | */ |
||
94 | public function addUsers( |
||
106 | |||
107 | /** |
||
108 | * Delete users from AdCustomAudiences |
||
109 | * |
||
110 | * @param array $users |
||
111 | * @param array $types |
||
112 | * @param bool $is_hashed |
||
113 | * @param bool $is_normalized |
||
114 | * @return array |
||
115 | */ |
||
116 | public function removeUsers( |
||
128 | |||
129 | /** |
||
130 | * Take users and format them correctly for the request |
||
131 | * |
||
132 | * @param array $users |
||
133 | * @param array $types |
||
134 | * @param bool $is_hashed |
||
135 | * @param bool $is_normalized |
||
136 | * @return array |
||
137 | */ |
||
138 | protected function formatParams( |
||
181 | } |
||
182 |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.