Skip to content

Commit

Permalink
Misc object fixes (new features only)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Jan 9, 2018
1 parent 154fa4e commit ae245c0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function doHasProperty($property)
*/
protected function &doGetProperty($property, $default = null, $doCreate = false)
{
if (!$this->doHasProperty($property)) {
if (!array_key_exists($property, $this->_elements)) {
if ($doCreate) {
$this->_elements[$property] = null;
} else {
Expand All @@ -64,7 +64,7 @@ protected function &doGetProperty($property, $default = null, $doCreate = false)

/**
* @param string $property Object property to be updated.
* @param string $value New value.
* @param mixed $value New value.
*/
protected function doSetProperty($property, $value)
{
Expand All @@ -86,7 +86,7 @@ protected function doUnsetProperty($property)
*/
protected function getElement($property, $default = null)
{
return $this->doHasProperty($property) ? $this->_elements[$property] : $default;
return array_key_exists($property, $this->_elements) ? $this->_elements[$property] : $default;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function &doGetProperty($property, $default = null, $doCreate = false)

/**
* @param string $property Object property to be updated.
* @param string $value New value.
* @param mixed $value New value.
* @return $this
*/
protected function doSetProperty($property, $value)
Expand Down Expand Up @@ -104,7 +104,7 @@ protected function getElement($property, $default = null)
return $this->getObjectElement($property, $default);
}

return $this->getArrayElement($property, $default, false);
return $this->getArrayElement($property, $default);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function &doGetProperty($property, $default = null, $doCreate = false)

/**
* @param string $property Object property to be updated.
* @param string $value New value.
* @param mixed $value New value.
* @return $this
*/
protected function doSetProperty($property, $value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function &doGetProperty($property, $default = null, $doCreate = false)

/**
* @param string $property Object property to be updated.
* @param string $value New value.
* @param mixed $value New value.
* @throws \InvalidArgumentException
*/
protected function doSetProperty($property, $value)
Expand Down

0 comments on commit ae245c0

Please sign in to comment.