Download the PHP package scrumworks/property-reader without Composer
On this page you can find all versions of the php package scrumworks/property-reader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download scrumworks/property-reader
More information about scrumworks/property-reader
Files in scrumworks/property-reader
Package property-reader
Short Description Property reader which can work with typed properties and phpdoc
License MIT
Informations about the package property-reader
PHP Property Reader
Installation
Documentation
Class property can be translated to these variants:
null
null
is returned for properties without any information.
It's generally mixed
type, but it's acting differently f.e. in array types.
MixedVariableType
It's returned for variables with mixed
directly information.
ScalarVariableType
Supports this basic scalar types:
int
,integer
float
bool
,boolean
string
ArrayVariableType
Arrays are considered to be seqential array or hashmap.
Arrays are translated in this way: (we use definition array<key, type>
)
- generic
array
has typearray<null, null>
- seqential
int[]
has typearray<null, int>
- hashmap
array<string, string>
has typearray<string, string>
In general - null
in key
is proposing seqential array, other types (only integer
and string
are supported) are
propose hashmap. Only difference is key == value == null
, then it's
generic array.
Warning - mixed[]
has different type than array
We also support nested arrays like int[][]
or array<string, string>[]
ClassVariableType
UnionVariableType
Nullablity of types
Every type can by set to be nullable in this ways:
?int
int|null
Types null
and MixedVariableType
are nullable by default.
Warning - ?int|string
isn't (?int)|string
but int|string|null
Example usage
will result to
VariableType
API
Testing
You can run the tests with:
Contribution Guide
Feel free to open an Issue or add a Pull request.
Credits
People: