Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arif98741 committed Jul 10, 2021
1 parent 43b5ec1 commit 5e60244
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
6 changes: 6 additions & 0 deletions src/Helper/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

class Helper
{
/**
* Mobile Number Validation
* @param $number
* @return bool
* @since v1.0.12
*/
public static function numberValidation($number)
{
$validCheckPattern = "/^(?:\+88|01)?(?:\d{11}|\d{13})$/";
Expand Down
36 changes: 23 additions & 13 deletions src/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@
use Exception;
use Xenon\LaravelBDSms\Handler\RenderException;
use Xenon\LaravelBDSms\Handler\XenonException;
use Xenon\LaravelBDSms\Handler\RenderException;

class Sender
{
/**
* @var
*/
private $provider;
/**
* @var
*/
private $message;
/**
* @var
*/
private $mobile;
/**
* @var
*/
private $config;
/**
* @var
*/
private $method;

/**
Expand All @@ -41,15 +55,11 @@ public function setMethod($method): void
$this->method = $method;
}

private static $instance = null;

/**
* The Singleton's constructor should always be private to prevent direct
* construction calls with the `new` operator.
* @var null
*/
protected function __construct()
{
}
private static $instance = null;


/**
* This is the static method that controls the access to the singleton
Expand Down Expand Up @@ -91,8 +101,8 @@ public function setConfig($config): Sender
throw new XenonException('config must be an array');
}
$this->config = $config;
} catch (XenonException $e) {
$e->showException();
} catch (RenderException $e) {
return $e->getMessage();
}

return $this;
Expand All @@ -108,8 +118,8 @@ public function send()

$this->provider->errorException();
return $this->provider->sendRequest();
} catch (XenonException $exception) {
$exception->showException();
} catch (RenderException $exception) {
return $exception->getMessage();
}
}

Expand Down Expand Up @@ -164,7 +174,7 @@ public function getProvider()
* @return Sender
* @throws RenderException
*/
public function setProvider($ProviderClass)
public function setProvider($ProviderClass): Sender
{
try {
if (!class_exists($ProviderClass)) {
Expand Down

0 comments on commit 5e60244

Please sign in to comment.