for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bone\Server\Traits;
trait HasAttributesTrait
{
/** @var array $attributes */
private $attributes = [];
/**
* @param $key
* @return mixed|null
*/
public function getAttribute($key, $default = null)
return $this->attributes[$key] ?: $default;
}
* @param string $key
* @param $value
* @return $this
public function setAttribute(string $key, $value)
$this->attributes[$key] = $value;
return $this;
* @param array $attributes
public function setAttributes(array $attributes)
$this->attributes = $attributes;
* @return array
public function getAttributes()
return $this->attributes;