These types only end up in the type meta information.
class Fixture {
public function verified(string $param) { }
public function unchecked(@string $param) { }
}
$f= new Fixture();
$t->verified(null); // Exception
$t->unchecked(null); // Works
This is equivalent to using API docs only; however, the syntax is checked, whereas in the following, it isn't:
class Fixture {
public function verified(string $param) { }
/** @param string $param */
public function unchecked($param) { }
}
In reflection, a parameter type is available but not reported as a constraint.
These types only end up in the type meta information.
This is equivalent to using API docs only; however, the syntax is checked, whereas in the following, it isn't:
In reflection, a parameter type is available but not reported as a constraint.