Skip to content

Commit 64320dd

Browse files
committed
added mim sms, docblock and deprecation notice in classes
1 parent 71d6b9b commit 64320dd

15 files changed

+272
-84
lines changed

src/Handler/Formatter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
namespace Xenon\LaravelBDSms\Handler;
1313

14-
14+
/**
15+
* @since v1.0.6
16+
* @deprecated
17+
* Class Formatter
18+
* @package Xenon\LaravelBDSms\Handler
19+
*/
1520
class Formatter
1621
{
1722

src/Handler/ParameterException.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/*
3+
* Last Modified: 6/28/21, 11:18 PM
4+
* Copyright (c) 2021
5+
* -created by Ariful Islam
6+
* -All Rights Preserved By
7+
* -If you have any query then knock me at
8+
* arif98741@gmail.com
9+
* See my profile @ https://github.com/arif98741
10+
*/
11+
12+
namespace Xenon\LaravelBDSms\Handler;
13+
14+
15+
use Illuminate\Http\Request;
16+
use Illuminate\Http\Response;
17+
18+
/**
19+
* Class ParameterException
20+
* @package Xenon\LaravelBDSms\Handler
21+
* @version v1.0.20
22+
* @since v1.0.20
23+
*/
24+
class ParameterException extends \Exception
25+
{
26+
/**
27+
* Report the exception.
28+
*
29+
* @return void
30+
* @version v1.0.20
31+
* @since v1.0.20
32+
*/
33+
public function report()
34+
{
35+
}
36+
37+
/**
38+
* Render the exception into an HTTP response.
39+
*
40+
* @param Request $request
41+
* @return Response
42+
* @version v1.0.20
43+
* @since v1.0.20
44+
*/
45+
public function render($request)
46+
{
47+
48+
}
49+
}

src/Handler/RenderException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function report()
3232
* @param Request $request
3333
* @return Response
3434
*/
35-
public function render($request)
35+
public function render(Request $request)
3636
{
3737

3838
}

src/Handler/ValidationException.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/*
3+
* Last Modified: 6/28/21, 11:18 PM
4+
* Copyright (c) 2021
5+
* -created by Ariful Islam
6+
* -All Rights Preserved By
7+
* -If you have any query then knock me at
8+
* arif98741@gmail.com
9+
* See my profile @ https://github.com/arif98741
10+
*/
11+
12+
namespace Xenon\LaravelBDSms\Handler;
13+
14+
15+
use Illuminate\Http\Request;
16+
use Illuminate\Http\Response;
17+
18+
/**
19+
* Class ParameterException
20+
* @package Xenon\LaravelBDSms\Handler
21+
* @version v1.0.20
22+
* @since v1.0.20
23+
*/
24+
class ValidationException extends \Exception
25+
{
26+
/**
27+
* Report the exception.
28+
*
29+
* @return void
30+
* @version v1.0.20
31+
* @since v1.0.20
32+
*/
33+
public function report()
34+
{
35+
}
36+
37+
/**
38+
* Render the exception into an HTTP response.
39+
*
40+
* @param Request $request
41+
* @return Response
42+
* @version v1.0.20
43+
* @since v1.0.20
44+
*/
45+
public function render(Request $request)
46+
{
47+
48+
}
49+
}

src/Handler/XenonException.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,29 @@
1111

1212
namespace Xenon\LaravelBDSms\Handler;
1313

14-
14+
/**
15+
* Class XenonException
16+
* @package Xenon\LaravelBDSms\Handler
17+
* @version v1.0.10
18+
* @since v1.0.10
19+
* @deprecated
20+
*/
1521
class XenonException extends \Exception
1622
{
23+
/**
24+
* @var
25+
*/
1726
protected $message;
27+
/**
28+
* @var
29+
*/
1830
protected $code;
1931

32+
/**
33+
* XenonException constructor.
34+
* @param $message
35+
* @param null $code
36+
*/
2037
public function __construct($message, $code = null)
2138
{
2239
parent::__construct($message, $code);

src/Helper/Helper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class Helper
99
* @param $number
1010
* @return bool
1111
* @since v1.0.12
12+
* @version v1.0.12
1213
*/
13-
public static function numberValidation($number)
14+
public static function numberValidation($number): bool
1415
{
1516
$validCheckPattern = "/^(?:\+88|01)?(?:\d{11}|\d{13})$/";
1617
if (preg_match($validCheckPattern, $number)) {

src/Provider/Adn.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use GuzzleHttp\Client;
1515
use GuzzleHttp\Exception\GuzzleException;
1616
use Illuminate\Http\JsonResponse;
17+
use Xenon\LaravelBDSms\Handler\ParameterException;
1718
use Xenon\LaravelBDSms\Handler\RenderException;
1819
use Xenon\LaravelBDSms\Sender;
1920

@@ -71,21 +72,21 @@ public function sendRequest()
7172
}
7273

7374
/**
74-
* @throws RenderException
75+
* @throws ParameterException
7576
*/
7677
public function errorException()
7778
{
7879
if (!array_key_exists('api_key', $this->senderObject->getConfig())) {
79-
throw new RenderException('api_key is absent in configuration');
80+
throw new ParameterException('api_key is absent in configuration');
8081
}
8182
if (!array_key_exists('api_secret', $this->senderObject->getConfig())) {
82-
throw new RenderException('api_secret key is absent in configuration');
83+
throw new ParameterException('api_secret key is absent in configuration');
8384
}
8485
if (!array_key_exists('request_type', $this->senderObject->getConfig())) {
85-
throw new RenderException('request_type key is absent in configuration');
86+
throw new ParameterException('request_type key is absent in configuration');
8687
}
8788
if (!array_key_exists('message_type', $this->senderObject->getConfig())) {
88-
throw new RenderException('message_type key is absent in configuration');
89+
throw new ParameterException('message_type key is absent in configuration');
8990
}
9091

9192
}

src/Provider/BDBulkSms.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use GuzzleHttp\Client;
1616
use GuzzleHttp\Exception\GuzzleException;
1717
use Illuminate\Http\JsonResponse;
18+
use Xenon\LaravelBDSms\Handler\ParameterException;
1819
use Xenon\LaravelBDSms\Handler\RenderException;
1920
use Xenon\LaravelBDSms\Sender;
2021

@@ -94,11 +95,11 @@ public function generateReport($result, $data): JsonResponse
9495

9596
/**
9697
* @return void
97-
* @throws RenderException
98+
* @throws ParameterException
9899
*/
99100
public function errorException()
100101
{
101102
if (!array_key_exists('token', $this->senderObject->getConfig()))
102-
throw new RenderException('token key is absent in configuration');
103+
throw new ParameterException('token key is absent in configuration');
103104
}
104105
}

src/Provider/BulkSmsBD.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use GuzzleHttp\Client;
1515
use GuzzleHttp\Exception\GuzzleException;
1616
use Illuminate\Http\JsonResponse;
17+
use Xenon\LaravelBDSms\Handler\ParameterException;
1718
use Xenon\LaravelBDSms\Handler\RenderException;
1819
use Xenon\LaravelBDSms\Sender;
1920

@@ -61,15 +62,15 @@ public function sendRequest()
6162
}
6263

6364
/**
64-
* @throws RenderException
65+
* @throws ParameterException
6566
*/
6667
public function errorException()
6768
{
6869
if (!array_key_exists('username', $this->senderObject->getConfig())) {
69-
throw new RenderException('username key is absent in configuration');
70+
throw new ParameterException('username key is absent in configuration');
7071
}
7172
if (!array_key_exists('password', $this->senderObject->getConfig())) {
72-
throw new RenderException('password key is absent in configuration');
73+
throw new ParameterException('password key is absent in configuration');
7374
}
7475
}
7576

src/Provider/DianaHost.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
use GuzzleHttp\Client;
1515
use GuzzleHttp\Exception\GuzzleException;
1616
use Illuminate\Http\JsonResponse;
17+
use Xenon\LaravelBDSms\Handler\ParameterException;
1718
use Xenon\LaravelBDSms\Handler\RenderException;
18-
use Xenon\LaravelBDSms\Helper\Helper;
1919
use Xenon\LaravelBDSms\Sender;
2020

2121
class DianaHost extends AbstractProvider
@@ -63,18 +63,18 @@ public function sendRequest()
6363
}
6464

6565
/**
66-
* @throws RenderException
66+
* @throws ParameterException
6767
*/
6868
public function errorException()
6969
{
7070
if (!array_key_exists('api_key', $this->senderObject->getConfig())) {
71-
throw new RenderException('api_key is absent in configuration');
71+
throw new ParameterException('api_key is absent in configuration');
7272
}
7373
if (!array_key_exists('type', $this->senderObject->getConfig())) {
74-
throw new RenderException('type key is absent in configuration');
74+
throw new ParameterException('type key is absent in configuration');
7575
}
7676
if (!array_key_exists('senderid', $this->senderObject->getConfig())) {
77-
throw new RenderException('senderid key is absent in configuration');
77+
throw new ParameterException('senderid key is absent in configuration');
7878
}
7979
}
8080

src/Provider/GreenWeb.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use GuzzleHttp\Client;
1515
use GuzzleHttp\Exception\GuzzleException;
1616
use Illuminate\Http\JsonResponse;
17+
use Xenon\LaravelBDSms\Handler\ParameterException;
1718
use Xenon\LaravelBDSms\Handler\RenderException;
1819
use Xenon\LaravelBDSms\Sender;
1920

@@ -61,12 +62,12 @@ public function sendRequest()
6162
}
6263

