The expression \China\IDCard\IDCardUtil...DCard15to18($this->id); of type false|string adds false to the return on line 54 which is incompatible with the return type declared by the interface China\IDCard\IDCardInterface::getLongNumber of type integer|double. It seems like you forgot to handle an error condition.
Loading history...
52
}
53
54
return $id;
55
}
56
57
/**
58
* 身份证是否合法.
59
*
60
* @param string $id
61
*/
62
public static function assertValidIDCard($id)
63
{
64
if (!is_numeric($id)) {
65
throw new \InvalidArgumentException(sprintf('The id "%s" card contains the non-numeric characters', $id));
66
}
67
$length = strlen($id);
68
if ($length !== 15 && $length !== 18) {
69
throw new \InvalidArgumentException(sprintf('The id "%s" card length should be 15 numbers or 18 numbers, given %d', $id, $length));