Skip to content

Commit bfdf557

Browse files
committed
Fix invalid class name (NullPointerException -> InvalidArgumentException)
Fixes #514
1 parent 526c4b7 commit bfdf557

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/PhoneNumberMatch.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class PhoneNumberMatch
2828
* @param int $start The start index into the target text
2929
* @param string $rawString The matched substring of the target text
3030
* @param PhoneNumber $number The matched phone number
31-
* @throws \NullPointerException
3231
*/
3332
public function __construct($start, $rawString, PhoneNumber $number)
3433
{
@@ -37,7 +36,7 @@ public function __construct($start, $rawString, PhoneNumber $number)
3736
}
3837

3938
if ($rawString === null) {
40-
throw new \NullPointerException;
39+
throw new \InvalidArgumentException('$rawString must be a string');
4140
}
4241

4342
$this->start = $start;

src/PhoneNumberMatcher.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ protected static function limit($lower, $upper)
268268
* @param AbstractLeniency $leniency The leniency to use when evaluating candidate phone numbers
269269
* @param int $maxTries The maximum number of invalid numbers to try before giving up on the text.
270270
* This is to cover degenerate cases where the text has a lot of false positives in it. Must be >= 0
271-
* @throws \NullPointerException
272271
* @throws \InvalidArgumentException
273272
*/
274273
public function __construct(PhoneNumberUtil $util, $text, $country, AbstractLeniency $leniency, $maxTries)

tests/core/PhoneNumberMatchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testIllegalArguments()
3636
try {
3737
new PhoneNumberMatch(10, null, new PhoneNumber());
3838
$this->fail();
39-
} catch (\NullPointerException $e) {
39+
} catch (\InvalidArgumentException $e) {
4040
$this->addToAssertionCount(1);
4141
}
4242
}

0 commit comments

Comments
 (0)