Download the PHP package horde/constraint without Composer

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

Horde_Constraint

Modern constraint library for evaluating values against rules.

Build Status

Overview

Horde_Constraint provides a flexible system for building and evaluating constraints (rules) that determine whether values satisfy certain conditions. It's useful for validation, filtering, and conditional logic.

Dual-Stack API:

Installation

Quick Start

Modern API (Recommended)

Legacy API

Available Constraints

Logical Constraints

AllOf - All constraints must pass (AND logic)

AnyOf - Any constraint must pass (OR logic)

Not - Negates another constraint

Comparison Constraints

IsEqual - Checks equality (loose comparison)

IsInstanceOf - Checks if value is instance of a class

IsNull - Checks if value is null

String Constraints

PregMatch - Matches against PCRE regex

Constant Constraints

AlwaysTrue - Always returns true

AlwaysFalse - Always returns false

Usage Examples

Building Complex Rules

Fluent Constraint Building

Filtering with Constraints

Architecture

Interface

All constraints implement:

Compound Constraints

CompoundConstraint is the base for constraints that contain other constraints:

Migration from PSR-0

For Library Users

No changes required - PSR-0 API remains fully functional.

For New Code (Recommended)

Use the modern PSR-4 API:

Class Mapping

PSR-0 PSR-4 (Modern) PSR-4 (BC Alias)
Horde_Constraint Horde\Constraint\Constraint -
Horde_Constraint_And Horde\Constraint\AllOf AndCoupler (deprecated)
Horde_Constraint_Or Horde\Constraint\AnyOf OrCoupler (deprecated)
Horde_Constraint_Coupler Horde\Constraint\CompoundConstraint Coupler (deprecated)
Horde_Constraint_AlwaysTrue Horde\Constraint\AlwaysTrue -
Horde_Constraint_AlwaysFalse Horde\Constraint\AlwaysFalse -
Horde_Constraint_IsEqual Horde\Constraint\IsEqual -
Horde_Constraint_IsInstanceOf Horde\Constraint\IsInstanceOf -
Horde_Constraint_Null Horde\Constraint\IsNull -
Horde_Constraint_Not Horde\Constraint\Not -
Horde_Constraint_PregMatch Horde\Constraint\PregMatch -

System Requirements

Testing

Test Coverage: 40 tests, 68 assertions

Contributing

Contributions are welcome! Please:

  1. Follow PER-1 coding style for new code
  2. Add tests for new constraints
  3. Use Conventional Commits format
  4. Ensure all tests pass on PHP 8.1+

Changelog

See doc/changelog.yml for version history.

License

BSD-2-Clause - see LICENSE for details.

Links

Support

Credits


All versions of constraint with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 horde/constraint contains the following files

Loading the files please wait ...