for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace FlatPlan\Components;
abstract class AbstractComponent {
protected $role;
abstract protected function getComponent();
public function setRole($role)
{
if (!in_array($role, $this->roles)) {
throw new \ErrorException('Invalid role supplied.');
}
$this->role = $role;
public function getRole()
return $this->role;
public function __toString()
return json_encode($this->getComponent());