Implement creating of meta data and tests

This commit is contained in:
James Brooks
2017-06-13 19:34:50 +01:00
parent 63e38a4b2c
commit f11c1edeee
5 changed files with 49 additions and 3 deletions

View File

@@ -96,6 +96,13 @@ final class CreateIncidentCommand
*/
public $template_vars;
/**
* Meta key/value pairs.
*
* @var array
*/
public $meta = [];
/**
* The validation rules.
*
@@ -112,6 +119,7 @@ final class CreateIncidentCommand
'stickied' => 'required|bool',
'occurred_at' => 'nullable|string',
'template' => 'nullable|string',
'meta' => 'required|array',
];
/**
@@ -128,10 +136,11 @@ final class CreateIncidentCommand
* @param string|null $occurred_at
* @param string|null $template
* @param array $template_vars
* @param array $meta
*
* @return void
*/
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $stickied, $occurred_at, $template, array $template_vars = [])
public function __construct($name, $status, $message, $visible, $component_id, $component_status, $notify, $stickied, $occurred_at, $template, array $template_vars = [], $meta = [])
{
$this->name = $name;
$this->status = $status;
@@ -144,5 +153,6 @@ final class CreateIncidentCommand
$this->occurred_at = $occurred_at;
$this->template = $template;
$this->template_vars = $template_vars;
$this->meta = $meta;
}
}