Download the PHP package memio/validator without Composer

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

Memio's Validator

A validator library for Memio: allows to define Constraints to check if the built Memio models are valid (e.g. Method cannot be both abstract and final).

Note: This package is part of Memio, a highly opinionated PHP code generator. Have a look at the main repository.

Installation

Install it using Composer:

Example

Let's say we want to check that Arguments aren't scalar. In order to do so, the first thing we'll need to do is to write a Constraint:

Note: In Memio, all Constraints are named after their error message. This isn't a hard coded rule, they can have any name.

We then need to register our rule in an ArgumentValidator:

ArgumentValidator is a ModelValidator called by Validator if the given model is an Argument. However, if the given model is a Method we'd like Validator to check our Constraint against its Arguments. To do so, we need to assemble ModelValidators as follow:

Finally, we need to create a validator and register our ModelValidators in it:

This way we can build specialized validators: one that'd check syntax errors, one that'd check business rules, etc... Possibilities are endless!

Have a look at the main respository to discover the full power of Medio.

Want to know more?

Memio uses phpspec, which means the tests also provide the documentation. Not convinced? Then clone this repository and run the following commands:

You can see the current and past versions using one of the following:

And finally some meta documentation:


All versions of validator with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
memio/model Version ^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 memio/validator contains the following files

Loading the files please wait ....