for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sco\Bankcard\Traits;
trait HasAttributes
{
protected $attributes = [];
public function getAttributes()
return $this->attributes;
}
public function getAttribute($name, $default = null)
return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
public function setAttribute($name, $value)
$this->attributes[$name] = $value;
return $this;
public function merge(array $attributes)
$this->attributes = array_merge($this->attributes, $attributes);