eloquent / typhax

A flexible PHP type hinting syntax.
MIT License
13 stars 0 forks source link

Added "base types" to extension types. #41

Closed jmalloc closed 11 years ago

jmalloc commented 11 years ago

This allows for a syntax whereby an extension type is literally an extension to an existing type. For example, in the constraints library I am writing I would like to be able to constrain an integer to a certain range, the syntax extension in this pull requests allows the following:

@param integer:Constraint { min: 0, max: 200 }

I think this is quite expressive and allows for even greater flexibility. The previous syntax remains:

@param :Constraint { min: 0, max: 200 }

In this case, the "base type" simply defaults to a MixedType.

jmalloc commented 11 years ago

Closed in favour of #42.