mirror of
https://github.com/getgrav/grav.git
synced 2026-07-07 08:42:22 +02:00
Better follow protected Object Property interfaces in traits
This commit is contained in:
@@ -69,7 +69,6 @@ trait LazyPropertyTrait
|
||||
/**
|
||||
* @param string $property Object property to be updated.
|
||||
* @param mixed $value New value.
|
||||
* @return $this
|
||||
*/
|
||||
protected function doSetProperty($property, $value)
|
||||
{
|
||||
@@ -78,20 +77,15 @@ trait LazyPropertyTrait
|
||||
} else {
|
||||
$this->setArrayProperty($property, $value);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $property Object property to be unset.
|
||||
* @return $this
|
||||
*/
|
||||
protected function doUnsetProperty($property)
|
||||
{
|
||||
$this->hasObjectProperty($property) ?
|
||||
$this->unsetObjectProperty($property) : $this->unsetArrayProperty($property);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,26 +68,20 @@ trait MixedPropertyTrait
|
||||
/**
|
||||
* @param string $property Object property to be updated.
|
||||
* @param mixed $value New value.
|
||||
* @return $this
|
||||
*/
|
||||
protected function doSetProperty($property, $value)
|
||||
{
|
||||
$this->hasObjectProperty($property)
|
||||
? $this->setObjectProperty($property, $value) : $this->setArrayProperty($property, $value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $property Object property to be unset.
|
||||
* @return $this
|
||||
*/
|
||||
protected function doUnsetProperty($property)
|
||||
{
|
||||
$this->hasObjectProperty($property) ?
|
||||
$this->unsetObjectProperty($property) : $this->unsetArrayProperty($property);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user