Add unit tests and usage example to README

This commit is contained in:
victor
2015-08-19 15:52:10 +03:00
parent 013c358a1b
commit a4defb2112
8 changed files with 365 additions and 6 deletions

View File

@@ -43,8 +43,10 @@ class Entity implements ValueAccessInterface
*/
public function removeValue(ValueInterface $value)
{
if ($key = array_search($value, $this->values, true)) {
unset($this->values[$key]);
$index = array_search($value, $this->values, true);
if (false !== $index) {
unset($this->values[$index]);
}
return $this;