From c50671e18f5c3f6ed8183e6a9d2045b381300a7a Mon Sep 17 00:00:00 2001 From: Zion Ng Date: Tue, 30 Oct 2018 22:38:46 +0800 Subject: [PATCH 1/6] Mark nested templates for template id 62 --- config/sgqr-specs.json | 50 +++++++++++++++++++++ config/sgqr-specs.php | 100 ++++++++++++++++++++--------------------- 2 files changed, 100 insertions(+), 50 deletions(-) diff --git a/config/sgqr-specs.json b/config/sgqr-specs.json index 2e566fd..1745f5b 100644 --- a/config/sgqr-specs.json +++ b/config/sgqr-specs.json @@ -1140,251 +1140,301 @@ "50": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "51": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "52": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "53": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "54": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "55": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "56": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "57": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "58": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "59": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "60": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "61": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "62": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "63": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "64": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "65": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "66": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "67": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "68": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "69": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "70": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "71": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "72": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "73": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "74": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "75": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "76": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "77": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "78": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "79": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "80": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "81": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "82": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "83": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "84": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "85": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "86": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "87": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "88": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "89": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "90": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "91": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "92": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "93": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "94": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "95": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "96": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "97": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "98": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true }, "99": { "name": "Payment System specific templates", "comment": "", + "isTemplate": true, "usesInfoTemplate": true } } diff --git a/config/sgqr-specs.php b/config/sgqr-specs.php index e29eaa6..28978dd 100644 --- a/config/sgqr-specs.php +++ b/config/sgqr-specs.php @@ -294,56 +294,56 @@ '47' => ['name' => 'RFU for EMVCo', 'comment' => ''], '48' => ['name' => 'RFU for EMVCo', 'comment' => ''], '49' => ['name' => 'RFU for EMVCo', 'comment' => ''], - '50' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '51' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '52' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '53' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '54' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '55' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '56' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '57' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '58' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '59' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '60' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '61' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '62' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '63' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '64' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '65' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '66' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '67' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '68' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '69' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '70' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '71' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '72' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '73' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '74' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '75' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '76' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '77' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '78' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '79' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '80' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '81' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '82' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '83' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '84' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '85' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '86' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '87' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '88' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '89' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '90' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '91' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '92' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '93' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '94' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '95' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '96' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '97' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '98' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], - '99' => ['name' => 'Payment System specific templates', 'comment' => '', 'usesInfoTemplate' => true], + '50' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '51' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '52' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '53' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '54' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '55' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '56' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '57' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '58' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '59' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '60' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '61' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '62' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '63' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '64' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '65' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '66' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '67' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '68' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '69' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '70' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '71' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '72' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '73' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '74' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '75' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '76' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '77' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '78' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '79' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '80' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '81' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '82' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '83' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '84' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '85' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '86' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '87' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '88' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '89' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '90' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '91' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '92' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '93' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '94' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '95' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '96' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '97' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '98' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], + '99' => ['name' => 'Payment System specific templates', 'comment' => '', 'isTemplate' => true, 'usesInfoTemplate' => true], ], // end dataObjectsById ], // end template 62 From 6ee7892005bda209d358dc94aadd5d7120350265 Mon Sep 17 00:00:00 2001 From: Zion Ng Date: Tue, 30 Oct 2018 23:45:18 +0800 Subject: [PATCH 2/6] Handle nested templates under root id 62 --- src/SgQr/Parser.php | 51 +++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/src/SgQr/Parser.php b/src/SgQr/Parser.php index e97534e..3d3c100 100644 --- a/src/SgQr/Parser.php +++ b/src/SgQr/Parser.php @@ -11,6 +11,7 @@ class Parser const DATA_OBJECTS_BY_ID = 'dataObjectsById'; const IS_TEMPLATE = 'isTemplate'; const USES_INFO_TEMPLATE = 'usesInfoTemplate'; + const DATA_OBJECTS = 'dataObjects'; /** @var array */ protected $specs; @@ -50,14 +51,17 @@ public function parse($qrCode) * Extract data objects from SQQR * * @param string $text Contents of SGQR - * @param bool $isTemplate If $text belongs to a template instead of root - * @param string $rootId Root ID to which template belongs to. Only specified if $isTemplate is true. + * @param array $specs Specifications for data objects under parent * @return array */ - protected function extractDataObjects($text, $isTemplate = false, $rootId = null) + protected function extractDataObjects($text, array $specs = null) { $result = []; + if (null === $specs) { + $specs = $this->specs[self::ROOT_DATA_OBJECTS_BY_ID]; + } + $textLen = strlen($text); $index = 0; while ($index < $textLen) { @@ -66,7 +70,7 @@ protected function extractDataObjects($text, $isTemplate = false, $rootId = null $value = substr($text, $index + 4, $length); $index += 4 + $length; - $result[] = $this->analyzeDataObject($id, $length, $value, $isTemplate, $rootId); + $result[] = $this->analyzeDataObject($id, $length, $value, $specs[$id] ?? []); } return $result; @@ -78,46 +82,35 @@ protected function extractDataObjects($text, $isTemplate = false, $rootId = null * @param string $id ID of data object * @param int $length Length of value for data object * @param string $value Value for data object - * @param bool $isTemplate If data object belongs to a template instead of root - * @param string $rootId Root ID of template that data object belongs to. Only specified if $isTemplate is true. + * @param array $specs Specifications for data object * @return array */ - protected function analyzeDataObject( - $id, - $length, - $value, - $isTemplate = false, - $rootId = null - ) { - $info = []; + protected function analyzeDataObject($id, $length, $value, array $specs) + { + // Does specs belong to a template? If yes, get template info and child data objects if any. + $isTemplate = $specs[self::IS_TEMPLATE] ?? false; if ($isTemplate) { - $templateInfo = $this->specs[self::TEMPLATES_BY_ID][$rootId] ?? []; - if ($templateInfo[self::USES_INFO_TEMPLATE] ?? false) { - $templateInfo[self::DATA_OBJECTS_BY_ID] = $this->infoTemplate; - } - - $info = $templateInfo[self::DATA_OBJECTS_BY_ID][$id] ?? []; - } else { - $info = $this->specs[self::ROOT_DATA_OBJECTS_BY_ID][$id] ?? []; + $specs = array_merge($specs, $this->specs[self::TEMPLATES_BY_ID][$id] ?? []); } - if ($info[self::USES_INFO_TEMPLATE] ?? false) { - $info[self::DATA_OBJECTS_BY_ID] = $this->infoTemplate; + // Does specs use info template? If yes, populate child data objects with it. + $usesInfoTemplate = $specs[self::USES_INFO_TEMPLATE] ?? false; + if ($usesInfoTemplate) { + $specs[self::DATA_OBJECTS_BY_ID] = $this->infoTemplate; } // Resolve data object $result = [ 'id' => $id, - 'name' => $info[self::NAME] ?? '', + 'name' => $specs[self::NAME] ?? '', 'length' => $length, 'value' => $value, - 'comment' => $info[self::COMMENT] ?? '', + 'comment' => $specs[self::COMMENT] ?? '', ]; // Parse data object further if it is a template - $isObjTemplate = $info[self::IS_TEMPLATE] ?? false; - if ($isObjTemplate) { - $result['dataObjects'] = $this->extractDataObjects($value, $isObjTemplate, $id); + if ($isTemplate) { + $result[self::DATA_OBJECTS] = $this->extractDataObjects($value, $specs[self::DATA_OBJECTS_BY_ID] ?? []); } return $result; From f9fef5cf6b7ed771b2eee44fb3b85e65cb40f134 Mon Sep 17 00:00:00 2001 From: Zion Ng Date: Wed, 31 Oct 2018 00:26:25 +0800 Subject: [PATCH 3/6] Use PHPUnit for tests --- README.md | 8 +- composer.json | 16 +- composer.lock | 1326 ++++++++++++++++++++++++++++++++++++++ phpunit.xml | 13 + test/SgQr/ParserTest.php | 42 ++ tests/test.php | 10 - 6 files changed, 1398 insertions(+), 17 deletions(-) create mode 100644 composer.lock create mode 100644 phpunit.xml create mode 100644 test/SgQr/ParserTest.php delete mode 100644 tests/test.php diff --git a/README.md b/README.md index eba9dc5..ca55393 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Parse SGQR code (Singapore Quick Response Code) as per http://www.mas.gov.sg/sgq No validation is performed at this point of time. ## Requirements -- PHP >= 7.1 -- Composer >= 1.7.2 +- PHP >= 7.0 +- Composer >= 1.6.4 ## Installation - Clone this repo. - Run `composer install`. -- Run `composer test` in the terminal or `tests/test.php` in the browser. +- Run `composer test`. ## Add to project - As this library is not available on Packagist, the GitHub repository needs to be added to the @@ -29,4 +29,4 @@ No validation is performed at this point of time. - Run `composer require zionsg/sgqr-parser:dev-master` to get the latest release in the `master` branch. ## Usage -- See `tests/test.php`. +- See PHPUnit tests in `test` folder. diff --git a/composer.json b/composer.json index c23f9cd..5ea239d 100644 --- a/composer.json +++ b/composer.json @@ -3,13 +3,23 @@ "type": "library", "homepage": "https://github.com/zionsg/sgqr-parser", + "require-dev": { + "phpunit/phpunit": "6" + }, + "autoload": { "psr-4": { "SgQr\\": "src/SgQr/" } }, - "scripts": { - "test": "php tests/test.php" - } + "autoload-dev": { + "psr-4": { + "SgQrTest\\": "test/SgQr/" + } + }, + + "scripts": { + "test": "phpunit" + } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..4955bdd --- /dev/null +++ b/composer.lock @@ -0,0 +1,1326 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "871d9436b19eb6893a99b4437f9ddd8f", + "packages": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "e648abfd8ffb1d54ad549b027b75e376e9055d02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e648abfd8ffb1d54ad549b027b75e376e9055d02", + "reference": "e648abfd8ffb1d54ad549b027b75e376e9055d02", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^2.0", + "sebastian/version": "^2.0", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "ext-xdebug": "^2.5", + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-04-20T10:00:57+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "9d0c024d2099531442d862b66b0ad7cf35ed8e78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9d0c024d2099531442d862b66b0ad7cf35ed8e78", + "reference": "9d0c024d2099531442d862b66b0ad7cf35ed8e78", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.3", + "php": "^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^5.0", + "phpunit/php-file-iterator": "^1.4", + "phpunit/php-text-template": "^1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^4.0", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.2", + "sebastian/environment": "^2.0", + "sebastian/exporter": "^2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "^2.0", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-02-03T05:22:46+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "3819745c44f3aff9518fd655f320c4535d541af7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3819745c44f3aff9518fd655f320c4535d541af7", + "reference": "3819745c44f3aff9518fd655f320c4535d541af7", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^2.0" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2017-02-02T10:36:38+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-11-26T07:53:53+00:00" + }, + { + "name": "sebastian/exporter", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-11-19T08:54:04+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..a50b023 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,13 @@ + + + + ./test + + + + + + src + + + diff --git a/test/SgQr/ParserTest.php b/test/SgQr/ParserTest.php new file mode 100644 index 0000000..3b9ac1f --- /dev/null +++ b/test/SgQr/ParserTest.php @@ -0,0 +1,42 @@ +parse($qrCode)); + + $this->assertEquals($expectedResultInJson, $result); + } + + public function qrCodeProvider() + { + return [ + [ // SGQR for SOBA EXPRESS from article https://www.channelnewsasia.com/news/singapore/sgqr-qr-code-cashless-payment-singapore-rolls-out-unified-10727568 + 'Basic SGQR', + '00020101021126810011SG.COM.NETS01231198500065G9912312359000211111686614000308686614019908604108C251800007SG.SGQR01121809072DD85C020701.00010306079027040201050206060400000708201809155204581253037025802SG5912SOBA EXPRESS6009Singapore630457B3', + '[{"id":"00","name":"Payload Format Indicator","length":"02","value":"01","comment":"Shall be the 1st data object in QR code. Shall contain value of 01."},{"id":"01","name":"Point of Initiation Method","length":"02","value":"11","comment":"Value of 11 used when same QR code used for more than 1 transaction. Value of 12 used when a new QR code is shown for each transaction."},{"id":"26","name":"Merchant Account Information","length":"81","value":"0011SG.COM.NETS01231198500065G9912312359000211111686614000308686614019908604108C2","comment":"Templates reserved for additional payment networks.","dataObjects":[{"id":"00","name":"Globally Unique Identifier","length":"11","value":"SG.COM.NETS","comment":"Value can be one of the following - an Application Identifier (AID), a UUID without hyphens, a reverse domain name."},{"id":"01","name":"Payment network specific","length":"23","value":"1198500065G991231235900","comment":""},{"id":"02","name":"Payment network specific","length":"11","value":"11168661400","comment":""},{"id":"03","name":"Payment network specific","length":"08","value":"68661401","comment":""},{"id":"99","name":"Payment network specific","length":"08","value":"604108C2","comment":""}]},{"id":"51","name":"Merchant Account Information","length":"80","value":"0007SG.SGQR01121809072DD85C020701.0001030607902704020105020606040000070820180915","comment":"Templates reserved for additional payment networks.","dataObjects":[{"id":"00","name":"Globally Unique Identifier","length":"07","value":"SG.SGQR","comment":"Value can be one of the following - an Application Identifier (AID), a UUID without hyphens, a reverse domain name."},{"id":"01","name":"Payment network specific","length":"12","value":"1809072DD85C","comment":""},{"id":"02","name":"Payment network specific","length":"07","value":"01.0001","comment":""},{"id":"03","name":"Payment network specific","length":"06","value":"079027","comment":""},{"id":"04","name":"Payment network specific","length":"02","value":"01","comment":""},{"id":"05","name":"Payment network specific","length":"02","value":"06","comment":""},{"id":"06","name":"Payment network specific","length":"04","value":"0000","comment":""},{"id":"07","name":"Payment network specific","length":"08","value":"20180915","comment":""}]},{"id":"52","name":"Merchant Category Code","length":"04","value":"5812","comment":"As defined by ISO 18245."},{"id":"53","name":"Transaction Currency","length":"03","value":"702","comment":"3-digit numeric representation of currency according to ISO 4217. USD is 840, SGD is 702."},{"id":"58","name":"Country Code","length":"02","value":"SG","comment":"As defined by ISO 3166-1 alpha 2."},{"id":"59","name":"Merchant Name","length":"12","value":"SOBA EXPRESS","comment":""},{"id":"60","name":"Merchant City","length":"09","value":"Singapore","comment":""},{"id":"63","name":"CRC","length":"04","value":"57B3","comment":"Shall be the last data object in QR code. Checksum calculated according to ISO\/IEC 13239 using polynomial 1021 (hex) and initial value FFFF (hex)."}]', + ], + + [ // SGQR from https://www.nets.com.sg/promotions/presidents-star-charity-2018/ + 'SGQR contains single quote', + "00020101021126810011SG.COM.NETS01231198500065G9912312359000211111895264000308895264019908735A43CF51800007SG.SGQR01121809172E1FE7020701.00010306279621040201050202060400000708201809175204000053037025802SG5925PRESIDENT'S CHALLENGE NO16009Singapore63048DCC", + '[{"id":"00","name":"Payload Format Indicator","length":"02","value":"01","comment":"Shall be the 1st data object in QR code. Shall contain value of 01."},{"id":"01","name":"Point of Initiation Method","length":"02","value":"11","comment":"Value of 11 used when same QR code used for more than 1 transaction. Value of 12 used when a new QR code is shown for each transaction."},{"id":"26","name":"Merchant Account Information","length":"81","value":"0011SG.COM.NETS01231198500065G9912312359000211111895264000308895264019908735A43CF","comment":"Templates reserved for additional payment networks.","dataObjects":[{"id":"00","name":"Globally Unique Identifier","length":"11","value":"SG.COM.NETS","comment":"Value can be one of the following - an Application Identifier (AID), a UUID without hyphens, a reverse domain name."},{"id":"01","name":"Payment network specific","length":"23","value":"1198500065G991231235900","comment":""},{"id":"02","name":"Payment network specific","length":"11","value":"11189526400","comment":""},{"id":"03","name":"Payment network specific","length":"08","value":"89526401","comment":""},{"id":"99","name":"Payment network specific","length":"08","value":"735A43CF","comment":""}]},{"id":"51","name":"Merchant Account Information","length":"80","value":"0007SG.SGQR01121809172E1FE7020701.0001030627962104020105020206040000070820180917","comment":"Templates reserved for additional payment networks.","dataObjects":[{"id":"00","name":"Globally Unique Identifier","length":"07","value":"SG.SGQR","comment":"Value can be one of the following - an Application Identifier (AID), a UUID without hyphens, a reverse domain name."},{"id":"01","name":"Payment network specific","length":"12","value":"1809172E1FE7","comment":""},{"id":"02","name":"Payment network specific","length":"07","value":"01.0001","comment":""},{"id":"03","name":"Payment network specific","length":"06","value":"279621","comment":""},{"id":"04","name":"Payment network specific","length":"02","value":"01","comment":""},{"id":"05","name":"Payment network specific","length":"02","value":"02","comment":""},{"id":"06","name":"Payment network specific","length":"04","value":"0000","comment":""},{"id":"07","name":"Payment network specific","length":"08","value":"20180917","comment":""}]},{"id":"52","name":"Merchant Category Code","length":"04","value":"0000","comment":"As defined by ISO 18245."},{"id":"53","name":"Transaction Currency","length":"03","value":"702","comment":"3-digit numeric representation of currency according to ISO 4217. USD is 840, SGD is 702."},{"id":"58","name":"Country Code","length":"02","value":"SG","comment":"As defined by ISO 3166-1 alpha 2."},{"id":"59","name":"Merchant Name","length":"25","value":"PRESIDENT\'S CHALLENGE NO1","comment":""},{"id":"60","name":"Merchant City","length":"09","value":"Singapore","comment":""},{"id":"63","name":"CRC","length":"04","value":"8DCC","comment":"Shall be the last data object in QR code. Checksum calculated according to ISO\/IEC 13239 using polynomial 1021 (hex) and initial value FFFF (hex)."}]', + ], + + [ // Modified SGQR generated for PayNow using POSB banking app, hence CRC invalid + 'Test nested template for root data object ID 62', + '00020101021126500009SG.PAYNOW010100211+65123456780301004082018103052040000530370254071234.565802SG5902ME6009Singapore62290106BILLNO50150004TEST0103ABC63048D7E', + '[{"id":"00","name":"Payload Format Indicator","length":"02","value":"01","comment":"Shall be the 1st data object in QR code. Shall contain value of 01."},{"id":"01","name":"Point of Initiation Method","length":"02","value":"11","comment":"Value of 11 used when same QR code used for more than 1 transaction. Value of 12 used when a new QR code is shown for each transaction."},{"id":"26","name":"Merchant Account Information","length":"50","value":"0009SG.PAYNOW010100211+651234567803010040820181030","comment":"Templates reserved for additional payment networks.","dataObjects":[{"id":"00","name":"Globally Unique Identifier","length":"09","value":"SG.PAYNOW","comment":"Value can be one of the following - an Application Identifier (AID), a UUID without hyphens, a reverse domain name."},{"id":"01","name":"Payment network specific","length":"01","value":"0","comment":""},{"id":"02","name":"Payment network specific","length":"11","value":"+6512345678","comment":""},{"id":"03","name":"Payment network specific","length":"01","value":"0","comment":""},{"id":"04","name":"Payment network specific","length":"08","value":"20181030","comment":""}]},{"id":"52","name":"Merchant Category Code","length":"04","value":"0000","comment":"As defined by ISO 18245."},{"id":"53","name":"Transaction Currency","length":"03","value":"702","comment":"3-digit numeric representation of currency according to ISO 4217. USD is 840, SGD is 702."},{"id":"54","name":"Transaction Amount","length":"07","value":"1234.56","comment":"Shall not be included if the app should prompt user to enter the amount to be paid to the Merchant."},{"id":"58","name":"Country Code","length":"02","value":"SG","comment":"As defined by ISO 3166-1 alpha 2."},{"id":"59","name":"Merchant Name","length":"02","value":"ME","comment":""},{"id":"60","name":"Merchant City","length":"09","value":"Singapore","comment":""},{"id":"62","name":"Additional Data Field Template","length":"29","value":"0106BILLNO50150004TEST0103ABC","comment":"","dataObjects":[{"id":"01","name":"Bill Number","length":"06","value":"BILLNO","comment":""},{"id":"50","name":"Payment System specific templates","length":"15","value":"0004TEST0103ABC","comment":"","dataObjects":[{"id":"00","name":"Globally Unique Identifier","length":"04","value":"TEST","comment":"Value can be one of the following - an Application Identifier (AID), a UUID without hyphens, a reverse domain name."},{"id":"01","name":"Payment network specific","length":"03","value":"ABC","comment":""}]}]},{"id":"63","name":"CRC","length":"04","value":"8D7E","comment":"Shall be the last data object in QR code. Checksum calculated according to ISO\/IEC 13239 using polynomial 1021 (hex) and initial value FFFF (hex)."}]', + ], + ]; + } +} diff --git a/tests/test.php b/tests/test.php deleted file mode 100644 index 80e14b3..0000000 --- a/tests/test.php +++ /dev/null @@ -1,10 +0,0 @@ -parse($qrCode); -echo json_encode($result, JSON_PRETTY_PRINT); From 41672cbc52526b6c70fb0d98110ec16e24379395 Mon Sep 17 00:00:00 2001 From: Zion Ng Date: Wed, 31 Oct 2018 00:35:37 +0800 Subject: [PATCH 4/6] Use PHP CodeSniffer for CS checks --- README.md | 8 ++++++-- composer.json | 10 ++++++++-- composer.lock | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++- phpcs.xml | 20 +++++++++++++++++++ 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 phpcs.xml diff --git a/README.md b/README.md index ca55393..519729c 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,12 @@ No validation is performed at this point of time. ## Installation - Clone this repo. -- Run `composer install`. -- Run `composer test`. +- Run `composer install` to install dependencies. + +## Tests +- Run `composer test` to run tests. +- Run `composer cs` to run coding style checks. +- Run `composer check` to do both. ## Add to project - As this library is not available on Packagist, the GitHub repository needs to be added to the diff --git a/composer.json b/composer.json index 5ea239d..340809b 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "homepage": "https://github.com/zionsg/sgqr-parser", "require-dev": { - "phpunit/phpunit": "6" + "phpunit/phpunit": "6", + "squizlabs/php_codesniffer": "3" }, "autoload": { @@ -20,6 +21,11 @@ }, "scripts": { - "test": "phpunit" + "check": [ + "@cs", + "@test" + ], + "cs": "phpcs", + "test": "phpunit" } } diff --git a/composer.lock b/composer.lock index 4955bdd..4a11bbe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "871d9436b19eb6893a99b4437f9ddd8f", + "content-hash": "896269fdc571a9ecfc755f601a42fae7", "packages": [], "packages-dev": [ { @@ -1225,6 +1225,57 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "b95ff2c3b122a3ee4b57d149a57d2afce65522c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b95ff2c3b122a3ee4b57d149a57d2afce65522c3", + "reference": "b95ff2c3b122a3ee4b57d149a57d2afce65522c3", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-05-04T00:33:04+00:00" + }, { "name": "theseer/tokenizer", "version": "1.1.0", diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..f032dbb --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,20 @@ + + + Zend Framework coding standard + + + + + + + + + + + + + + + + src + From 6dfa81402439325498648b3fe8de79a21302f08b Mon Sep 17 00:00:00 2001 From: Zion Ng Date: Wed, 31 Oct 2018 00:37:55 +0800 Subject: [PATCH 5/6] Specify minor version for dependencies --- composer.json | 4 +- composer.lock | 377 +++++++++++++++++++++++++++++++++++--------------- 2 files changed, 265 insertions(+), 116 deletions(-) diff --git a/composer.json b/composer.json index 340809b..c9e699b 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,8 @@ "homepage": "https://github.com/zionsg/sgqr-parser", "require-dev": { - "phpunit/phpunit": "6", - "squizlabs/php_codesniffer": "3" + "phpunit/phpunit": "^6.5", + "squizlabs/php_codesniffer": "^3.3" }, "autoload": { diff --git a/composer.lock b/composer.lock index 4a11bbe..1740a09 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "896269fdc571a9ecfc755f601a42fae7", + "content-hash": "9d9512ed144abca98c7082bc6c0ed4cf", "packages": [], "packages-dev": [ { @@ -106,6 +106,108 @@ ], "time": "2017-10-19T19:58:43+00:00" }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", @@ -323,41 +425,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.2.0", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e648abfd8ffb1d54ad549b027b75e376e9055d02" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e648abfd8ffb1d54ad549b027b75e376e9055d02", - "reference": "e648abfd8ffb1d54ad549b027b75e376e9055d02", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", "php": "^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.11 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^2.0", - "sebastian/version": "^2.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.5", "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.3" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -372,7 +473,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -383,7 +484,7 @@ "testing", "xunit" ], - "time": "2017-04-20T10:00:57+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -573,16 +674,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.0.0", + "version": "6.5.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9d0c024d2099531442d862b66b0ad7cf35ed8e78" + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9d0c024d2099531442d862b66b0ad7cf35ed8e78", - "reference": "9d0c024d2099531442d862b66b0ad7cf35ed8e78", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", + "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", "shasum": "" }, "require": { @@ -591,22 +692,24 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.3", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", "php": "^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^5.0", - "phpunit/php-file-iterator": "^1.4", - "phpunit/php-text-template": "^1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^4.0", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.2", - "sebastian/environment": "^2.0", - "sebastian/exporter": "^2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "^2.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0" + "sebastian/version": "^2.0.1" }, "conflict": { "phpdocumentor/reflection-docblock": "3.0.2", @@ -625,7 +728,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -651,33 +754,33 @@ "testing", "xunit" ], - "time": "2017-02-03T05:22:46+00:00" + "time": "2018-09-08T15:10:43+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "4.0.0", + "version": "5.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3819745c44f3aff9518fd655f320c4535d541af7" + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3819745c44f3aff9518fd655f320c4535d541af7", - "reference": "3819745c44f3aff9518fd655f320c4535d541af7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", + "doctrine/instantiator": "^1.0.5", "php": "^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^2.0" + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" }, "conflict": { "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.5.11" }, "suggest": { "ext-soap": "*" @@ -685,7 +788,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -700,7 +803,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -710,7 +813,7 @@ "mock", "xunit" ], - "time": "2017-02-02T10:36:38+00:00" + "time": "2018-08-09T05:50:03+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -759,30 +862,30 @@ }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -813,38 +916,38 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -871,32 +974,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -921,34 +1024,34 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -988,27 +1091,27 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -1016,7 +1119,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1039,33 +1142,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "2.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1085,32 +1189,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1138,7 +1287,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -1227,16 +1376,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.0.0", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "b95ff2c3b122a3ee4b57d149a57d2afce65522c3" + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b95ff2c3b122a3ee4b57d149a57d2afce65522c3", - "reference": "b95ff2c3b122a3ee4b57d149a57d2afce65522c3", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", "shasum": "" }, "require": { @@ -1246,7 +1395,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ "bin/phpcs", @@ -1274,7 +1423,7 @@ "phpcs", "standards" ], - "time": "2017-05-04T00:33:04+00:00" + "time": "2018-09-23T23:08:17+00:00" }, { "name": "theseer/tokenizer", From 827ec8953790fe2ec783284ee35ad1b3be7d11fc Mon Sep 17 00:00:00 2001 From: Zion Ng Date: Wed, 31 Oct 2018 00:45:09 +0800 Subject: [PATCH 6/6] Release for v0.3.0 --- CHANGELOG.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34fc407..5f7b03a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file, in reverse The format follows [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to [Semantic Versioning](http://semver.org/). +## [v0.3.0] - 2018-10-31 + +### Added +- Handling of nested templates, in particular data objects ID 50 - 99 under the template for root data object ID 62. +- Mark nested templates with `isTemplate` key in specifications. +- Coding style checks using PHP CodeSniffer. + +### Changed +- Use PHPUnit for tests. + +### Removed +- Nothing. + +### Fixed +- Nothing. + ## [v0.2.0] - 2018-10-22 ### Added @@ -44,6 +60,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). 1st release. Used at https://intzone.com/tools/sgqr. -[Unreleased]: https://github.com/zionsg/sgqr-parser/compare/v0.2.0...HEAD +[Unreleased]: https://github.com/zionsg/sgqr-parser/compare/v0.3.0...HEAD +[v0.3.0]: https://github.com/zionsg/sgqr-parser/compare/v0.2.0...v0.3.0 [v0.2.0]: https://github.com/zionsg/sgqr-parser/compare/v0.1.0...v0.2.0 [v0.1.0]: https://github.com/zionsg/sgqr-parser/tree/v0.1.0