for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CarlosIO\Geckoboard\Widgets;
use CarlosIO\Geckoboard\Data\Text\Item;
/**
* Class Text.
*/
class Text extends Widget
{
* @var array Messages
protected $items;
* Set the items property.
*
* @param array $items Set of items to add to the widget
* @return $this
public function setItems($items)
$this->items = $items;
return $this;
}
* Return the items attribute.
* @return array
public function getItems()
if (null === $this->items) {
$this->items = array();
return $this->items;
* Add an item to the item list.
* @param \CarlosIO\Geckoboard\Data\Text\Item $item Item to be added
public function addItem(Item $item)
$this->items[] = $item;
* {@inheritdoc}
public function getData()
return array(
'item' => array_map(
function (Item $item) {
return $item->toArray();
},
$this->getItems()
),
);