Open
Description
We can check typehint when giving providing or taking it from a function, but how can we typehint something locally?
What works already:
type User = shape('id' => int);
function OnlineStatus(User $user):void{
DB::UserOnline($user); // this function expects a type User
}
OnlineStatus(shape('id' => 1));
btw, phpStorm uses this syntax for local type hinting
type User = shape('id' => int);
/**
* @var User
*/
$user = shape("id" => int);
DB::UserOnline($user)