fuel / auth

Fuel PHP Framework - Fuel v1.x Authentication package
http://fuelphp.com/docs/packages/auth/intro.html
76 stars 57 forks source link

Fix user_delete() return value when user_delete() is successful. issue#85 #86

Closed iwashi closed 10 years ago

iwashi commented 10 years ago

As I wrote issue #85, user_delete() should return true when it's successful.

WanWizard commented 10 years ago

It can even be condensed to

if ($user)
{
    return (bool) $user->delete();
}

return false;
iwashi commented 10 years ago

return (bool) $user->delete(); looks good. :+1:

WanWizard commented 10 years ago

You update the PR, or I close it and change it myself?

kenjis commented 10 years ago

@WanWizard He updated this PR already. See "File changed"

Art4 commented 10 years ago

@kenjis I think, @WanWizard wants to have the else statement removed. Find this:

if ($user)
{
    return (bool) $user->delete();
}
else
{
    return false;
}

and replace it with this:

if ($user)
{
    return (bool) $user->delete();
}

return false;
WanWizard commented 10 years ago

Exactly. The else is redundant there.

iwashi commented 10 years ago

Okay, I'm going to update PR from now.

WanWizard commented 10 years ago

Thanks.