Download the PHP package limoncello-php/validation without Composer

On this page you can find all versions of the php package limoncello-php/validation. 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 validation

Scrutinizer Code Quality Code Coverage Build Status License

This validation library fast, easy to use yet very powerful and flexible solution. Unlike many other libraries it does not try to give you 'validation rules' for all possible cases because those implementations might not fit your requirements and using such libraries is a pain. Instead it provides an extremely simple way of adding custom validation rules.

Also it supports caching of validation rules which makes it very fast. Custom error codes and messages are supported as well. Error messages could be customized/localized and support placeholders.

Usage sample

Full sample code is here.

As you can see such custom rules as sku, amount, deliveryDate, address1, address2 and areTermsAccepted could be perfectly combined with built-in required and nullable. It makes the rules reusable in CREATE and UPDATE operations where typically inputs are required on creation and optional on update.

How easy to write those rules? Many could be made from built-in ones below (e.g. amount, address1, address2 and areTermsAccepted)

equals, notEquals, inValues, lessThan, lessOrEquals, moreThan, moreOrEquals, between, stringLengthBetween, stringLengthMin, stringLengthMax, regexp, nullable, stringToBool, stringToDateTime, stringToFloat, stringToInt, stringArrayToIntArray, andX, orX, ifX, success, fail, required, enum, filter, isArray, isString, isBool, isInt, isFloat, isNumeric, isDateTime

Custom rule such as IsSkuRule might require quering database and could be added with minimal overhead

When validator is created a developer can pass PSR Container with custom services and have access to this container from validation rules. Thus validation could be easily integrated with application logic.

Sample application

Installation

Note: for message translation PHP-intl is needed.

Issues

Any related issues please send to limoncello.

Testing


All versions of validation with dependencies

PHP Build Version
Package Version
Requires limoncello-php/contracts Version ^0.10.0
limoncello-php/common Version ^0.10.0
php Version >=7.3.0
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 limoncello-php/validation contains the following files

Loading the files please wait ....