Download the PHP package takemo101/simple-prop-check without Composer
On this page you can find all versions of the php package takemo101/simple-prop-check. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download takemo101/simple-prop-check
More information about takemo101/simple-prop-check
Files in takemo101/simple-prop-check
Package simple-prop-check
Short Description Simple Prop Check
License MIT
Homepage https://github.com/takemo101/simple-prop-check
Informations about the package simple-prop-check
The Simple Prop Check
The Simple Prop Check is a simple property validator.\ Enjoy!
Installation
Execute the following composer command.
How to use
Please use as follows
PHP Attribute
Validate properties using PHP's Attribute feature.
Property Attribute provided
The following Attribute class is available.
attribute class | detail |
---|---|
Takemo101\SimplePropCheck\Preset\String\URL | Validate URL string |
Takemo101\SimplePropCheck\Preset\String\Domain | Validate domain hostname string |
Takemo101\SimplePropCheck\Preset\String\IP | Validate ip string |
Takemo101\SimplePropCheck\Preset\String\Email | Validate the email address string |
Takemo101\SimplePropCheck\Preset\String\BetweenLength | Verify the number of characters |
Takemo101\SimplePropCheck\Preset\String\MaxLength | Verify the number of characters |
Takemo101\SimplePropCheck\Preset\String\MinLength | Verify the number of characters |
Takemo101\SimplePropCheck\Preset\String\Pattern | Validate regular expressions |
Takemo101\SimplePropCheck\Preset\Array\BetweenSize | Validate the size of the array |
Takemo101\SimplePropCheck\Preset\Array\MaxSize | Validate the size of the array |
Takemo101\SimplePropCheck\Preset\Array\MinSize | Validate the size of the array |
Takemo101\SimplePropCheck\Preset\Array\Unique | Verify array duplication |
Takemo101\SimplePropCheck\Preset\Array\TypedKey | Validate the key type of the array |
Takemo101\SimplePropCheck\Preset\Array\TypedValue | Validate the value type of the array |
Takemo101\SimplePropCheck\Preset\Array\TypedMap | Validate array key and value types |
Takemo101\SimplePropCheck\Preset\Array\Each | Validate the array of each data |
Takemo101\SimplePropCheck\Preset\Numeric\Between | Verify the range of numbers |
Takemo101\SimplePropCheck\Preset\Numeric\Max | Verify the range of numbers |
Takemo101\SimplePropCheck\Preset\Numeric\Min | Verify the range of numbers |
Takemo101\SimplePropCheck\Preset\Numeric\Negative | Validate negative numbers |
Takemo101\SimplePropCheck\Preset\Numeric\Positive | Validate positive numbers |
Takemo101\SimplePropCheck\Preset\Property\GreaterThan | Validate value is greater than other property |
Takemo101\SimplePropCheck\Preset\Property\GreaterThanOrEqual | Validate value is greater than other property |
Takemo101\SimplePropCheck\Preset\Property\LessThan | Validate value is less than other property |
Takemo101\SimplePropCheck\Preset\Property\LessThanOrEqual | Validate value is less than other property |
Takemo101\SimplePropCheck\Preset\Property\NotEquals | Validate that other properties and values are not equal |
Takemo101\SimplePropCheck\Preset\Includes | Validate if value is included |
Takemo101\SimplePropCheck\Preset\NotIncludes | Validate if value is not included |
Takemo101\SimplePropCheck\Preset\NotNull | Validate null value |
Takemo101\SimplePropCheck\Preset\NotEmpty | Validate empty value |
Customize
You can customize the Attribute class etc.
How to customize Property Attribute
First, create an Attribute class that implements AbstractValidatable or Validatable.
Use the created Attribute class as follows.
How to customize Exception Attribute
First, create an Attribute class that implements AbstractException or ExceptionFactory.
Use the created Attribute class as follows.
About the Effect class
The Effect attribute allows you to apply a validation effect to the property of interest.
About the AfterCall class
The AfterCall attribute class allows you to set the method to be called after validating the value of the property.