Download the PHP package bishalshrestha/fynix without Composer

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

Fynix

Packagist Version Downloads CI PHP Version

Fynix is a framework-agnostic PHP validation library for typed values, DTOs, files, nested objects, and arrays of objects. It provides immutable fluent rules, a central object validation handler, and structured errors suitable for forms and APIs.

Fynix v3 requires PHP 8.1 or newer.

Installation

Quick start

Define a DTO, register its rules, and validate it at the application boundary:

Registered validation can read declared DTO properties regardless of visibility. Fields referenced by RuleSet, Rule::on(), or RuleBuilder may be public, protected, or private. The nameof() helper verifies that a property exists; getters and magic properties are not invoked automatically.

The default result contains messages keyed by property. When the input is invalid, $errors contains entries such as:

Core concepts

Fynix has a deliberately small public surface:

API Responsibility
Rule Create standalone validators.
Rule::on() Create class-scoped validators with property checks.
Rule::for() Bind a validator to a concrete object for direct validation.
RuleSet Create scoped rules inside a registry factory.
ValidationRegistry Store reusable rules for DTO classes.
ValidationHandler Validate complete objects, nested graphs, and batches.
ValidationError Represent structured field errors.

Rules are immutable. Every fluent configuration method returns a new validator instance.

Rule construction

Standalone values

Use Rule when the value is being validated independently:

validate() returns the first applicable ValidationError or null. validateAll() returns every applicable error as a list.

Class-scoped rules

Use Rule::on() when defining rules for a DTO outside a registry:

The owning class and property must exist. Invalid definitions throw typed rule-definition exceptions.

Object-bound validation

Use Rule::for() for a direct check against one object instance:

This is useful for a focused field check without registering a complete object rule set. Nested object validators are handled by ValidationHandler.

Requiredness and conditions

Fields are required by default. Use optional() to allow null or an empty value, or use required(false) when the boolean form is clearer in a shared rule factory:

Available conditional methods are requiredIf(), requiredUnless(), prohibitedIf(), and prohibitedUnless(). Use sameAs() and differentFrom() for related fields.

Nested objects

Register each nested DTO, then connect it from the parent rule set:

Use objectArray() for a collection of nested DTOs:

Fynix validates the parent structure, checks each nested object type, and resolves the nested class rules through the registry.

Error output

String messages

String messages are the default and are convenient for server-rendered forms:

For nested values, flattened keys use dot notation such as address.city or items.0.name.

Structured errors

Set flattenErrorToString to false when an API needs stable codes and parameters:

Each ValidationError exposes field_name, rule, message, code, parameters, and toArray().

Built-in validators

Rule method Use case
string() Text values, names, labels, and free-form strings.
boolean() Strict boolean values.
number() Numeric values and ranges.
integer() Strict integer values.
decimal() Strict decimal values.
email() Email address format and optional domain checks.
phoneNumber() Phone number format and length.
password() Password length and strength.
dateTime() Date, time, and DateTimeInterface values.
url() URL values.
uuid() UUID values.
ipAddress() IPv4 and IPv6 addresses.
regex() Custom regular-expression formats.
array() / arrayOf() Arrays and repeated scalar rules.
enum() Backed enum values or enum instances.
file() Uploaded files.
image() / images() One or many uploaded images.
object() One nested DTO.
objectArray() An array of nested DTOs.
username() Username format and application-provided uniqueness checks.

All validators share common methods such as required(), optional(), min(), max(), length(), in(), notIn(), and conditional constraints where supported.

Batch validation

Validate several registered objects in one call:

For associative validation, pass flattenErrorToString: false to validateManyAssoc() when structured errors are required.

Composable rules

Use AllOf, AnyOf, and Not for reusable business constraints:

Extending Fynix

Create a custom validator by extending ValidatorBase and implementing the type-specific check:

The base pipeline handles shared requiredness and common constraints before the custom type check runs.

Validation listeners

Implement ValidationListener for logging, metrics, or tracing around object validation:

Listeners receive callbacks before and after validation.

Testing

Run the package test suite and static analysis with Composer:

The repository also provides a Docker-based test environment:

Documentation

The full documentation site contains the complete validator reference, method reference, advanced patterns, and a production-style registration walkthrough:

https://fynixphp.netlify.app

Contributing

Issues and pull requests are welcome. Please read CONTRIBUTING.md before submitting a change.

License

Fynix is released under the MIT License.

Links


All versions of fynix 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 bishalshrestha/fynix contains the following files

Loading the files please wait ...