Download the PHP package phpexperts/datatype-validator without Composer

On this page you can find all versions of the php package phpexperts/datatype-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package datatype-validator

DataTypeValidator

TravisCI Maintainability Test Coverage

DataTypeValidator is a PHP Experts, Inc., Project designed for easy data type validation.

It supports both traditional, fuzzy, PHP data types (e.g., "1.0" can be both a float, int, and string) and strict data type validations ('1' is only a string, 1.0 is only a float, etc.).

Installation

Via Composer

Usage

Benchmarks

benchmark subject set revs its mem_peak best mean mode worst stdev rstdev diff
DataTypeValidatorBench benchValidator 0 1000 5 1,421,504b 52.561μs 53.824μs 54.211μs 54.648μs 0.769μs 1.43% 3.00x
DataTypeValidatorBench benchNative 0 1000 5 1,357,368b 20.470μs 24.246μs 21.822μs 30.204μs 3.833μs 15.81% 1.00x

Use cases

PHPExperts\DataTypeValidator\DataTypeValidator
✔ Can bulk validate a data array
✔ Will return the name of the data validator logic
✔ Will return an array of invalid keys with explanations
✔ Will silently ignore data not in the rules
✔ Will silently ignore nullable rules with no data
✔ Data cannot be null by default
✔ Any data type that starts with a '?' is nullable
✔ Any data type that ends with '[]' is an array of X
✔ Will allow an empty array of something
✔ Will allow a nullable array of something
✔ Will throw a logic exception if a non string rule is given

PHPExperts\DataTypeValidator\DataTypeValidator: Assertions
✔ Will assert a value is a bool
✔ Will assert a value is an int
✔ Will assert a value is a float
✔ Will assert a value is a string
✔ Will assert a value is an array
✔ Will assert a value is an object
✔ Will assert a value is a callable
✔ Will assert a value is a resource
✔ Will assert an array of something
✔ Will assert an object by its short name
✔ Will assert an object by its full name

PHPExperts\DataTypeValidator\DataTypeValidator: Data Type Checks
✔ Will validate bools strictly
✔ Will validate ints strictly
✔ Will validate floats strictly
✔ Will validate strings strictly
✔ Will validate arrays strictly
✔ Will validate objects
✔ Will validate callables
✔ Will validate resources
✔ Will validate objects by their short name
✔ Will validate objects by their full name
✔ Can validate bools loosely
✔ Can validate ints loosely
✔ Can validate floats loosely
✔ Can validate strings loosely
✔ Can validate arrays loosely
✔ Will validate arrays of something

PHPExperts\DataTypeValidator\IsAFuzzyDataType
✔ Will return true for valid values
✔ Will return false for invalid values
✔ Will match short classes
✔ Will match specific classes
✔ Will work with an array of something

PHPExperts\DataTypeValidator\IsAStrictDataType
✔ Will return true for valid values
✔ Will return false for invalid values
✔ Will match short classes
✔ Will match specific classes
✔ Will work with an array of something

Testing

Contributors

Theodore R. Smith [email protected]
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.

License

MIT license. Please see the license file for more information.


All versions of datatype-validator with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpexperts/datatype-validator contains the following files

Loading the files please wait ....