Download the PHP package friendsofhyperf/command-validation without Composer

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

Command Validation

中文说明

Validate a Hyperf command's arguments and options before the command runs.

Installation

The package requires Hyperf ~3.2.0, including hyperf/validation, and declares no optional dependencies. Hyperf discovers the component's empty ConfigProvider automatically, so the component has no configuration to publish.

Usage

Add the ValidatesInput trait to a command and override rules(). You may also override messages() and attributes() to customize validation errors.

Validation Behavior

Hyperf discovers the trait's setUpValidatesInput() hook and runs it before the command executes. The component:

  1. Returns immediately when rules() is empty.
  2. Merges all command arguments and options into the validation data. If an argument and an option have the same key, the option value takes precedence.
  3. Creates a validator with the rules, messages, and attribute names supplied by the command.
  4. Calls validate(). Failed validation throws Hyperf\Validation\ValidationException, so the command handler does not run.

The component ignores the validated data returned by validate() and does not modify the command input. The handler continues to read the original argument and option values. If the container does not provide ValidatorFactoryInterface, validation throws a RuntimeException asking you to install hyperf/validation.

Do not call setUpValidatesInput() directly.

Customization Methods

Method Purpose Default
rules(): array Validation rules for command arguments and options. []
messages(): array Custom validation messages. []
attributes(): array Custom display names for validated fields. []

All versions of command-validation with dependencies

PHP Build Version
Package Version
Requires hyperf/command Version ~3.2.0
hyperf/context Version ~3.2.0
hyperf/di Version ~3.2.0
hyperf/stringable Version ~3.2.0
hyperf/support Version ~3.2.0
hyperf/validation Version ~3.2.0
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 friendsofhyperf/command-validation contains the following files

Loading the files please wait ...