6364
/**
64-
* @throws RenderException
65+
* @throws ParameterException
6566
*/
6667
public function errorException()
6768
{
6869
if (!array_key_exists('token', $this->senderObject->getConfig()))
69-
throw new RenderException('token key is absent in configuration');
70+
throw new ParameterException('token key is absent in configuration');
7071
}
7172

7273
/**

src/Provider/Metronet.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use GuzzleHttp\Client;
1515
use Illuminate\Http\JsonResponse;
16-
use Xenon\LaravelBDSms\Handler\RenderException;
16+
use Xenon\LaravelBDSms\Handler\ParameterException;
1717
use Xenon\LaravelBDSms\Sender;
1818

1919
class Metronet extends AbstractProvider
@@ -59,15 +59,15 @@ public function sendRequest()
5959
}
6060

6161
/**
62-
* @throws RenderException
62+
* @throws ParameterException
6363
*/
6464
public function errorException()
6565
{
6666
if (!array_key_exists('api_key', $this->senderObject->getConfig())) {
67-
throw new RenderException('api_key is absent in configuration');
67+
throw new ParameterException('api_key is absent in configuration');
6868
}
6969
if (!array_key_exists('mask', $this->senderObject->getConfig())) {
70-
throw new RenderException('mask key is absent in configuration');
70+
throw new ParameterException('mask key is absent in configuration');
7171
}
7272
}
7373

src/Provider/Mim.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)