From ab493ac82ccdb7199dd0091b684403fe78df0c3b Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Tue, 13 Nov 2018 21:15:12 +0200 Subject: [PATCH 1/4] Refactor + expose internal dependencies --- .gitignore | 0 .prettierrc | 0 code-of-conduct.md | 0 composer.json | 12 +- composer.lock | 575 +++++++++++++++++++++------------- hidden/.gitignore | 1 - hidden/composer.json | 5 - hidden/composer.lock | 127 -------- license.md | 0 package-lock.json | 91 +++--- package.json | 7 +- phpunit.xml | 5 +- readme.md | 0 source/Composer/Installer.php | 3 - source/Composer/Plugin.php | 0 source/Parser.php | 110 +++---- source/autoload.php | 56 ++-- source/bootstrap.php | 5 + source/environment.php | 13 - source/expanders.php | 122 -------- source/functions.php | 51 --- source/macros.php | 0 source/macros/dir.yay | 0 source/macros/process-dir.yay | 0 source/macros/process.yay | 30 +- source/parsers.php | 103 ------ tests/FunctionTest.php | 0 27 files changed, 503 insertions(+), 813 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .prettierrc mode change 100644 => 100755 code-of-conduct.md mode change 100644 => 100755 composer.json delete mode 100644 hidden/.gitignore delete mode 100644 hidden/composer.json delete mode 100644 hidden/composer.lock mode change 100644 => 100755 license.md mode change 100644 => 100755 package.json mode change 100644 => 100755 phpunit.xml mode change 100644 => 100755 readme.md mode change 100644 => 100755 source/Composer/Installer.php mode change 100644 => 100755 source/Composer/Plugin.php mode change 100644 => 100755 source/Parser.php mode change 100644 => 100755 source/autoload.php create mode 100644 source/bootstrap.php delete mode 100644 source/environment.php delete mode 100644 source/expanders.php mode change 100644 => 100755 source/functions.php mode change 100644 => 100755 source/macros.php mode change 100644 => 100755 source/macros/dir.yay mode change 100644 => 100755 source/macros/process-dir.yay mode change 100644 => 100755 source/macros/process.yay delete mode 100644 source/parsers.php mode change 100644 => 100755 tests/FunctionTest.php diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.prettierrc b/.prettierrc old mode 100644 new mode 100755 diff --git a/code-of-conduct.md b/code-of-conduct.md old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index 98cdbeb..d604c38 --- a/composer.json +++ b/composer.json @@ -2,25 +2,23 @@ "name": "pre/plugin", "type": "composer-plugin", "license": "MIT", - "require": { - "composer-plugin-api": "^1.1" - }, "autoload": { "psr-4": { "Pre\\Plugin\\": "source" }, "files": [ - "source/environment.php", - "source/expanders.php", - "source/parsers.php", "source/functions.php", "source/autoload.php", "source/macros.php" ] }, + "require": { + "yay/yay": "^0.7.0", + "composer-plugin-api": "^1.1" + }, "require-dev": { "composer/composer": "^1.3", - "phpunit/phpunit": "^5.0|^6.0" + "phpunit/phpunit": "^5.0|^6.0|^7.0" }, "extra": { "class": [ diff --git a/composer.lock b/composer.lock index 14fc340..0251d1a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5a85eb9061f93486c5ad064930bdf48f", + "content-hash": "9df39e4b5baa89884516a76333cf701c", "packages": [], "packages-dev": [ { "name": "composer/ca-bundle", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0" + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/46afded9720f40b9dc63542af4e3e43a1177acb0", - "reference": "46afded9720f40b9dc63542af4e3e43a1177acb0", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660", + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660", "shasum": "" }, "require": { @@ -61,20 +61,20 @@ "ssl", "tls" ], - "time": "2018-08-08T08:57:40+00:00" + "time": "2018-10-18T06:09:13+00:00" }, { "name": "composer/composer", - "version": "1.7.2", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2" + "reference": "d8aef3af866b28786ce9b8647e52c42496436669" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/576aab9b5abb2ed11a1c52353a759363216a4ad2", - "reference": "576aab9b5abb2ed11a1c52353a759363216a4ad2", + "url": "https://api.github.com/repos/composer/composer/zipball/d8aef3af866b28786ce9b8647e52c42496436669", + "reference": "d8aef3af866b28786ce9b8647e52c42496436669", "shasum": "" }, "require": { @@ -110,7 +110,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -141,7 +141,7 @@ "dependency", "package" ], - "time": "2018-08-16T14:57:12+00:00" + "time": "2018-12-03T09:31:16+00:00" }, { "name": "composer/semver", @@ -207,16 +207,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b" + "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/cb17687e9f936acd7e7245ad3890f953770dec1b", - "reference": "cb17687e9f936acd7e7245ad3890f953770dec1b", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7a9556b22bd9d4df7cad89876b00af58ef20d3a2", + "reference": "7a9556b22bd9d4df7cad89876b00af58ef20d3a2", "shasum": "" }, "require": { @@ -264,20 +264,20 @@ "spdx", "validator" ], - "time": "2018-04-30T10:33:04+00:00" + "time": "2018-11-01T09:45:54+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c" + "reference": "dc523135366eb68f22268d069ea7749486458562" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c", - "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562", + "reference": "dc523135366eb68f22268d069ea7749486458562", "shasum": "" }, "require": { @@ -308,7 +308,7 @@ "Xdebug", "performance" ], - "time": "2018-08-31T19:07:57+00:00" + "time": "2018-11-29T10:59:02+00:00" }, { "name": "doctrine/instantiator", @@ -478,24 +478,75 @@ ], "time": "2018-06-11T23:09:50+00:00" }, + { + "name": "nikic/php-parser", + "version": "v4.1.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "8aae5b59b83bb4d0dbf07b0a835f2680a658f610" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8aae5b59b83bb4d0dbf07b0a835f2680a658f610", + "reference": "8aae5b59b83bb4d0dbf07b0a835f2680a658f610", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^7.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-12-26T11:32:39+00:00" + }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -531,20 +582,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -578,7 +629,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -797,40 +848,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -856,29 +907,32 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -893,7 +947,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -903,7 +957,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -948,28 +1002,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -984,7 +1038,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -993,33 +1047,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2018-02-01T13:07:23+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18", + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1042,57 +1096,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2018-10-30T05:52:18+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.13", + "version": "7.5.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0973426fb012359b2f18d3bd1e90ef1172839693" + "reference": "c23d78776ad415d5506e0679723cb461d71f488f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0973426fb012359b2f18d3bd1e90ef1172839693", - "reference": "0973426fb012359b2f18d3bd1e90ef1172839693", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c23d78776ad415d5506e0679723cb461d71f488f", + "reference": "c23d78776ad415d5506e0679723cb461d71f488f", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "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", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -1100,7 +1154,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -1126,79 +1180,20 @@ "testing", "xunit" ], - "time": "2018-09-08T15:10:43+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.11" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.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": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-08-09T05:50:03+00:00" + "time": "2018-12-12T07:20:32+00:00" }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -1232,7 +1227,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1281,30 +1276,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1341,32 +1336,33 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", + "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1391,34 +1387,37 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2018-06-10T07:54:39+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/febd209a219cea7b56ad799b30ebbea34b71eb8f", + "reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1443,7 +1442,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2018-11-25T09:31:21+00:00" }, { "name": "sebastian/exporter", @@ -1710,25 +1709,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1748,7 +1747,7 @@ ], "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" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", @@ -1888,20 +1887,21 @@ }, { "name": "symfony/console", - "version": "v4.1.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f" + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ca80b8ced97cf07390078b29773dc384c39eee1f", - "reference": "ca80b8ced97cf07390078b29773dc384c39eee1f", + "url": "https://api.github.com/repos/symfony/console/zipball/4dff24e5d01e713818805c1862d2e3f901ee7dd0", + "reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0", "shasum": "" }, "require": { "php": "^7.1.3", + "symfony/contracts": "^1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -1925,7 +1925,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1952,20 +1952,88 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-11-27T07:40:44+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" }, { "name": "symfony/filesystem", - "version": "v4.1.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e" + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", - "reference": "c0f5f62db218fa72195b8b8700e4b9b9cf52eb5e", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710", + "reference": "2f4c8b999b3b7cadb2a69390b01af70886753710", "shasum": "" }, "require": { @@ -1975,7 +2043,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2002,20 +2070,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-08-18T16:52:46+00:00" + "time": "2018-11-11T19:52:12+00:00" }, { "name": "symfony/finder", - "version": "v4.1.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e162f1df3102d0b7472805a5a9d5db9fcf0a8068" + "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e162f1df3102d0b7472805a5a9d5db9fcf0a8068", - "reference": "e162f1df3102d0b7472805a5a9d5db9fcf0a8068", + "url": "https://api.github.com/repos/symfony/finder/zipball/e53d477d7b5c4982d0e1bfd2298dbee63d01441d", + "reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d", "shasum": "" }, "require": { @@ -2024,7 +2092,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2051,11 +2119,11 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-07-26T11:24:31+00:00" + "time": "2018-11-11T19:52:12+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2113,16 +2181,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -2168,20 +2236,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/process", - "version": "v4.1.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843" + "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/86cdb930a6a855b0ab35fb60c1504cb36184f843", - "reference": "86cdb930a6a855b0ab35fb60c1504cb36184f843", + "url": "https://api.github.com/repos/symfony/process/zipball/2b341009ccec76837a7f46f59641b431e4d4c2b0", + "reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0", "shasum": "" }, "require": { @@ -2190,7 +2258,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2217,7 +2285,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-08-03T11:13:38+00:00" + "time": "2018-11-20T16:22:05+00:00" }, { "name": "theseer/tokenizer", @@ -2261,20 +2329,21 @@ }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -2307,7 +2376,65 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" + }, + { + "name": "yay/yay", + "version": "0.7.0", + "source": { + "type": "git", + "url": "https://github.com/marcioAlmada/yay.git", + "reference": "277f52cf44d78e677cc7dadd1aa48d54cfe9d272" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/marcioAlmada/yay/zipball/277f52cf44d78e677cc7dadd1aa48d54cfe9d272", + "reference": "277f52cf44d78e677cc7dadd1aa48d54cfe9d272", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^2.1|^3.0|^4.0", + "php": "7.*" + }, + "require-dev": { + "phpbench/phpbench": "@dev", + "phpunit/phpunit": "~6.5" + }, + "bin": [ + "bin/yay", + "bin/yay-pretty" + ], + "type": "library", + "autoload": { + "files": [ + "src/parsers.php", + "src/parsers_internal.php", + "src/expanders.php" + ], + "psr-4": { + "Yay\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márcio Almada", + "email": "marcio3w@gmail.com", + "homepage": "https://github.com/marcioAlmada" + } + ], + "description": "A high level PHP Pre-Processor", + "keywords": [ + "language", + "pre-processor", + "syntax" + ], + "time": "2018-06-26T11:52:57+00:00" } ], "aliases": [], diff --git a/hidden/.gitignore b/hidden/.gitignore deleted file mode 100644 index 22d0d82..0000000 --- a/hidden/.gitignore +++ /dev/null @@ -1 +0,0 @@ -vendor diff --git a/hidden/composer.json b/hidden/composer.json deleted file mode 100644 index e597a5d..0000000 --- a/hidden/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "yay/yay": "^0.7.0" - } -} diff --git a/hidden/composer.lock b/hidden/composer.lock deleted file mode 100644 index 15c25d9..0000000 --- a/hidden/composer.lock +++ /dev/null @@ -1,127 +0,0 @@ -{ - "_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": "a69235091bc7701c8635fc5e4c178116", - "packages": [ - { - "name": "nikic/php-parser", - "version": "v4.0.4", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "fa6ee28600d21d49b2b4e1006b48426cec8e579c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/fa6ee28600d21d49b2b4e1006b48426cec8e579c", - "reference": "fa6ee28600d21d49b2b4e1006b48426cec8e579c", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2018-09-18T07:03:24+00:00" - }, - { - "name": "yay/yay", - "version": "0.7.0", - "source": { - "type": "git", - "url": "https://github.com/marcioAlmada/yay.git", - "reference": "277f52cf44d78e677cc7dadd1aa48d54cfe9d272" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/marcioAlmada/yay/zipball/277f52cf44d78e677cc7dadd1aa48d54cfe9d272", - "reference": "277f52cf44d78e677cc7dadd1aa48d54cfe9d272", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "ext-tokenizer": "*", - "nikic/php-parser": "^2.1|^3.0|^4.0", - "php": "7.*" - }, - "require-dev": { - "phpbench/phpbench": "@dev", - "phpunit/phpunit": "~6.5" - }, - "bin": [ - "bin/yay", - "bin/yay-pretty" - ], - "type": "library", - "autoload": { - "files": [ - "src/parsers.php", - "src/parsers_internal.php", - "src/expanders.php" - ], - "psr-4": { - "Yay\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márcio Almada", - "email": "marcio3w@gmail.com", - "homepage": "https://github.com/marcioAlmada" - } - ], - "description": "A high level PHP Pre-Processor", - "keywords": [ - "language", - "pre-processor", - "syntax" - ], - "time": "2018-06-26T11:52:57+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/license.md b/license.md old mode 100644 new mode 100755 diff --git a/package-lock.json b/package-lock.json index e5a63c2..39dbe07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,49 +1,48 @@ { - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@prettier/plugin-php": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.8.0.tgz", - "integrity": "sha512-XOCFo531LEJPR7yYJi0/mnngJ4uoXlK87mq3nZMB47v5H7f7XnYeO9FCxdOosn9D52bVtYSszmhjJHnR7zwWbw==", - "dev": true, - "requires": { - "mem": "^3.0.1", - "php-parser": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e" - } - }, - "mem": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mem/-/mem-3.0.1.tgz", - "integrity": "sha512-QKs47bslvOE0NbXOqG6lMxn6Bk0Iuw0vfrIeLykmQle2LkCw1p48dZDdzE+D88b/xqRJcZGcMNeDvSVma+NuIQ==", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "p-is-promise": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", - "dev": true - }, - "php-parser": { - "version": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e", - "from": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e", - "dev": true - }, - "prettier": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz", - "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==", - "dev": true + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@prettier/plugin-php": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.9.0.tgz", + "integrity": "sha512-x3RS9P2W8jRseHa1wecmZnzh9w2kLUJIR6//CroHZtagFSgnGLRNvReDZLlT1PJtTMPVacluPOjY2BFPapO9bw==", + "requires": { + "mem": "^3.0.1", + "php-parser": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e" + } + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, + "mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mem/-/mem-3.0.1.tgz", + "integrity": "sha512-QKs47bslvOE0NbXOqG6lMxn6Bk0Iuw0vfrIeLykmQle2LkCw1p48dZDdzE+D88b/xqRJcZGcMNeDvSVma+NuIQ==", + "requires": { + "mimic-fn": "^1.0.0", + "p-is-promise": "^1.1.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + }, + "php-parser": { + "version": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e", + "from": "github:glayzzle/php-parser#ca007c812e9920bcf1ae9fd24f1a92f5d5906a5e" + }, + "prettier": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.15.3.tgz", + "integrity": "sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==" + } } - } } diff --git a/package.json b/package.json old mode 100644 new mode 100755 index e8d841f..0b4b4a7 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { - "devDependencies": { - "@prettier/plugin-php": "^0.8.0", - "prettier": "^1.14.3" + "dependencies": { + "@prettier/plugin-php": "^0.9.0", + "atob": "^2.1.2", + "prettier": "^1.15.3" } } diff --git a/phpunit.xml b/phpunit.xml old mode 100644 new mode 100755 index ac387ca..13d5990 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,11 +8,10 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="false" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false" + stopOnFailure="true" > - + tests diff --git a/readme.md b/readme.md old mode 100644 new mode 100755 diff --git a/source/Composer/Installer.php b/source/Composer/Installer.php old mode 100644 new mode 100755 index b52fd2f..95edece --- a/source/Composer/Installer.php +++ b/source/Composer/Installer.php @@ -6,11 +6,8 @@ use Composer\Package\PackageInterface; use function Pre\Plugin\base; -require_once __DIR__ . "/../environment.php"; require_once __DIR__ . "/../functions.php"; -require_once __DIR__ . "/../environment.php"; - class Installer extends LibraryInstaller { public function supports($type) diff --git a/source/Composer/Plugin.php b/source/Composer/Plugin.php old mode 100644 new mode 100755 diff --git a/source/Parser.php b/source/Parser.php old mode 100644 new mode 100755 index a08ac96..387a3f4 --- a/source/Parser.php +++ b/source/Parser.php @@ -3,20 +3,21 @@ namespace Pre\Plugin; use Exception; +use Yay\Engine; -define("COMMENT", trim(" -# This file is generated, changes you make will be lost. -# Make your changes in %s instead. -")); +define( + "COMMENT", + trim(" +// This file is generated and changes you make will be lost. +// Change %s instead. +") +); class Parser { private $macro = []; - private $compilers = []; - private $functions = []; - public function addMacro($macro) { $this->macros[$macro] = true; @@ -30,9 +31,13 @@ public function removeMacro($macro) public function getMacros() { return array_keys( - array_filter($this->macros, function ($key) { - return $this->macros[$key]; - }, ARRAY_FILTER_USE_KEY) + array_filter( + $this->macros, + function ($key) { + return $this->macros[$key]; + }, + ARRAY_FILTER_USE_KEY + ) ); } @@ -41,10 +46,7 @@ public function getDiscoveredMacros() $base = base(); if (file_exists("{$base}/pre.macros")) { - $macros = json_decode( - file_get_contents("{$base}/pre.macros"), - true - ); + $macros = json_decode(file_get_contents("{$base}/pre.macros"), true); return array_map(function ($macro) { return base64_decode($macro); @@ -74,10 +76,7 @@ public function getDiscoveredCompilers() $base = base(); if (file_exists("{$base}/pre.compilers")) { - $compilers = json_decode( - file_get_contents("{$base}/pre.compilers"), - true - ); + $compilers = json_decode(file_get_contents("{$base}/pre.compilers"), true); return array_map(function ($compiler) { return base64_decode($compiler); @@ -100,7 +99,7 @@ public function process($from) private function isProcessed($from, $to) { - return file_exists($to) && (filemtime($from) < filemtime($to)); + return file_exists($to) && filemtime($from) < filemtime($to); } public function compile($from, $to, $format = true, $comment = true) @@ -116,11 +115,7 @@ public function compile($from, $to, $format = true, $comment = true) if ($comment) { $comment = sprintf(COMMENT, $from); - $code = str_replace( - "getCodeWithMacros($code); $code = $this->getCodeWithCompilers($code); - $code = base64_encode(gzencode($code)); - - return defer(" - \$code = gzdecode(base64_decode('{$code}')); - \$engine = new \Yay\Engine; - gc_disable(); - \$parsed = \$engine->expand(\$code); - gc_enable(); + $engine = new Engine(); - return \$parsed; - "); + return $engine->expand($code, $engine->currentFileName(), Engine::GC_ENGINE_DISABLED); } private function getCodeWithCompilers($code) { - $compilers = array_merge( - $this->getCompilers(), - $this->getDiscoveredCompilers() - ); + $compilers = array_merge($this->getCompilers(), $this->getDiscoveredCompilers()); foreach ($compilers as $compiler) { if (is_callable($compiler)) { @@ -163,18 +147,11 @@ private function getCodeWithCompilers($code) private function getCodeWithMacros($code) { - $macros = array_merge( - $this->getMacros(), - $this->getDiscoveredMacros() - ); + $macros = array_merge($this->getMacros(), $this->getDiscoveredMacros()); foreach ($macros as $macro) { if (file_exists($macro)) { - $code = str_replace( - "addOpeningTag(trim($code)); + $encoded = base64_encode($code); - $path = realpath(__DIR__ . "/../node_modules/prettier/bin-prettier.js"); - exec("{$path} --write --parser=php {$file} 1> /dev/null 2> /dev/null", $output); + $command = "node -e ' + const atob = require(\"atob\") + const prettier = require(\"prettier\") - $code = file_get_contents($file); - unlink($file); + prettier.resolveConfig(\"{$path}\").then(options => { + try { + const formatted = prettier.format(atob(\"{$encoded}\").trim(), options) + console.log(formatted) + } catch (e) {} + }) + '"; - return $code; - } + exec($command, $output); - public function addFunction($name, $function) - { - $this->functions[$name] = $function; + if (!$output) { + return $code; + } + + $output = join("\n", $output); + return $this->addOpeningTag($output) . "\n"; } - public function getFunction($name) + private function addOpeningTag($code) { - if (isset($this->functions[$name])) { - return $this->functions[$name]; - } - - throw new Exception($name . " has not been added"); + return " $paths) { - $prefixLength = strlen($prefix); + if (file_exists("{$base}/pre.lock")) { + return; + } - if (strncmp($prefix, $class, $prefixLength) !== 0) { - continue; + if (!file_exists("{$base}/vendor/composer/autoload_psr4.php")) { + return; } - $relative = substr($class, $prefixLength); + require_once __DIR__ . "/bootstrap.php"; + + $definitions = require "{$base}/vendor/composer/autoload_psr4.php"; - foreach ($paths as $path) { - $php = $path . "/" . str_replace("\\", "/", $relative) . ".php"; - $pre = $path . "/" . str_replace("\\", "/", $relative) . ".pre"; + foreach ($definitions as $prefix => $paths) { + $prefixLength = strlen($prefix); - if (!file_exists($pre)) { + if (strncmp($prefix, $class, $prefixLength) !== 0) { continue; } - compile($pre, $php, $format = true, $comment = true); + $relative = substr($class, $prefixLength); - require_once $php; + foreach ($paths as $path) { + $php = $path . "/" . str_replace("\\", "/", $relative) . ".php"; + $pre = $path . "/" . str_replace("\\", "/", $relative) . ".pre"; + + if (!file_exists($pre)) { + continue; + } + + compile($pre, $php, ($format = true), ($comment = true)); + + require_once $php; + } } - } -}, false, true); + }, + false, + true +); diff --git a/source/bootstrap.php b/source/bootstrap.php new file mode 100644 index 0000000..9198561 --- /dev/null +++ b/source/bootstrap.php @@ -0,0 +1,5 @@ + /dev/null 2> /dev/null"); +} diff --git a/source/environment.php b/source/environment.php deleted file mode 100644 index 22712eb..0000000 --- a/source/environment.php +++ /dev/null @@ -1,13 +0,0 @@ - /dev/null 2> /dev/null"); -} - -$npm = __DIR__ . "/.."; - -if (!file_exists("{$npm}/node_modules")) { - exec("cd {$npm} && npm install 1> /dev/null 2> /dev/null"); -} diff --git a/source/expanders.php b/source/expanders.php deleted file mode 100644 index 253ba40..0000000 --- a/source/expanders.php +++ /dev/null @@ -1,122 +0,0 @@ -expand($source, "", Engine::GC_ENGINE_DISABLED) - ); - } - - function trim(TokenStream $stream, Engine $engine): TokenStream { - $stream = \trim($stream); - return _stream($stream, $engine); - } - - function studly(TokenStream $stream, Engine $engine): TokenStream { - $stream = \str_replace(["-", "_"], " ", $stream); - $stream = \str_replace(" ", "", \ucwords($stream)); - return _stream($stream, $engine); - } - - function collapse(TokenStream $stream, Engine $engine): TokenStream { - $stream = \preg_replace("/\n\s+\n/", "\n\n", $stream); - $stream = \preg_replace("/\n{3}/", "\n\n", $stream); - return _stream($stream, $engine); - } - - function functionModifiers(TokenStream $stream, Engine $engine): TokenStream { - $parts = []; - - while ($token = $stream->current()) { - \array_push($parts, (string) $token); - $stream->next(); - } - - $source = \join(" ", $parts); - - return _stream($source, $engine); - } - - function functionArgument(TokenStream $stream, Engine $engine): TokenStream { - $parts = []; - $previous = null; - $nullable = false; - - while ($token = $stream->current()) { - \array_push($parts, $token); - - if ($token->type() === T_NEW) { - \array_pop($parts); - $nullable = true; - break; - } - - if ($token->value() === "(" && $previous && $previous->type() === T_STRING) { - \array_pop($parts); - \array_pop($parts); - $nullable = true; - break; - } - - $previous = $token; - $stream->next(); - } - - if ($nullable) { - \array_push($parts, "null"); - } - - $source = \join(" ", $parts); - $source = \str_replace("[ ]", "[]", $source); - - return _stream($source, $engine); - } - - function functionReturn(TokenStream $stream, Engine $engine): TokenStream { - if ($stream->isEmpty()) { - return _stream("", $engine); - } - - // ...skip the : - $stream->next(); - - // ...get the return type - $token = $stream->current(); - - $source = ": {$token}"; - - return _stream($source, $engine); - } -} diff --git a/source/functions.php b/source/functions.php old mode 100644 new mode 100755 index f631f43..89ead47 --- a/source/functions.php +++ b/source/functions.php @@ -29,43 +29,6 @@ function base() { } } - -if (!function_exists("\\Pre\\Plugin\\defer")) { - function defer($code) { - $hidden = realpath(__DIR__ . "/../hidden/vendor/autoload.php"); - $visible = find("autoload.php"); - - if (!$visible) { - // the plugin is being used/tested directly - $visible = __DIR__ . "/../vendor/autoload.php"; - } - - $defer = " - require '{$hidden}'; - require '{$visible}'; - - \$function = function() { - {$code}; - }; - - print base64_encode(gzencode(\$function())); - "; - - $result = exec( - escapeshellcmd(PHP_BINARY) . " -r 'eval(base64_decode(\"" . base64_encode($defer) . "\"));'", - $output - ); - - $return = @gzdecode(base64_decode($result)); - - if ($return === false) { - throw new \RuntimeException("defer failed due to " . implode("\n", $output)); - } - - return $return; - } -} - if (!function_exists("\\Pre\\Plugin\\instance")) { function instance() { static $instance = null; @@ -133,17 +96,3 @@ function removeCompiler($compiler) { return $instance->removeCompiler($compiler); } } - -if (!function_exists("\\Pre\\Plugin\\addFunction")) { - function addFunction(...$args) { - $instance = instance(); - return $instance->addFunction(...$args); - } -} - -if (!function_exists("\\Pre\\Plugin\\getFunction")) { - function getFunction(...$args) { - $instance = instance(); - return $instance->getFunction(...$args); - } -} diff --git a/source/macros.php b/source/macros.php old mode 100644 new mode 100755 diff --git a/source/macros/dir.yay b/source/macros/dir.yay old mode 100644 new mode 100755 diff --git a/source/macros/process-dir.yay b/source/macros/process-dir.yay old mode 100644 new mode 100755 diff --git a/source/macros/process.yay b/source/macros/process.yay old mode 100644 new mode 100755 index bf8347c..9a93a85 --- a/source/macros/process.yay +++ b/source/macros/process.yay @@ -1,19 +1,17 @@ > {$$(trim( - \Pre\Plugin\process($$(trim($(items ...( . ) { $(item) })))) -))} + $(chain( + buffer("process"), + ls( + either( + token(T_DIR), + token(T_STRING), + token(T_CONSTANT_ENCAPSED_STRING) + ) as item, + buffer(".") + ) as items + )) +} >> { + \Pre\Plugin\process($(items ...(.) { $(item) })) +} diff --git a/source/parsers.php b/source/parsers.php deleted file mode 100644 index 8ff04f4..0000000 --- a/source/parsers.php +++ /dev/null @@ -1,103 +0,0 @@ -as("functionModifier") - ) - )->as("functionModifiers"); - } - - function functionArgument(): Parser { - return chain( - optional( - either( - ns(), - token(T_ARRAY), - token(T_CALLABLE) - ) - )->as("functionArgumentType"), - token(T_VARIABLE)->as("functionArgumentName"), - optional(buffer("="))->as("functionArgumentEquals"), - optional(token(T_NEW))->as("functionArgumentNew"), - optional( - either( - chain( - ns(), - buffer("("), - layer(), - buffer(")") - ), - token(T_CONSTANT_ENCAPSED_STRING), - token(T_LNUMBER), - token(T_DNUMBER), - token(T_STRING), - chain( - buffer("["), - layer(), - buffer("]") - ) - ) - )->as("functionArgumentValue") - )->as("functionArgument"); - } - - function functionArguments(): Parser { - return optional( - ls( - functionArgument(), - buffer(",") - ) - )->as("functionArguments"); - } - - function functionReturn(): Parser { - return optional( - chain( - buffer(":"), - either( - ns(), - token(T_ARRAY), - token(T_CALLABLE) - )->as("functionReturnType") - ) - )->as("functionReturn"); - } -} diff --git a/tests/FunctionTest.php b/tests/FunctionTest.php old mode 100644 new mode 100755 From 37a67e6b34317ac7c15dbcafe28d2c382e203137 Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Wed, 17 Apr 2019 08:21:09 +0200 Subject: [PATCH 2/4] Use process function in autoloader --- source/Parser.php | 6 ++++-- source/autoload.php | 2 +- source/functions.php | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/Parser.php b/source/Parser.php index 387a3f4..c949851 100755 --- a/source/Parser.php +++ b/source/Parser.php @@ -86,9 +86,11 @@ public function getDiscoveredCompilers() return []; } - public function process($from) + public function process($from, $to = null, $format = true, $comment = true) { - $to = preg_replace("/\.[a-zA-Z]+$/", ".php", $from); + if (is_null($to)) { + $to = preg_replace("/\.[a-zA-Z]+$/", ".php", $from); + } if (!$this->isProcessed($from, $to)) { $this->compile($from, $to); diff --git a/source/autoload.php b/source/autoload.php index d6207c9..b42373e 100755 --- a/source/autoload.php +++ b/source/autoload.php @@ -35,7 +35,7 @@ function ($class) { continue; } - compile($pre, $php, ($format = true), ($comment = true)); + process($pre, $php); require_once $php; } diff --git a/source/functions.php b/source/functions.php index 89ead47..250d52c 100755 --- a/source/functions.php +++ b/source/functions.php @@ -42,9 +42,9 @@ function instance() { } if (!function_exists("\\Pre\\Plugin\\process")) { - function process($from) { + function process($from, $to = null, $format = true, $comment = true) { $instance = instance(); - return $instance->process($from); + return $instance->process($from, $to, $format, $comment); } } From bd21e7dc70ef47dd948c5abdc1bfbf53dd941e6e Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Wed, 17 Apr 2019 20:48:28 +0200 Subject: [PATCH 3/4] Reintroduce trim expander + handle node path relative to cwd --- composer.json | 1 + source/Parser.php | 3 +++ source/expanders.php | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 source/expanders.php diff --git a/composer.json b/composer.json index d604c38..13617bd 100755 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "Pre\\Plugin\\": "source" }, "files": [ + "source/expanders.php", "source/functions.php", "source/autoload.php", "source/macros.php" diff --git a/source/Parser.php b/source/Parser.php index c949851..818410b 100755 --- a/source/Parser.php +++ b/source/Parser.php @@ -178,7 +178,10 @@ public function format($code) }) '"; + $cwd = getcwd(); + chdir(__DIR__); exec($command, $output); + chdir($cwd); if (!$output) { return $code; diff --git a/source/expanders.php b/source/expanders.php new file mode 100644 index 0000000..2639278 --- /dev/null +++ b/source/expanders.php @@ -0,0 +1,26 @@ +expand($source, "", Engine::GC_ENGINE_DISABLED) + ); + } + + function trim(TokenStream $stream, Engine $engine): TokenStream { + $stream = \trim($stream); + return _stream($stream, $engine); + } +} From 40e32a19e3f584cee14edaaa3250ab56b9038bba Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Wed, 17 Apr 2019 20:54:38 +0200 Subject: [PATCH 4/4] Add trim back into the tests, to make sure it continues to function --- source/macros/process.yay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/macros/process.yay b/source/macros/process.yay index 9a93a85..b5748c8 100755 --- a/source/macros/process.yay +++ b/source/macros/process.yay @@ -13,5 +13,5 @@ $(macro :recursion) { ) as items )) } >> { - \Pre\Plugin\process($(items ...(.) { $(item) })) + \Pre\Plugin\process($$(trim($(items ...(.) { $(item) })))) }