for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\PivotalTracker;
use NotificationChannels\PivotalTracker\Exceptions\CouldNotCreateMessage;
class PivotalTrackerMessage
{
/** @var string */
protected $name;
protected $description;
protected $type = 'chore';
/** @var array list of labels (strings list) */
protected $labels = [];
/**
* @param string $name
*
* @return static
*/
public static function create($name = '')
return new static($name);
}
public function __construct($name = '')
$this->name = $name;
* Set the story name.
* @param $name
* @return $this
public function name($name)
return $this;
* Set the story description.
* @param $description
public function description($description)
$this->description = $description;
* Set the story type.
* @param string $type
* @throws CouldNotCreateMessage
public function type($type)
if (! StoryType::isValid($type)) {
throw CouldNotCreateMessage::invalidStoryType($type);
$this->type = $type;
* Set the story labels.
* @param array|mixed
public function labels($labels)
$this->labels = is_array($labels) ? $labels : func_get_args();
* @return array
public function toArray()
return [
'name' => $this->name,
'description' => $this->description,
'story_type' => $this->type,
'labels' => $this->labels,
];