Download the PHP package tezmanian/utils-validate without Composer

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

tez-utils-validate

CI Packagist Version PHP

PHP validation toolkit with guard assertions, composable rules, schema validation, strict type casting, and array-item validation. PHP 8.3+, no framework dependencies.

Installation

Package: tezmanian/utils-validate · Namespace: Tezmanian\Utils\Validate

Components

Class Purpose
Guard Assertion helpers that throw on failure and return the value on success
Rules Stateless boolean predicates — no exceptions, no side-effects
Composite Combines predicates with AND / OR / NONE logic
Schema Validates an array against a shape definition
TypeCast Strict type coercion that throws instead of silently truncating
Each Applies a validation rule to every item in an array

Guard

Assertions that return the value on success, making them suitable for inline use. Throws RuntimeException by default; the exception can be overridden with a class name, an instance, or a closure.

Custom exceptions:


Rules

Stateless boolean predicates. Return true/false — never throw.


Composite

Combines multiple predicates into one using AND, OR, or NONE logic. Each method returns a Closure that can be passed directly to Guard::that().


Schema

Validates an array against a shape definition. Fails fast on the first violation and reports the dot-notation path.

Supported type strings: string, int, float, bool, array, mixed
Prefix with ? to mark a field as optional (absent or null is accepted).

On failure, an UnexpectedValueException is thrown with the dot-notation path:


TypeCast

Strict type coercion — throws UnexpectedValueException when a value cannot be unambiguously converted, unlike PHP built-ins that silently truncate or guess.


Each

Applies a validation rule to every item in an array. Fails fast on the first violation and prepends the index path to the exception message.

The original exception type is preserved, and the original exception is available via getPrevious().


Requirements

Development

License

MIT — see LICENSE.

Author: René Halberstadt


All versions of utils-validate with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
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 tezmanian/utils-validate contains the following files

Loading the files please wait ...