Download the PHP package monkeyscloud/monkeyslegion-validation without Composer

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

MonkeysLegion Validation

Attribute‑driven DTO binding & validation for the MonkeysLegion PHP 8.4 framework — self-validating constraints, property hooks, PSR-15 middleware.


✨ Features


🛠 Requirements

Minimum
PHP 8.4
Extensions ext-json, ext-mbstring
PSR psr/http-message ^2.0, psr/http-server-handler ^1.0, psr/http-server-middleware ^1.0

🚀 Installation


⚡ Quick Start

1. Define a DTO with constraints

2. Validate directly

3. Use the helper function

4. PSR-15 middleware integration

When validation fails the client receives:

5. Handler with validated DTO


📦 Built-in Constraints

Strings

Attribute Description
#[NotBlank] Value must not be null, empty string, or empty array
#[Email] Valid e-mail address
#[Length(min, max)] String length within bounds (UTF-8)
#[Pattern(regex)] Matches regular expression
#[Alpha] Letters only
#[Alnum] Letters and digits only
#[Json] Valid JSON string

Numbers

Attribute Description
#[Numeric] Value is numeric (is_numeric)
#[Min(value)] Minimum numeric value
#[Max(value)] Maximum numeric value
#[Range(min, max)] Numeric range
#[Decimal(scale)] Decimal with max scale digits

Collections

Attribute Description
#[Count(min, max)] Array/iterable size within bounds
#[Choice(choices)] Value in allowed list

Dates

Attribute Description
#[Date(format)] Valid date (default: Y-m-d)
#[After(otherField)] Date after another field
#[Before(otherField)] Date before another field

Networking

Attribute Description
#[Url] Valid URL
#[Ip(allowV6)] Valid IP address
#[UuidV4] Valid UUID v4

Cross-field & Type

Attribute Description
#[SameAs(otherField)] Must match another field
#[Type(type)] PHP type check (string, int, float, bool, array, or class)
#[Unique] Marker for uniqueness (consumer provides checker)
#[Callback(fn)] Custom callable validation

🪄 Creating Custom Constraints

Implement ConstraintInterface — the constraint is the validator:

Now #[Slug] is usable on any DTO property — no registration needed.


🧪 Testing

57 tests, 71 assertions covering all 24 constraints.


🗺 Roadmap


🙌 Contributing

  1. Fork & create a feature branch.
  2. Follow MonkeysLegion v2 code standards.
  3. Add unit tests (vendor/bin/phpunit).
  4. Open a PR.

📄 License

Released under the MIT License © 2026 MonkeysCloud.


All versions of monkeyslegion-validation with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-json Version *
ext-mbstring Version *
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/http-factory Version ^1.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 monkeyscloud/monkeyslegion-validation contains the following files

Loading the files please wait ...