for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\Trello;
use DateTime;
class TrelloMessage
{
/** @var string */
protected $name;
protected $description;
/** @var string|int */
protected $position;
/** @var string|null */
protected $due;
/**
* @param string $name
*
* @return static
*/
public static function create($name = '')
return new static($name);
}
public function __construct($name = '')
$this->name = $name;
* Set the card name.
* @param $name
* @return $this
public function name($name)
return $this;
* Set the card description.
* @param $description
public function description($description)
$this->description = $description;
* Set the card position.
* @param string|int $position
public function position($position)
$this->position = $position;
* Set the card position to 'top'.
public function top()
$this->position = 'top';
* Set the card position to 'bottom'.
public function bottom()
$this->position = 'bottom';
* Set the card position due date.
* @param string|DateTime $due
public function due($due)
if (! $due instanceof DateTime) {
$due = new DateTime($due);
$this->due = $due->format(DateTime::ATOM);
* @return array
public function toArray()
return [
'name' => $this->name,
'desc' => $this->description,
'pos' => $this->position,
'due' => $this->due,
];