Skip to content

Commit

Permalink
Refactor isUserChanged to hasUserChanged
Browse files Browse the repository at this point in the history
  • Loading branch information
canni committed Jan 10, 2012
1 parent 56db4a1 commit 3682f62
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -89,7 +89,7 @@ public function setUser($user)
if (!$user instanceof UserInterface) {
$changed = true;
} else {
$changed = !$this->isUserChanged($user);
$changed = !$this->hasUserChanged($user);
}
} elseif ($user instanceof UserInterface) {
$changed = true;
Expand Down Expand Up @@ -223,10 +223,10 @@ public function __toString()
return sprintf('%s(user="%s", authenticated=%s, roles="%s")', $class, $this->getUsername(), json_encode($this->authenticated), implode(', ', $roles));
}

private function isUserChanged(UserInterface $user)
private function hasUserChanged(UserInterface $user)
{
if (!($this->user instanceof UserInterface)) {
throw new \BadMethodCallException('Method "compareUser" should be called when current user class is instance of "UserInterface".');
throw new \BadMethodCallException('Method "hasUserChanged" should be called when current user class is instance of "UserInterface".');
}

if ($this->user instanceof EquatableInterface) {
Expand Down

0 comments on commit 3682f62

Please sign in to comment.