mapdev\FacebookMessenger\Exceptions\CouldNotCreateMessage::invalidPhoneNumber PHP Метод

invalidPhoneNumber() публичный статический Метод

public static invalidPhoneNumber ( )
    public static function invalidPhoneNumber()
    {
        return new static('String is not a valid phone number');
    }

Usage Example

 public static function checkPhoneNumber($string)
 {
     if (!starts_with($string, '+')) {
         throw CouldNotCreateMessage::invalidPhoneNumber();
     }
     return $string;
 }