Skip to content

Commit

Permalink
Expand the variable name in the ObjectIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
everzet committed Dec 19, 2014
1 parent ab9346b commit 4d312d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/AccessorObjectIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public function __construct($accessor)
$this->accessor = $accessor;
}

public function getIdentity($obj)
public function getIdentity($object)
{
if (!method_exists($obj, $this->accessor)) {
throw new \RuntimeException(sprintf('Object of type %s does not have accessor %s', get_class($obj), $this->accessor));
if (!method_exists($object, $this->accessor)) {
throw new \RuntimeException(sprintf('Object of type %s does not have accessor %s', get_class($object), $this->accessor));
}

return $obj->{$this->accessor}();
return $object->{$this->accessor}();
}
}
4 changes: 2 additions & 2 deletions src/CallbackObjectIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public function __construct(callable $callable)
$this->callable = $callable;
}

public function getIdentity($obj)
public function getIdentity($object)
{
return call_user_func($this->callable, $obj);
return call_user_func($this->callable, $object);
}
}
2 changes: 1 addition & 1 deletion src/ObjectIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

interface ObjectIdentifier
{
public function getIdentity($obj);
public function getIdentity($object);
}

0 comments on commit 4d312d7

Please sign in to comment.