Download the PHP package kint/vo without Composer

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

ValueObject

Build Status Scrutinizer Code Quality Code Coverage Codacy Badge Maintainability SensioLabsInsight Packagist PRs Welcome

Value Object (VO) - it's immutable container for your parameters, which knows only about your parameters (how to set/get them) and about validation rules (what type of data allowed for certain parameter). You are not allowed to create VO with invalid parameters (exception will be thrown) - it provides you opportunity to be sure that your VO is always valid. Also, VO is immutable - hence you're on safe side and no one will modify your VO since it created!

Main benefits: now you can use this VO everywhere and you don't have to worry about validation, you don't have to mix your business logic with validation code on every application layer (controller, service, model, etc), also you can use it as type-hint hence your code will be more clear, interface oriented and more precise.

Install

Via composer: composer require kint/vo.

Usage

Value object class:

` getRules` - required method, which returns validation rules for properties of your value object.
These rules - Symfony validators! So you have all power of Symfony validation in your VO!
List of all validation rules (constraints) available here.

Now you can create new instance of VO:

``

In case of invalid data - you'll receive exception with information about all violated rules:

``

As result your code will be super simple, just like that:

``

ENJOY! 🙂

Example with custom validation rules and post-validation behavior available here.

Optional parameters and default values

Optional parameters and default values are out of value object's scope and you have to assign default value to optional parameter before creating value object.

Value Object vs Form

Value Object looks bit similar to Form, but the key difference - is that you can't rely on form everywhere because form may be valid or invalid at any point of time and you have always to check $form->isValid(); but with Value Object you 100% sure it's always valid, hence you can loosely use it everywhere!!!


All versions of vo with dependencies

PHP Build Version
Package Version
Requires symfony/validator Version ^3.1
phpunit/phpunit Version ^5.6
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 kint/vo contains the following files

Loading the files please wait ....