diff --git a/README.md b/README.md index 1e9b1b3..49a3335 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,41 @@ This project uses [dflydev/dot-access-data](https://github.com/dflydev/dot-acces This project provides a simple logic expression evaluator which can be used in conjunction with [dflydev/dot-access-data](https://github.com/dflydev/dot-access-data) to filter out results of the sort that you might return as a RowsOfFields object, or a nested yaml/json array. +### API + +To use this filter in your annotated-commands-aware application (see [g1a/starter](https://github.com/g1a/starter)), ensure that the filter hooks are registered with +``` +$commandClasses = [ + \Consolidation\Filter\Hooks\FilterHooks::class, // Filter hooks + \MyApp\Commands\MyCommands::class, // Commandfiles for your application +]; +$runner = new \Robo\Runner($commandClasses); +``` +Then, any command that returns RowsOfFields data (see [consolidation/output-formatters](https://github.com/consolidation/output-formatters)) or an array may utilize the output filter feature simply by annotating its command method with `@filter-output`. +``` + /** + * Convert a command from one format to another, potentially with filtering. + * + * @command example + * @filter-output + * @return array + */ + public function example(array $parameters, $options = ['format' => 'yaml']) + { + return $this->doSomething($parameters); + } +``` +Annotating a command in this way will automaitically attach a `--filter[=FILTER]` option to the command. The output of the command may then be filtered by providing a simple expression: +``` +$ mycmd example p1 p2 --filter='color=red' +``` +The filter decides whether to include or exclude each **top-level element** based on the result of evaluating the provided expression on each element. + +- Nested data elements may be tested, e.g. via `attributes.color=red` +- Simple boolean logic may be used, e.g. `color=red&shape=round` + +Parenthesis are not supported. + ### Commandline Tool This project is bundled with a simple commandline tool, `dot-process`. It is similar to a simple version of `jq`. It is intended for demonstration purposes only. diff --git a/VERSION b/VERSION index 6e8bf73..70426f8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.2.0-dev diff --git a/composer.json b/composer.json index 635c429..20cd850 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "@cs" ], "release": [ - "( echo && echo 'Ensure that VERSION file contains the version to release.' && echo \"Current version: $(cat VERSION)\" && tag=$(cat VERSION) && git tag \"$tag\" && git push origin \"$tag\" )" + "release VERSION" ], "scenario": "scenarios/install", "post-update-cmd": [ diff --git a/composer.lock b/composer.lock index cdbaf38..001cc63 100644 --- a/composer.lock +++ b/composer.lock @@ -121,16 +121,16 @@ }, { "name": "consolidation/annotated-command", - "version": "2.8.4", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "651541a0b68318a2a202bda558a676e5ad92223c" + "reference": "4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/651541a0b68318a2a202bda558a676e5ad92223c", - "reference": "651541a0b68318a2a202bda558a676e5ad92223c", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac", + "reference": "4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac", "shasum": "" }, "require": { @@ -169,20 +169,20 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2018-05-25T18:04:25+00:00" + "time": "2018-09-19T17:47:18+00:00" }, { "name": "consolidation/config", - "version": "1.0.11", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "ede41d946078e97e7a9513aadc3352f1c26817af" + "reference": "c9fc25e9088a708637e18a256321addc0670e578" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/ede41d946078e97e7a9513aadc3352f1c26817af", - "reference": "ede41d946078e97e7a9513aadc3352f1c26817af", + "url": "https://api.github.com/repos/consolidation/config/zipball/c9fc25e9088a708637e18a256321addc0670e578", + "reference": "c9fc25e9088a708637e18a256321addc0670e578", "shasum": "" }, "require": { @@ -192,7 +192,7 @@ }, "require-dev": { "g1a/composer-test-scenarios": "^1", - "phpunit/phpunit": "^4", + "phpunit/phpunit": "^5", "satooshi/php-coveralls": "^1.0", "squizlabs/php_codesniffer": "2.*", "symfony/console": "^2.5|^3|^4", @@ -223,7 +223,7 @@ } ], "description": "Provide configuration services for a commandline tool.", - "time": "2018-05-27T01:17:02+00:00" + "time": "2018-08-07T22:57:00+00:00" }, { "name": "consolidation/log", @@ -331,16 +331,16 @@ }, { "name": "consolidation/robo", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f" + "reference": "31f2d2562c4e1dcde70f2659eefd59aa9c7f5b2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/ac563abfadf7cb7314b4e152f2b5033a6c255f6f", - "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/31f2d2562c4e1dcde70f2659eefd59aa9c7f5b2d", + "reference": "31f2d2562c4e1dcde70f2659eefd59aa9c7f5b2d", "shasum": "" }, "require": { @@ -348,6 +348,8 @@ "consolidation/config": "^1.0.10", "consolidation/log": "~1", "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "g1a/composer-test-scenarios": "^2", "grasmash/yaml-expander": "^1.3", "league/container": "^2.2", "php": ">=5.5.0", @@ -364,7 +366,6 @@ "codeception/aspect-mock": "^1|^2.1.1", "codeception/base": "^2.3.7", "codeception/verify": "^0.3.2", - "g1a/composer-test-scenarios": "^2", "goaop/framework": "~2.1.2", "goaop/parser-reflection": "^1.1.0", "natxet/cssmin": "3.0.4", @@ -407,7 +408,57 @@ } ], "description": "Modern task runner", - "time": "2018-05-27T01:42:53+00:00" + "time": "2018-08-17T18:44:18+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/de33822f907e0beb0ffad24cf4b1b4fae5ada318", + "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-08-24T17:01:46+00:00" }, { "name": "container-interop/container-interop", @@ -496,16 +547,16 @@ }, { "name": "g1a/composer-test-scenarios", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/g1a/composer-test-scenarios.git", - "reference": "4c2b990712dbcb87a0ab618e46f908c731c3a0bb" + "reference": "a166fd15191aceab89f30c097e694b7cf3db4880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/4c2b990712dbcb87a0ab618e46f908c731c3a0bb", - "reference": "4c2b990712dbcb87a0ab618e46f908c731c3a0bb", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/a166fd15191aceab89f30c097e694b7cf3db4880", + "reference": "a166fd15191aceab89f30c097e694b7cf3db4880", "shasum": "" }, "bin": [ @@ -525,7 +576,7 @@ } ], "description": "Useful scripts for testing multiple sets of Composer dependencies.", - "time": "2018-06-10T21:56:28+00:00" + "time": "2018-08-08T23:37:23+00:00" }, { "name": "grasmash/expander", @@ -805,16 +856,16 @@ }, { "name": "knplabs/github-api", - "version": "2.8.0", + "version": "2.10.1", "source": { "type": "git", "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "1e404bffaad30a7acf631b67340757646efbbf71" + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/1e404bffaad30a7acf631b67340757646efbbf71", - "reference": "1e404bffaad30a7acf631b67340757646efbbf71", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/493423ae7ad1fa9075924cdfb98537828b9e80b5", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5", "shasum": "" }, "require": { @@ -832,13 +883,12 @@ "guzzlehttp/psr7": "^1.2", "php-http/guzzle6-adapter": "^1.0", "php-http/mock-client": "^1.0", - "phpunit/phpunit": "^5.5 || ^6.0", - "sllh/php-cs-fixer-styleci-bridge": "^1.3" + "phpunit/phpunit": "^5.5 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8.x-dev" + "dev-master": "2.10.x-dev" } }, "autoload": { @@ -869,7 +919,7 @@ "gist", "github" ], - "time": "2018-03-23T16:42:55+00:00" + "time": "2018-09-05T19:12:14+00:00" }, { "name": "league/container", @@ -1122,16 +1172,16 @@ }, { "name": "php-http/client-common", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd" + "reference": "949ee8a8cba5fa2abe839c87bf7b885ac3330589" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/9accb4a082eb06403747c0ffd444112eda41a0fd", - "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd", + "url": "https://api.github.com/repos/php-http/client-common/zipball/949ee8a8cba5fa2abe839c87bf7b885ac3330589", + "reference": "949ee8a8cba5fa2abe839c87bf7b885ac3330589", "shasum": "" }, "require": { @@ -1153,7 +1203,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -1179,7 +1229,7 @@ "http", "httplug" ], - "time": "2017-11-30T11:06:59+00:00" + "time": "2018-06-22T12:36:17+00:00" }, { "name": "php-http/discovery", @@ -1361,21 +1411,21 @@ }, { "name": "php-http/message", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253" + "reference": "741f2266a202d59c4ed75436671e1b8e6f475ea3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/2edd63bae5f52f79363c5f18904b05ce3a4b7253", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253", + "url": "https://api.github.com/repos/php-http/message/zipball/741f2266a202d59c4ed75436671e1b8e6f475ea3", + "reference": "741f2266a202d59c4ed75436671e1b8e6f475ea3", "shasum": "" }, "require": { - "clue/stream-filter": "^1.3", - "php": ">=5.4", + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", "php-http/message-factory": "^1.0.2", "psr/http-message": "^1.0" }, @@ -1429,7 +1479,7 @@ "message", "psr-7" ], - "time": "2017-07-05T06:40:53+00:00" + "time": "2018-08-15T06:37:30+00:00" }, { "name": "php-http/message-factory", @@ -1685,16 +1735,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.6", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { @@ -1706,12 +1756,12 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -1744,7 +1794,7 @@ "spy", "stub" ], - "time": "2018-04-18T13:57:24+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2921,16 +2971,16 @@ }, { "name": "symfony/config", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402" + "reference": "e5389132dc6320682de3643091121c048ff796b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/1fffdeb349ff36a25184e5564c25289b1dbfc402", - "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402", + "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", + "reference": "e5389132dc6320682de3643091121c048ff796b3", "shasum": "" }, "require": { @@ -2981,20 +3031,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-06-19T14:02:58+00:00" + "time": "2018-09-08T13:15:14+00:00" }, { "name": "symfony/console", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00" + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1b97071a26d028c9bd4588264e101e14f6e7cd00", - "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00", + "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", "shasum": "" }, "require": { @@ -3050,20 +3100,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-23T05:02:55+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/debug", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75" + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/47e6788c5b151cf0cfdf3329116bf33800632d75", - "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75", + "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", "shasum": "" }, "require": { @@ -3106,20 +3156,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-06-25T11:10:40+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8" + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/fdd5abcebd1061ec647089c6c41a07ed60af09f8", - "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", "shasum": "" }, "require": { @@ -3169,20 +3219,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:25+00:00" + "time": "2018-07-26T09:06:28+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed" + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", "shasum": "" }, "require": { @@ -3219,20 +3269,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-06-21T11:10:19+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/finder", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394" + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", - "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", "shasum": "" }, "require": { @@ -3268,20 +3318,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-06-19T20:52:10+00:00" + "time": "2018-10-03T08:46:40+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "cc5e98ed91688a22a7162a8800096356f9076b1d" + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc5e98ed91688a22a7162a8800096356f9076b1d", - "reference": "cc5e98ed91688a22a7162a8800096356f9076b1d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", "shasum": "" }, "require": { @@ -3322,29 +3372,32 @@ "configuration", "options" ], - "time": "2018-05-30T04:26:49+00:00" + "time": "2018-09-17T17:29:18+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-ctype": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -3377,20 +3430,20 @@ "polyfill", "portable" ], - "time": "2018-04-30T19:57:29+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -3402,7 +3455,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -3436,20 +3489,20 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c" + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/acc5a37c706ace827962851b69705b24e71ca17c", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c", + "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", "shasum": "" }, "require": { @@ -3485,20 +3538,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-30T04:24:30+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af" + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/eb17cfa072cab26537ac37e9c4ece6c0361369af", - "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", "shasum": "" }, "require": { @@ -3534,20 +3587,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-02-17T14:55:25+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0" + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", "shasum": "" }, "require": { @@ -3593,7 +3646,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-05-03T23:18:14+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "webmozart/assert", diff --git a/dot-process b/dot-process index 8502297..a9543a4 100755 --- a/dot-process +++ b/dot-process @@ -26,7 +26,7 @@ $classLoader = require $autoloaderPath; $argv = $_SERVER['argv']; $appName = "Dot-Process"; $appVersion = trim(file_get_contents(__DIR__ . '/VERSION')); -$commandClasses = [ \Consolidation\Filter\Cli\OpCommands::class ]; +$commandClasses = [ \Consolidation\Filter\Cli\OpCommands::class, \Consolidation\Filter\Hooks\FilterHooks::class ]; $selfUpdateRepository = 'consolidation/filter-via-dot-access-data'; $configPrefix = 'DOTPROCESS'; $configFilePath = getenv($configPrefix . '_CONFIG') ?: getenv('HOME') . '/.filter-via-dot-access-data/filter-via-dot-access-data.yml'; diff --git a/scenarios/install b/scenarios/install index 8e691b0..16c69e1 100755 --- a/scenarios/install +++ b/scenarios/install @@ -49,4 +49,9 @@ set -ex composer -n validate --working-dir=$dir --no-check-all --ansi composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts -composer -n --working-dir=$dir info + +# If called from a CI context, print out some extra information about +# what we just installed. +if [[ -n "$CI" ]] ; then + composer -n --working-dir=$dir info +fi diff --git a/scenarios/phpunit5/composer.json b/scenarios/phpunit5/composer.json index 9832e0e..f12c202 100644 --- a/scenarios/phpunit5/composer.json +++ b/scenarios/phpunit5/composer.json @@ -51,7 +51,7 @@ "@cs" ], "release": [ - "( echo && echo 'Ensure that VERSION file contains the version to release.' && echo \"Current version: $(cat VERSION)\" && tag=$(cat VERSION) && git tag \"$tag\" && git push origin \"$tag\" )" + "release VERSION" ], "scenario": "scenarios/install", "post-update-cmd": [ diff --git a/scenarios/phpunit5/composer.lock b/scenarios/phpunit5/composer.lock index 3a74e04..0ead70b 100644 --- a/scenarios/phpunit5/composer.lock +++ b/scenarios/phpunit5/composer.lock @@ -121,16 +121,16 @@ }, { "name": "consolidation/annotated-command", - "version": "2.8.4", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/consolidation/annotated-command.git", - "reference": "651541a0b68318a2a202bda558a676e5ad92223c" + "reference": "4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/651541a0b68318a2a202bda558a676e5ad92223c", - "reference": "651541a0b68318a2a202bda558a676e5ad92223c", + "url": "https://api.github.com/repos/consolidation/annotated-command/zipball/4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac", + "reference": "4bdbb8fa149e1cc1511bd77b0bc4729fd66bccac", "shasum": "" }, "require": { @@ -169,20 +169,20 @@ } ], "description": "Initialize Symfony Console commands from annotated command class methods.", - "time": "2018-05-25T18:04:25+00:00" + "time": "2018-09-19T17:47:18+00:00" }, { "name": "consolidation/config", - "version": "1.0.11", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "ede41d946078e97e7a9513aadc3352f1c26817af" + "reference": "c9fc25e9088a708637e18a256321addc0670e578" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/ede41d946078e97e7a9513aadc3352f1c26817af", - "reference": "ede41d946078e97e7a9513aadc3352f1c26817af", + "url": "https://api.github.com/repos/consolidation/config/zipball/c9fc25e9088a708637e18a256321addc0670e578", + "reference": "c9fc25e9088a708637e18a256321addc0670e578", "shasum": "" }, "require": { @@ -192,7 +192,7 @@ }, "require-dev": { "g1a/composer-test-scenarios": "^1", - "phpunit/phpunit": "^4", + "phpunit/phpunit": "^5", "satooshi/php-coveralls": "^1.0", "squizlabs/php_codesniffer": "2.*", "symfony/console": "^2.5|^3|^4", @@ -223,7 +223,7 @@ } ], "description": "Provide configuration services for a commandline tool.", - "time": "2018-05-27T01:17:02+00:00" + "time": "2018-08-07T22:57:00+00:00" }, { "name": "consolidation/log", @@ -331,16 +331,16 @@ }, { "name": "consolidation/robo", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f" + "reference": "31f2d2562c4e1dcde70f2659eefd59aa9c7f5b2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/ac563abfadf7cb7314b4e152f2b5033a6c255f6f", - "reference": "ac563abfadf7cb7314b4e152f2b5033a6c255f6f", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/31f2d2562c4e1dcde70f2659eefd59aa9c7f5b2d", + "reference": "31f2d2562c4e1dcde70f2659eefd59aa9c7f5b2d", "shasum": "" }, "require": { @@ -348,6 +348,8 @@ "consolidation/config": "^1.0.10", "consolidation/log": "~1", "consolidation/output-formatters": "^3.1.13", + "consolidation/self-update": "^1", + "g1a/composer-test-scenarios": "^2", "grasmash/yaml-expander": "^1.3", "league/container": "^2.2", "php": ">=5.5.0", @@ -364,7 +366,6 @@ "codeception/aspect-mock": "^1|^2.1.1", "codeception/base": "^2.3.7", "codeception/verify": "^0.3.2", - "g1a/composer-test-scenarios": "^2", "goaop/framework": "~2.1.2", "goaop/parser-reflection": "^1.1.0", "natxet/cssmin": "3.0.4", @@ -407,7 +408,57 @@ } ], "description": "Modern task runner", - "time": "2018-05-27T01:42:53+00:00" + "time": "2018-08-17T18:44:18+00:00" + }, + { + "name": "consolidation/self-update", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/consolidation/self-update.git", + "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/self-update/zipball/de33822f907e0beb0ffad24cf4b1b4fae5ada318", + "reference": "de33822f907e0beb0ffad24cf4b1b4fae5ada318", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/console": "^2.8|^3|^4", + "symfony/filesystem": "^2.5|^3|^4" + }, + "bin": [ + "scripts/release" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "SelfUpdate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + }, + { + "name": "Alexander Menk", + "email": "menk@mestrona.net" + } + ], + "description": "Provides a self:update command for Symfony Console applications.", + "time": "2018-08-24T17:01:46+00:00" }, { "name": "container-interop/container-interop", @@ -496,16 +547,16 @@ }, { "name": "g1a/composer-test-scenarios", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/g1a/composer-test-scenarios.git", - "reference": "4c2b990712dbcb87a0ab618e46f908c731c3a0bb" + "reference": "a166fd15191aceab89f30c097e694b7cf3db4880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/4c2b990712dbcb87a0ab618e46f908c731c3a0bb", - "reference": "4c2b990712dbcb87a0ab618e46f908c731c3a0bb", + "url": "https://api.github.com/repos/g1a/composer-test-scenarios/zipball/a166fd15191aceab89f30c097e694b7cf3db4880", + "reference": "a166fd15191aceab89f30c097e694b7cf3db4880", "shasum": "" }, "bin": [ @@ -525,7 +576,7 @@ } ], "description": "Useful scripts for testing multiple sets of Composer dependencies.", - "time": "2018-06-10T21:56:28+00:00" + "time": "2018-08-08T23:37:23+00:00" }, { "name": "grasmash/expander", @@ -805,16 +856,16 @@ }, { "name": "knplabs/github-api", - "version": "2.8.0", + "version": "2.10.1", "source": { "type": "git", "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "1e404bffaad30a7acf631b67340757646efbbf71" + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/1e404bffaad30a7acf631b67340757646efbbf71", - "reference": "1e404bffaad30a7acf631b67340757646efbbf71", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/493423ae7ad1fa9075924cdfb98537828b9e80b5", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5", "shasum": "" }, "require": { @@ -832,13 +883,12 @@ "guzzlehttp/psr7": "^1.2", "php-http/guzzle6-adapter": "^1.0", "php-http/mock-client": "^1.0", - "phpunit/phpunit": "^5.5 || ^6.0", - "sllh/php-cs-fixer-styleci-bridge": "^1.3" + "phpunit/phpunit": "^5.5 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8.x-dev" + "dev-master": "2.10.x-dev" } }, "autoload": { @@ -869,7 +919,7 @@ "gist", "github" ], - "time": "2018-03-23T16:42:55+00:00" + "time": "2018-09-05T19:12:14+00:00" }, { "name": "league/container", @@ -1122,16 +1172,16 @@ }, { "name": "php-http/client-common", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd" + "reference": "949ee8a8cba5fa2abe839c87bf7b885ac3330589" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/9accb4a082eb06403747c0ffd444112eda41a0fd", - "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd", + "url": "https://api.github.com/repos/php-http/client-common/zipball/949ee8a8cba5fa2abe839c87bf7b885ac3330589", + "reference": "949ee8a8cba5fa2abe839c87bf7b885ac3330589", "shasum": "" }, "require": { @@ -1153,7 +1203,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -1179,7 +1229,7 @@ "http", "httplug" ], - "time": "2017-11-30T11:06:59+00:00" + "time": "2018-06-22T12:36:17+00:00" }, { "name": "php-http/discovery", @@ -1361,21 +1411,21 @@ }, { "name": "php-http/message", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253" + "reference": "741f2266a202d59c4ed75436671e1b8e6f475ea3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/2edd63bae5f52f79363c5f18904b05ce3a4b7253", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253", + "url": "https://api.github.com/repos/php-http/message/zipball/741f2266a202d59c4ed75436671e1b8e6f475ea3", + "reference": "741f2266a202d59c4ed75436671e1b8e6f475ea3", "shasum": "" }, "require": { - "clue/stream-filter": "^1.3", - "php": ">=5.4", + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", "php-http/message-factory": "^1.0.2", "psr/http-message": "^1.0" }, @@ -1429,7 +1479,7 @@ "message", "psr-7" ], - "time": "2017-07-05T06:40:53+00:00" + "time": "2018-08-15T06:37:30+00:00" }, { "name": "php-http/message-factory", @@ -1679,16 +1729,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.6", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", - "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { @@ -1700,12 +1750,12 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -1738,7 +1788,7 @@ "spy", "stub" ], - "time": "2018-04-18T13:57:24+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2915,16 +2965,16 @@ }, { "name": "symfony/config", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402" + "reference": "e5389132dc6320682de3643091121c048ff796b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/1fffdeb349ff36a25184e5564c25289b1dbfc402", - "reference": "1fffdeb349ff36a25184e5564c25289b1dbfc402", + "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", + "reference": "e5389132dc6320682de3643091121c048ff796b3", "shasum": "" }, "require": { @@ -2975,20 +3025,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-06-19T14:02:58+00:00" + "time": "2018-09-08T13:15:14+00:00" }, { "name": "symfony/console", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00" + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1b97071a26d028c9bd4588264e101e14f6e7cd00", - "reference": "1b97071a26d028c9bd4588264e101e14f6e7cd00", + "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", "shasum": "" }, "require": { @@ -3044,20 +3094,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-23T05:02:55+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/debug", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75" + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/47e6788c5b151cf0cfdf3329116bf33800632d75", - "reference": "47e6788c5b151cf0cfdf3329116bf33800632d75", + "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", "shasum": "" }, "require": { @@ -3100,20 +3150,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-06-25T11:10:40+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8" + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/fdd5abcebd1061ec647089c6c41a07ed60af09f8", - "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", "shasum": "" }, "require": { @@ -3163,20 +3213,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:25+00:00" + "time": "2018-07-26T09:06:28+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed" + "reference": "d69930fc337d767607267d57c20a7403d0a822a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", + "reference": "d69930fc337d767607267d57c20a7403d0a822a4", "shasum": "" }, "require": { @@ -3213,20 +3263,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-06-21T11:10:19+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/finder", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394" + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", - "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", + "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", "shasum": "" }, "require": { @@ -3262,20 +3312,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-06-19T20:52:10+00:00" + "time": "2018-10-03T08:46:40+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "cc5e98ed91688a22a7162a8800096356f9076b1d" + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc5e98ed91688a22a7162a8800096356f9076b1d", - "reference": "cc5e98ed91688a22a7162a8800096356f9076b1d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", "shasum": "" }, "require": { @@ -3316,29 +3366,32 @@ "configuration", "options" ], - "time": "2018-05-30T04:26:49+00:00" + "time": "2018-09-17T17:29:18+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-ctype": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -3371,20 +3424,20 @@ "polyfill", "portable" ], - "time": "2018-04-30T19:57:29+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", + "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "shasum": "" }, "require": { @@ -3396,7 +3449,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -3430,20 +3483,20 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c" + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/acc5a37c706ace827962851b69705b24e71ca17c", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c", + "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", + "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", "shasum": "" }, "require": { @@ -3479,20 +3532,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-30T04:24:30+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af" + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/eb17cfa072cab26537ac37e9c4ece6c0361369af", - "reference": "eb17cfa072cab26537ac37e9c4ece6c0361369af", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", "shasum": "" }, "require": { @@ -3528,20 +3581,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-02-17T14:55:25+00:00" + "time": "2018-10-02T12:28:39+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.12", + "version": "v3.4.17", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0" + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", - "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", + "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", "shasum": "" }, "require": { @@ -3587,7 +3640,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-05-03T23:18:14+00:00" + "time": "2018-10-02T16:33:53+00:00" }, { "name": "webmozart/assert", diff --git a/src/Cli/OpCommands.php b/src/Cli/OpCommands.php index fbc4463..3266403 100644 --- a/src/Cli/OpCommands.php +++ b/src/Cli/OpCommands.php @@ -42,24 +42,6 @@ public function edit($data, $options = ['format' => 'yaml', 'in' => 'auto']) return $this->read($data, $options['in']); } - /** - * @hook alter @filter-output - * @option $filter Filter output based on provided expression - * @default $filter '' - */ - public function filterOutput($result, CommandData $commandData) - { - $expr = $commandData->input()->getOption('filter'); - if (!empty($expr)) { - $factory = LogicalOpFactory::get(); - $op = $factory->evaluate($expr); - $filter = new FilterOutputData(); - $result = $filter->filter($result, $op); - } - - return $result; - } - /** * Read the data provided to this command. */ diff --git a/src/Hooks/FilterHooks.php b/src/Hooks/FilterHooks.php new file mode 100644 index 0000000..9eba673 --- /dev/null +++ b/src/Hooks/FilterHooks.php @@ -0,0 +1,29 @@ +input()->getOption('filter'); + if (!empty($expr)) { + $factory = LogicalOpFactory::get(); + $op = $factory->evaluate($expr); + $filter = new FilterOutputData(); + $result = $filter->filter($result, $op); + } + + return $result; + } +} diff --git a/tests/OpCommandsTest.php b/tests/OpCommandsTest.php index 44ce704..ad0bfcb 100644 --- a/tests/OpCommandsTest.php +++ b/tests/OpCommandsTest.php @@ -25,7 +25,7 @@ class OpCommandsTest extends TestCase public function setUp() { // Store the command classes we are going to test - $this->commandClasses = [ \Consolidation\Filter\Cli\OpCommands::class ]; + $this->commandClasses = [ \Consolidation\Filter\Cli\OpCommands::class, \Consolidation\Filter\Hooks\FilterHooks::class ]; // Define our invariants for our test $this->appName = 'DotProcessFixtureApp';