rfc:reflectionparameter.typehint
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:reflectionparameter.typehint [2014/05/30 16:24] – Clarified introduction. levim | rfc:reflectionparameter.typehint [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Status: Under Discussion | * Status: Under Discussion | ||
* First Published at: http:// | * First Published at: http:// | ||
+ | |||
+ | ===== Introduction ===== | ||
+ | |||
+ | This RFC proposes improvements to the way we handle type information in reflection. This work will make it easier for writing tools that convert type information from reflection into strings. This RFC also adds support the reflection API for type information return types if the [[returntypehinting|Return Type RFC]] is accepted. | ||
===== Proposal ===== | ===== Proposal ===== | ||
- | This RFC proposes a class to represent type information; it also adds methods to ReflectionParameter to utilize | + | This RFC proposes a new class '' |
- | Current | + | The class '' |
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
- | 5.next (5.7) | + | PHP 7 |
===== New Reflection class type: ReflectionTypeAnnotation ===== | ===== New Reflection class type: ReflectionTypeAnnotation ===== | ||
- | | + | < |
+ | class ReflectionTypeAnnotation implements Reflector { | ||
public function __toString() { /* returns type annotation string (e.g. " | public function __toString() { /* returns type annotation string (e.g. " | ||
public function isArray() { /* true if the typehint is " | public function isArray() { /* true if the typehint is " | ||
public function isCallable() { /* true if the typehint is " | public function isCallable() { /* true if the typehint is " | ||
public function isNullable() { /* true if NULL is an acceptable value */ } | public function isNullable() { /* true if NULL is an acceptable value */ } | ||
- | | + | } |
+ | </ | ||
===== Implementation and new unit test ===== | ===== Implementation and new unit test ===== | ||
Original proposal: https:// | Original proposal: https:// | ||
+ | |||
Current proposal: https:// | Current proposal: https:// |
rfc/reflectionparameter.typehint.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1