Download the PHP package consolidation/filter-via-dot-access-data without Composer
On this page you can find all versions of the php package consolidation/filter-via-dot-access-data. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download consolidation/filter-via-dot-access-data
More information about consolidation/filter-via-dot-access-data
Files in consolidation/filter-via-dot-access-data
Package filter-via-dot-access-data
Short Description This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.
License MIT
Informations about the package filter-via-dot-access-data
FilterViaDotAccessData
This project uses dflydev/dot-access-data to provide simple output filtering for applications built with annotated-command / Robo.
Overview
This project provides a simple logic expression evaluator which can be used in conjunction with 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), ensure that the filter hooks are registered with
Then, any command that returns RowsOfFields data (see consolidation/output-formatters) or an array may utilize the output filter feature simply by annotating its command method with @filter-output
.
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:
A contains
comparison may be done via the *=
operator:
And, finally, regex compares are also available via ~=
:
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.
Getting Started
To build this project locally, follow the steps below.
Prerequisites
Install dependencies:
If you wish to build the phar for this project, install the box
phar builder via:
Running the tests
The test suite may be run locally by way of some simple composer scripts:
Test | Command |
---|---|
Run all tests | composer test |
PHPUnit tests | composer unit |
PHP linter | composer lint |
Code style | composer cs |
Fix style errors | composer cbf |
Deployment
Deploy by the following procedure:
- Edit the
VERSION
file to contain the version to release, and commit the change. - Run
composer release
Contributing
Please read CONTRIBUTING.md for details on the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the releases page.
Authors
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE file for details