Download the PHP package juanchosl/validators without Composer

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

Validators

Description

Little methods collection in order to validate variables contents

Install

How to use

Validation availability

Important: from version 1.0.9 the multi-validations classes has been callables, you can prepare a sequence of validations into a variable and call it as a unction with the values to check as parameters.

The getResult method, maybe can be removed on future versions

How works

Primitives and scalars

The validators checking the type of value, and provide a relative options, as a number compartions for NumberValidators, but not for StringValidators, or a PrimitiveValidation::isBoolEquivalent for strings as true, yes, on, false, no, off...but not on StringValidation (a string false is a string really), in order to reduce and group the logics for every task

Hashes

We have the hash and hashhmac signatures validations, usefull for any project, can be reused very easy in any task, as to verificate downloaded or received files, authorization headers, security tokens, payloads, etc...

Iterables

We have some grouped validations for each type of structures, can be checked distincts type of iterables for any situation

The iterables have validations with the same name of scalar validations (isValueContaining, isValueValidating...), but perform the checking over each element, in order to verify all contents with an only call. As Scalar validations, not all iterables have the same validators, a list does not check keys, because needs to be auto-numbered, List and Array, does not have validation over child attributes, its are used for a gruped of scalar values.

Iterable mantains the availability for retro compatibility, but maybe it will be removed in the future, relegatting this responsability to Collection and Entity

Generic methods

Validation Strings Numbers Iterables Primitives Hashes
is x x x x x
isEmpty x x x x x
isNotEmpty x x x x x
isValueStartingWith x x
isValueStartingWithAny x x
isValueEndingWith x x
isValueEndingWithAny x x
isValueContaining x x x
isValueContainingAny x x x
isValueValidating x x x
isValueValidatingAny x x x
isValueEquals x x
isValueEqualsAny x x
isLengthEqualsThan x x x
isLengthGreatherThan x x x
isLengthGreatherOrEqualsThan x x x
isLengthLessThan x x x
isLengthLessOrEqualsThan x x x
isRegex x x

Exclusive methods

Strings Primitives Numerics Hashes Iterables
isNumber isBoolEquivalent isValueEqualsThan isValidatingHash isValueAttributeValidating
isInteger isNull isValueEqualsThanAny isValidatingHashHmac isValueAttributeValidatingAny
isFloat isTrue isValueIntoRange isHash isAnyValueAttributeValidating
isBinary isFalse isValueGreatherThan isAnyValueAttributeValidatingAny
isHexadecimal isValueGreatherThanOrEquals isAnyValueValidating
isMultibyte isValueLessThan isAnyValueValidatingAny
isEncodedAs isValueLessThanOrEquals isKeyContaining
isEmail isValueIntoMargin isKeyContainingAny
isUrl
isIpV4
isIpv6
isMac
isDomain
isDate
isSerialized

Single validation

You can perform an only check over a single value

Multiple validations over 1 value

You can perform a few checks over a single value

Multiple validations over multiple values

You can perform a few checks over multiple values

Alternative validations (OR) over values

You can perform some alternative checks over the values in order to accept it if pass ANY of some condicions

Validations over associative arrays or entities

You can perform checks over the values of an associative array or object, can be simple validations or any other complex validation, indicating the target index. The results of the validations are unitary, for each element

Validations over iterables

Instead of iterate over a collection, as the previous example, you can perform checks over the keys or values of an iterable, can be simple validations or any other complex validation


All versions of validators with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-mbstring Version *
psr/log Version 3.0.*
juanchosl/exceptions Version 1.0.*
juanchosl/datamanipulation Version 1.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 juanchosl/validators contains the following files

Loading the files please wait ...