public function foo($user)
{
    $result = null;
    if ($user->hasAvatar()) {
        $result = 'yeah!';
    }

    // Do whatever with $result...
    return $result;
}
yerine

public function foo($user)
{
	return ($user->hasAvatar()) ? "yeah!" : null;
}
olabilirdi.