Download the PHP package pre/prop-types without Composer
On this page you can find all versions of the php package pre/prop-types. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download pre/prop-types
More information about pre/prop-types
Files in pre/prop-types
Download pre/prop-types
More information about pre/prop-types
Files in pre/prop-types
Vendor pre
Package prop-types
Short Description Prop type validators for Phpx components
License MIT
Package prop-types
Short Description Prop type validators for Phpx components
License MIT
Please rate this library. Is it a good library?
Informations about the package prop-types
Prop Types
This is a PHP take on the ReactJS Prop Types checking. I made it because I wanted an easier way to validate the type and presence of properties in Phpx components.
Getting started
Defining types
We support most of the built-in types:
isRequired
will ensure the value is present in the accompanying properties arrayeither
allows one or more types (preferably two distinct types) for comparison
There are also variations on these:
PropTypes::array()
expects any array values, without a specific typePropTypes::boolean()
is the same asPropTypes::bool()
PropTypes::integer()
is the same asPropTypes::int()
PropTypes::double()
expects double valuesPropTypes::iterable()
expects any iterable valuesPropTypes::numeric()
expects any numeric valuesPropTypes::object()
expects any object values, without a specific type
Validating types
We don't automatically validate props – this must be done by the consumer. And example Phpx render method demonstrates this:
All versions of prop-types with dependencies
PHP Build Version
Package Version
No informations.
The package pre/prop-types contains the following files
Loading the files please wait ....