When building a “Has” type function, I wonder if I should return a boolean like this
public function HasGolferAccess($user)
{
if( $user instanceof GolferInterface)
{
return 1;
}
else
{
return 0;
}
}
Is this a good practice?
EDIT
This will return a strict boolean (1 and 0 are integers, not strict booleans):
if( $user instanceof GolferInterface)
{
return true;
}
else
{
return false;
}
I would suggest simply doing this: