Download the PHP package hollodotme/fluid-validator without Composer

On this page you can find all versions of the php package hollodotme/fluid-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 fluid-validator

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

FluidValidator

Validating data with a fluent interfaced class

Read more about this approach on my blog post.

Requirements

Installation

Available validation methods

Conditional methods

Alvailable since version 1.1.0:

Available since version 1.3.0:

Non-validation methods

Available validation modes

Available message collectors

Basic usage

Prints:

Conditional skip of checks

Available since version 1.1.0.

You often want to check a value only if a previous condition is true. Therefore the generic checkIf method was added, alongside with if-methods for each check method.

Example:

Prints:

Usage with data provider

If you have an object covering a data structure like an array or something like that, e.g. a request object, you can tell the FluidValidator to use this object to retrieve the values to validate from it.

All you need to do is to implement the hollodotme\FluidValidator\Interfaces\ProvidesValuesToValidate interface' method getValueToValidate( $key ).

Usage with message collectors

Available since version 1.2.0.

ScalarListMessageCollector (default)

Prints:

Note: Behaviour is the same as in the basic usage example above.

GroupedListMessageCollector

This collector expects messages to be an assoc. array with scalar keys and values.

Prints:

Note:

Custom message collector implementations

For a custom implementation of a message collector, simply create a class that implements the hollodotme\FluidValidator\Interfaces\CollectsMessages interface.

Extending FluidValidator with own checks

Internally all validation and conditional methods are mapped to protected check methods returning a boolean. TRUE if the check has passed, FALSE otherwise.

So extending FluidValidator is very simple.

1. Extend the class and add a check method

Let's add a method that checks for a valid postal address.

2. Use it for validation / conditions

Now you're able to use this as a validation method with an additional message parameter and as a conditional method with an additional continue parameter:

3. Add method signatures

To have better auto completion in your IDE, add the relevant method signatures to the head phpdoc of your class.


All versions of fluid-validator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
ext-intl 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 hollodotme/fluid-validator contains the following files

Loading the files please wait ....