for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace FlatPlan\Components;
use FlatPlan\Components\Image;
class Gallery extends AbstractComponent {
protected $items = array();
protected $roles = ['gallery', 'mosaic'];
/**
* @param string $role
* @param string $bannerType
* @return void
*/
public function __construct($role)
{
$this->setRole($role);
}
public function setItem($item)
if ($item instanceof Image) {
array_push($this->items, $item);
} else {
throw new \ErrorException('Invalid image component supplied.');
private function getItems()
return $this->items;
protected function getComponent()
$component = new \stdClass();
$component->role = $this->getRole();
$component->items = $this->getItems();
return $component;