-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update project namespace and optimize code
This commit updates the project namespace from 'Necenzurat' to 'Ag84ark' in various files. At the same time, it introduces some code optimization in several files like 'SmartBillCloudRestClient.php'. Also, beneficial configurations are added to 'smartbill.php' and new classes like 'InvoiceClient' and 'Invoice' under the 'Resources' directory are introduced.
- Loading branch information
Showing
17 changed files
with
1,543 additions
and
54 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
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
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,11 @@ | ||
{ | ||
"name": "ahsanshabbir/smartbill", | ||
"name": "ag84ark/smartbill", | ||
"description": "SmartBill API wrapper compatible for Laravel", | ||
"keywords": [ | ||
"smartbill", | ||
"invoice" | ||
], | ||
"homepage": "https://github.com/necezurat/smartbill", | ||
"homepage": "https://github.com/ag84ark/smartbill", | ||
"license": "MIT", | ||
"type": "library", | ||
"authors": [ | ||
|
@@ -18,25 +18,31 @@ | |
"name": "Ahsan Shabbir", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "Cojocaru George", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php" : "^7.2.5|^8.0|^8.1", | ||
"illuminate/support": "~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0" | ||
|
||
"php" : "^7.4|^8.0|^8.1", | ||
"illuminate/support": "~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0", | ||
"ext-curl": "*", | ||
"ext-json": "*" | ||
}, | ||
"require-dev": { | ||
"orchestra/testbench": "3.8.*", | ||
"phpunit/phpunit": "^7.0|^8.1" | ||
"phpunit/phpunit": "^7.0|^8.1|^9.0|^10.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Necenzurat\\SmartBill\\": "src" | ||
"Ag84ark\\SmartBill\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Necenzurat\\SmartBill\\Tests\\": "tests" | ||
"Ag84ark\\SmartBill\\Tests\\": "tests" | ||
} | ||
}, | ||
"scripts": { | ||
|
@@ -50,10 +56,10 @@ | |
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Necenzurat\\SmartBill\\SmartBillServiceProvider" | ||
"Ag84ark\\SmartBill\\SmartBillServiceProvider" | ||
], | ||
"aliases": { | ||
"SmartBill": "Necenzurat\\SmartBill\\SmartBillFacade" | ||
"SmartBill": "Ag84ark\\SmartBill\\SmartBillFacade" | ||
} | ||
} | ||
} | ||
|
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
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,11 @@ | ||
<?php | ||
|
||
namespace Ag84ark\SmartBill\Exceptions; | ||
|
||
class InvalidDateException extends \Exception | ||
{ | ||
public function __construct(string $date) | ||
{ | ||
parent::__construct("Invalid date: {$date}"); | ||
} | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Ag84ark\SmartBill\Exceptions; | ||
|
||
class InvalidPaymentTypeException extends \Exception | ||
{ | ||
public function __construct(string $paymentType) | ||
{ | ||
parent::__construct("Invalid payment type: {$paymentType}"); | ||
} | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Ag84ark\SmartBill\Exceptions; | ||
|
||
class InvalidTaxNameException extends \Exception | ||
{ | ||
public function __construct(string $taxName) | ||
{ | ||
parent::__construct("Invalid tax name: {$taxName}"); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Ag84ark\SmartBill\Helpers; | ||
|
||
use Ag84ark\SmartBill\Exceptions\InvalidDateException; | ||
|
||
class DateHelper | ||
{ | ||
public static function isValidDate(string $date): bool | ||
{ | ||
return (bool)strtotime($date); | ||
} | ||
|
||
/** | ||
* @throws InvalidDateException | ||
*/ | ||
public static function getYMD(string $date): string | ||
{ | ||
if (!self::isValidDate($date)) { | ||
throw new InvalidDateException($date); | ||
} | ||
return date('Y-m-d', strtotime($date)); | ||
} | ||
} |
Oops, something went wrong.