1 | <?php |
||
9 | class AllowedRecipientsSanitiser |
||
10 | { |
||
11 | protected $libPhoneNumber; |
||
12 | |||
13 | 4 | public function __construct() |
|
17 | |||
18 | /** |
||
19 | * Get formatted phone number in E.164 standard without (+). |
||
20 | * This method will return false if the number is not valid. |
||
21 | * |
||
22 | * @param string $phoneNumber |
||
23 | * |
||
24 | * @return mixed |
||
25 | */ |
||
26 | 1 | public function getFormattedNumber(string $phoneNumber) |
|
48 | |||
49 | /** |
||
50 | * Get phoneNumberObject. |
||
51 | * |
||
52 | * @param string $phoneNumber |
||
53 | * |
||
54 | * @return mixed |
||
55 | */ |
||
56 | 3 | public function getPhoneNumberObject(string $phoneNumber) |
|
71 | |||
72 | /** |
||
73 | * @param string $phoneNumber |
||
74 | * @return string |
||
75 | */ |
||
76 | 4 | public function sanitisePhoneNumber(string $phoneNumber): string |
|
82 | |||
83 | /** |
||
84 | * @param string $phoneNumber |
||
85 | * @return string |
||
86 | */ |
||
87 | 4 | protected function getDigits(string $phoneNumber): string |
|
91 | |||
92 | /** |
||
93 | * @param string $phoneNumber |
||
94 | * @return string |
||
95 | */ |
||
96 | 4 | protected function formatNumber(string $phoneNumber): string |
|
107 | } |
||
108 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.