Download the PHP package danielkellyio/value-comparison without Composer
On this page you can find all versions of the php package danielkellyio/value-comparison. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download danielkellyio/value-comparison
More information about danielkellyio/value-comparison
Files in danielkellyio/value-comparison
Download danielkellyio/value-comparison
More information about danielkellyio/value-comparison
Files in danielkellyio/value-comparison
Vendor danielkellyio
Package value-comparison
Short Description Compare a value to another value in order to perform advanced logic on user input (comparisons such as greater than, starts with, contains and with any or all to compare against multiple)
License MIT
Package value-comparison
Short Description Compare a value to another value in order to perform advanced logic on user input (comparisons such as greater than, starts with, contains and with any or all to compare against multiple)
License MIT
Please rate this library. Is it a good library?
Informations about the package value-comparison
Value Comparison
Compare value to another value in order to perform advanced logic on user input (comparisons such as greater than, starts with, contains and with any or all to compare against multiple)
Why Value Comparison Library?
Value comparison is simple, why have a library for it? My use case is to take an operator from user input (an html select field), so:
- Having the operators in word format solved 2 issues:
- can't have dynamic operators
- provides non-coder friendly terminology
- Having the ability to pass "any" or "all" (once again from user input comma separated seemed a no-brainer)
- Full test coverage for confidence that it'll works every time
- This makes ValueComparison perfectly fit to handle the input of a user interface like this:
Installation
Examples
Methods
- is - check if value is exact match to comparison value (coerced to string)
- isNot - check if value is NOT an exact match to comparison value (coerced to string)
- greaterThan - check if value is greater than comparison value (coerced to integer)
- lessThan - check if value is less than comparison value (coerced to integer)
- contains - check if value is contains comparison value (coerced to string)
- excludes - check if value is excludes comparison value (coerced to string)
- startsWith - check if value is starts with comparison value (coerced to string)
- endsWith - check if value is ends with comparison value (coerced to string)
Scopes
- null - treats comparison value as a single entity to compare against value
- any - value only has to match one of the comparison values (comparison value can be array or comma seperated string)
- all - value has to match ALL of the comparison values (comparison value can be array or comma seperated string)
All versions of value-comparison with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1
The package danielkellyio/value-comparison contains the following files
Loading the files please wait ....