Skip to content

Commit b623cd2

Browse files
committed
- Add comments
1 parent c56a265 commit b623cd2

File tree

90 files changed

+563
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+563
-0
lines changed

src/Helper/MyInvoisHelper.php

+29
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@
77

88
namespace Klsheng\Myinvois\Helper;
99

10+
/**
11+
* Helper class
12+
*
13+
* @author Sean Kau ([email protected])
14+
* @since 1.0.0
15+
*/
1016
class MyInvoisHelper
1117
{
18+
/**
19+
* Static function helper
20+
*
21+
* @param string $name Function name
22+
* @param array $arguments Function parameters
23+
*
24+
* @return mixed
25+
*/
1226
public static function __callStatic($name, $arguments) {
1327
switch ($name) {
1428
case 'getSubmitDocument':
@@ -18,6 +32,14 @@ public static function __callStatic($name, $arguments) {
1832
}
1933
}
2034

35+
/**
36+
* Static function helper
37+
*
38+
* @param string $content Content
39+
* @param bool $binary Indicate whether result should be in binary
40+
*
41+
* @return string
42+
*/
2143
public static function getHash($content, $binary = false)
2244
{
2345
return hash('sha256', $content, $binary);
@@ -54,6 +76,13 @@ private static function getInternalSubmitDocument($arguments)
5476
];
5577
}
5678

79+
/**
80+
* Check whether content is json format
81+
*
82+
* @param string $string Content
83+
*
84+
* @return bool
85+
*/
5786
public static function isJson($string) {
5887
json_decode($string);
5988
return json_last_error() === JSON_ERROR_NONE;

src/Model/AbstractModel.php

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
use ReflectionClass;
1111
use ReflectionProperty;
1212

13+
/**
14+
* Abstract class for Model
15+
*
16+
* @author Sean Kau ([email protected])
17+
* @since 1.0.0
18+
*/
1319
abstract class AbstractModel
1420
{
1521
/**

src/MyInvoisClient.php

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
use Klsheng\Myinvois\Service\Notification\NotificationService;
2121
use Klsheng\Myinvois\Service\Taxpayer\TaxPayerService;
2222

23+
/**
24+
* Access point to use MyInvoice services
25+
*
26+
* @author Sean Kau ([email protected])
27+
* @since 1.0.0
28+
*/
2329
class MyInvoisClient
2430
{
2531
private const SANDBOX_PORTAL_BASE_URL = 'https://preprod.myinvois.hasil.gov.my';

src/Service/AbstractService.php

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
use Exception;
1111
use Klsheng\Myinvois\MyInvoisClient;
1212

13+
/**
14+
* Abstract class for service component
15+
*
16+
* @author Sean Kau ([email protected])
17+
* @since 1.0.0
18+
*/
1319
abstract class AbstractService
1420
{
1521
/**

src/Service/Document/DocumentService.php

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
use Klsheng\Myinvois\MyInvoisClient;
1313
use Klsheng\Myinvois\Service\AbstractService;
1414

15+
/**
16+
* Document service
17+
*
18+
* @author Sean Kau ([email protected])
19+
* @since 1.0.0
20+
*/
1521
class DocumentService extends AbstractService
1622
{
1723
public const SANDBOX_API_BASE_URL = 'https://preprod-api.myinvois.hasil.gov.my/api/v1.0/documents';

src/Service/Document/DocumentSubmissionService.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Klsheng\Myinvois\MyInvoisClient;
1212
use Klsheng\Myinvois\Service\AbstractService;
1313

14+
/**
15+
* Document submission service
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class DocumentSubmissionService extends AbstractService
1521
{
1622
public const SANDBOX_API_BASE_URL = 'https://preprod-api.myinvois.hasil.gov.my/api/v1.0/documentsubmissions';

src/Service/Document/DocumentTypeService.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Klsheng\Myinvois\MyInvoisClient;
1212
use Klsheng\Myinvois\Service\AbstractService;
1313

14+
/**
15+
* Document type service
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class DocumentTypeService extends AbstractService
1521
{
1622
public const SANDBOX_API_BASE_URL = 'https://preprod-api.myinvois.hasil.gov.my/api/v1.0/documenttypes';

src/Service/Identity/IdentityService.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Klsheng\Myinvois\MyInvoisClient;
1212
use Klsheng\Myinvois\Service\AbstractService;
1313

14+
/**
15+
* Identity service
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class IdentityService extends AbstractService
1521
{
1622
public const SANDBOX_IDENTITY_BASE_URL = 'https://preprod-api.myinvois.hasil.gov.my/connect/token';

src/Service/Notification/NotificationService.php

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
use Klsheng\Myinvois\MyInvoisClient;
1313
use Klsheng\Myinvois\Service\AbstractService;
1414

15+
/**
16+
* Notification service
17+
*
18+
* @author Sean Kau ([email protected])
19+
* @since 1.0.0
20+
*/
1521
class NotificationService extends AbstractService
1622
{
1723
public const SANDBOX_API_BASE_URL = 'https://preprod-api.myinvois.hasil.gov.my/api/v1.0/notifications';

src/Service/Taxpayer/TaxPayerService.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Klsheng\Myinvois\MyInvoisClient;
1212
use Klsheng\Myinvois\Service\AbstractService;
1313

14+
/**
15+
* Tax payer service
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class TaxPayerService extends AbstractService
1521
{
1622
public const SANDBOX_API_BASE_URL = 'https://preprod-api.myinvois.hasil.gov.my/api/v1.0/taxpayer';

src/Ubl/AccountingParty.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Sabre\Xml\Writer;
1212
use Klsheng\Myinvois\Ubl\Constant\UblAttributes;
1313

14+
/**
15+
* Accounting party
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class AccountingParty implements ISerializable, IValidator
1521
{
1622
private $customerAssignedAccountID;

src/Ubl/AdditionalDocumentReference.php

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
use InvalidArgumentException;
1111
use Sabre\Xml\Writer;
1212

13+
/**
14+
* Additional document reference
15+
*
16+
* @author Sean Kau ([email protected])
17+
* @since 1.0.0
18+
*/
1319
class AdditionalDocumentReference implements ISerializable, IValidator
1420
{
1521
private $id;

src/Ubl/Address.php

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
use InvalidArgumentException;
1111
use Sabre\Xml\Writer;
1212

13+
/**
14+
* Address
15+
*
16+
* @author Sean Kau ([email protected])
17+
* @since 1.0.0
18+
*/
1319
class Address implements ISerializable, IValidator
1420
{
1521
private $streetName;

src/Ubl/AddressLine.php

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
use Sabre\Xml\Writer;
1111

12+
/**
13+
* Address line
14+
*
15+
* @author Sean Kau ([email protected])
16+
* @since 1.0.0
17+
*/
1218
class AddressLine implements ISerializable, IValidator
1319
{
1420
private $line;

src/Ubl/AllowanceCharge.php

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
use Klsheng\Myinvois\Ubl\Constant\CurrencyCodes;
1313
use Klsheng\Myinvois\Ubl\Constant\UblAttributes;
1414

15+
/**
16+
* Allowance charge
17+
*
18+
* @author Sean Kau ([email protected])
19+
* @since 1.0.0
20+
*/
1521
class AllowanceCharge implements ISerializable, IValidator
1622
{
1723
private $chargeIndicator;

src/Ubl/Attachment.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use InvalidArgumentException;
1212
use Sabre\Xml\Writer;
1313

14+
/**
15+
* Attachment
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class Attachment implements ISerializable, IValidator
1521
{
1622
private $filePath;

src/Ubl/BillingReference.php

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
use InvalidArgumentException;
1111
use Sabre\Xml\Writer;
1212

13+
/**
14+
* Billing reference
15+
*
16+
* @author Sean Kau ([email protected])
17+
* @since 1.0.0
18+
*/
1319
class BillingReference implements ISerializable, IValidator
1420
{
1521
private $additionalDocumentReference;

src/Ubl/Builder/AbstractDocumentBuilder.php

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
use Klsheng\Myinvois\Ubl\Extension\CertDigest;
3232
use Klsheng\Myinvois\Ubl\Extension\IssuerSerial;
3333

34+
/**
35+
* Abstract document builder
36+
*
37+
* @author Sean Kau ([email protected])
38+
* @since 1.0.0
39+
*/
3440
abstract class AbstractDocumentBuilder implements IDocumentBuilder
3541
{
3642
private $document = null;

src/Ubl/Builder/IDocumentBuilder.php

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
use DateTime;
1111
use Klsheng\Myinvois\Ubl\Invoice;
1212

13+
/**
14+
* document builder interface
15+
*
16+
* @author Sean Kau ([email protected])
17+
* @since 1.0.0
18+
*/
1319
interface IDocumentBuilder
1420
{
1521
/**

src/Ubl/Builder/JsonDocumentBuilder.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Klsheng\Myinvois\Helper\MyInvoisHelper;
1212
use Klsheng\Myinvois\Ubl\Extension\Signature;
1313

14+
/**
15+
* JSON document builder
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class JsonDocumentBuilder extends AbstractDocumentBuilder
1521
{
1622
/**

src/Ubl/Builder/XmlDocumentBuilder.php

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
use Klsheng\Myinvois\Helper\MyInvoisHelper;
1414
use Klsheng\Myinvois\Ubl\Extension\Signature;
1515

16+
/**
17+
* XML document builder
18+
*
19+
* @author Sean Kau ([email protected])
20+
* @since 1.0.0
21+
*/
1622
class XmlDocumentBuilder extends AbstractDocumentBuilder
1723
{
1824
/**

src/Ubl/CommodityClassification.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
use Sabre\Xml\Writer;
1212
use Klsheng\Myinvois\Ubl\Constant\UblAttributes;
1313

14+
/**
15+
* Commodity classification
16+
*
17+
* @author Sean Kau ([email protected])
18+
* @since 1.0.0
19+
*/
1420
class CommodityClassification implements ISerializable, IValidator
1521
{
1622
private $itemClassificationCode;

src/Ubl/Constant/ClassificationCodes.php

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
namespace Klsheng\Myinvois\Ubl\Constant;
99

10+
/**
11+
* Classification codes
12+
*
13+
* @author Sean Kau ([email protected])
14+
* @since 1.0.0
15+
*/
1016
class ClassificationCodes
1117
{
1218
const CODE = 'Code';

src/Ubl/Constant/CountryCodes.php

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
namespace Klsheng\Myinvois\Ubl\Constant;
99

10+
/**
11+
* Country codes
12+
*
13+
* @author Sean Kau ([email protected])
14+
* @since 1.0.0
15+
*/
1016
class CountryCodes
1117
{
1218
const CODE = 'Code';

src/Ubl/Constant/CurrencyCodes.php

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
namespace Klsheng\Myinvois\Ubl\Constant;
99

10+
/**
11+
* Currency codes
12+
*
13+
* @author Sean Kau ([email protected])
14+
* @since 1.0.0
15+
*/
1016
class CurrencyCodes
1117
{
1218
const CODE = 'Code';

src/Ubl/Constant/InvoiceTypeCodes.php

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
namespace Klsheng\Myinvois\Ubl\Constant;
99

10+
/**
11+
* Invoice type codes
12+
*
13+
* @author Sean Kau ([email protected])
14+
* @since 1.0.0
15+
*/
1016
class InvoiceTypeCodes
1117
{
1218
const INVOICE = '01';

src/Ubl/Constant/MSICCodes.php

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
namespace Klsheng\Myinvois\Ubl\Constant;
99

10+
/**
11+
* MSIC codes
12+
*
13+
* @author Sean Kau ([email protected])
14+
* @since 1.0.0
15+
*/
1016
class MSICCodes
1117
{
1218
const CODE = 'Code';

0 commit comments

Comments
 (0)