for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Composite Utils package.
*
* (c) Emily Shepherd <[email protected]>
* For the full copyright and license information, please view the
* LICENSE.md file that was distributed with this source code.
* @package spaark/composite-utils
* @author Emily Shepherd <emily@emilyshepherd>
* @license MIT
*/
namespace Spaark\CompositeUtils\Traits;
use Spaark\CompositeUtils\Service\ConditionalPropertyAccessor;
trait PropertyAccessTrait
{
use HasReflectorTrait;
* @var ConditionalPropertyAccessor
protected $accessor;
protected function getPropertyAccessor()
if (!$this->accessor)
$this->accessor = new ConditionalPropertyAccessor
(
$this,
self::getReflectionComposite()
);
}
return $this->accessor;
public function __get($property)
return $this->getPropertyAccessor()->getValue($property);
public function __set($property, $value)
$this->getPropertyAccessor()->setValue($property, $value);