-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
2,744 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
use PhpCsFixer\Config; | ||
use PhpCsFixer\Finder; | ||
|
||
$header = <<<'EOF' | ||
This file is part of SMSA WebService package. | ||
(c) Hamoud Alhoqbani <[email protected]> | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->exclude('tests') | ||
->in(__DIR__); | ||
|
||
$rules = [ | ||
'@PSR2' => true, | ||
'array_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'binary_operator_spaces' => [ | ||
'align_double_arrow' => true, | ||
'align_equals' => false, | ||
], | ||
'blank_line_before_return' => true, | ||
'cast_spaces' => true, | ||
'concat_space' => [ | ||
'spacing' => 'none', | ||
], | ||
'ereg_to_preg' => true, | ||
'method_separation' => true, | ||
'no_blank_lines_after_phpdoc' => true, | ||
'no_extra_consecutive_blank_lines' => true, | ||
'no_short_bool_cast' => true, | ||
'no_unneeded_control_parentheses' => true, | ||
'no_whitespace_in_blank_line' => true, | ||
'ordered_imports' => true, | ||
'phpdoc_align' => true, | ||
'phpdoc_indent' => true, | ||
'phpdoc_inline_tag' => true, | ||
'phpdoc_no_access' => true, | ||
'phpdoc_no_alias_tag' => [ | ||
'type' => 'var', | ||
], | ||
'phpdoc_no_package' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_scalar' => true, | ||
'phpdoc_separation' => true, | ||
'phpdoc_to_comment' => true, | ||
'phpdoc_trim' => true, | ||
'phpdoc_types' => true, | ||
'phpdoc_var_without_name' => true, | ||
'self_accessor' => true, | ||
'single_quote' => true, | ||
'space_after_semicolon' => true, | ||
'standardize_not_equals' => true, | ||
'ternary_operator_spaces' => true, | ||
'trailing_comma_in_multiline_array' => true, | ||
'trim_array_spaces' => true, | ||
'unary_operator_spaces' => true, | ||
'line_ending' => true, | ||
'blank_line_after_namespace' => true, | ||
'no_unused_imports' => true, | ||
'header_comment' => ['header' => $header], | ||
'yoda_style' => true, | ||
]; | ||
|
||
return Config::create()->setRules($rules) | ||
->setFinder(Finder::create()->in(__DIR__)) | ||
->setUsingCache(true) | ||
->setRiskyAllowed(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of SMSA WebService package. | ||
* (c) Hamoud Alhoqbani <[email protected]> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Alhoqbani\SMSAWebService\Exceptions; | ||
|
||
class FailedResponse extends SMSAWebServiceException | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of SMSA WebService package. | ||
* (c) Hamoud Alhoqbani <[email protected]> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Alhoqbani\SMSAWebService\Exceptions; | ||
|
||
class RequestError extends SMSAWebServiceException | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of SMSA WebService package. | ||
* (c) Hamoud Alhoqbani <[email protected]> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Alhoqbani\SMSAWebService\Exceptions; | ||
|
||
abstract class SMSAWebServiceException extends \Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
<?php | ||
|
||
namespace Alhoqbani\SmsaWebService\Models; | ||
/* | ||
* This file is part of SMSA WebService package. | ||
* (c) Hamoud Alhoqbani <[email protected]> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Alhoqbani\SmsaWebService\Models; | ||
|
||
class Customer | ||
{ | ||
|
||
/** | ||
* Customer Name. | ||
* Cannot be Null | ||
|
@@ -47,9 +53,9 @@ class Customer | |
* @var string | ||
*/ | ||
private $country; | ||
|
||
/** Optional Properties */ | ||
|
||
/** | ||
* Address Line 2. | ||
* Either of Address fields to be filled duly | ||
|
@@ -98,7 +104,7 @@ class Customer | |
* @var string | ||
*/ | ||
private $email = ''; | ||
|
||
/** | ||
* Customer constructor. | ||
* | ||
|
@@ -109,12 +115,16 @@ class Customer | |
* @param string $country | ||
*/ | ||
public function __construct( | ||
string $name, string $mobile, string $addressLine1, string $city, string $country = 'KSA' | ||
string $name, | ||
string $mobile, | ||
string $addressLine1, | ||
string $city, | ||
string $country = 'KSA' | ||
) { | ||
$this->name = $name; | ||
$this->mobile = $mobile; | ||
$this->name = $name; | ||
$this->mobile = $mobile; | ||
$this->addressLine1 = $addressLine1; | ||
$this->city = $city; | ||
$this->country = $country; | ||
$this->city = $city; | ||
$this->country = $country; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
<?php | ||
|
||
namespace Alhoqbani\SMSAWebService\Models; | ||
/* | ||
* This file is part of SMSA WebService package. | ||
* (c) Hamoud Alhoqbani <[email protected]> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Alhoqbani\SMSAWebService\Models; | ||
|
||
class Shipment | ||
{ | ||
|
||
const TYPE_DLV = 'DLV'; | ||
const TYPE_VAL = 'VAL'; | ||
const TYPE_HAL = 'HAL'; | ||
const TYPE_BLT = 'BLT'; | ||
|
||
/** | ||
* Unique Number for each day (Required). | ||
* Cannot be Null | ||
|
@@ -42,9 +47,9 @@ class Shipment | |
* @var int | ||
*/ | ||
private $weight = 0; | ||
|
||
/** Optional Properties */ | ||
|
||
/** | ||
* Id. | ||
* Optional | ||
|
@@ -83,9 +88,9 @@ class Shipment | |
* @var string | ||
*/ | ||
private $gpsPoints = ''; | ||
|
||
/** Related Objects */ | ||
|
||
/** | ||
* Customer associated with the shipment. | ||
* | ||
|
@@ -98,7 +103,7 @@ class Shipment | |
* @var \Alhoqbani\SMSAWebService\Models\Shipper | ||
*/ | ||
private $shipper; | ||
|
||
/** | ||
* Shipment constructor. | ||
* | ||
|
@@ -107,10 +112,12 @@ class Shipment | |
* @param \Alhoqbani\SMSAWebService\Models\Customer $customer | ||
*/ | ||
public function __construct( | ||
string $referenceNumber, string $type = self::TYPE_DLV, Customer $customer | ||
string $referenceNumber, | ||
string $type = self::TYPE_DLV, | ||
Customer $customer | ||
) { | ||
$this->referenceNumber = $referenceNumber; | ||
$this->type = $type; | ||
$this->customer = $customer; | ||
$this->type = $type; | ||
$this->customer = $customer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: hamoud | ||
* Date: 4/7/18 | ||
* Time: 1:10 AM | ||
|
||
/* | ||
* This file is part of SMSA WebService package. | ||
* (c) Hamoud Alhoqbani <[email protected]> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Alhoqbani\SmsaWebService\Models; | ||
|
||
|
||
class Shipper | ||
{ | ||
|
||
/** | ||
* Shipper Name. | ||
* Mandatory | ||
|
@@ -68,8 +68,7 @@ class Shipper | |
* @var string | ||
*/ | ||
private $phone; | ||
|
||
|
||
|
||
/** | ||
* Shipper constructor. | ||
* | ||
|
@@ -90,12 +89,12 @@ public function __construct( | |
string $country, | ||
string $phone | ||
) { | ||
$this->name = $name; | ||
$this->contactName = $contactName; | ||
$this->name = $name; | ||
$this->contactName = $contactName; | ||
$this->addressLine1 = $addressLine1; | ||
$this->addressLine2 = $addressLine2; | ||
$this->city = $city; | ||
$this->country = $country; | ||
$this->phone = $phone; | ||
$this->city = $city; | ||
$this->country = $country; | ||
$this->phone = $phone; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of SMSA WebService package. | ||
* (c) Hamoud Alhoqbani <[email protected]> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Alhoqbani\SMSAWebService\Response; | ||
|
||
class SMSAResponse | ||
|
Oops, something went wrong.