Skip to content

Commit

Permalink
Merge pull request #3 from talifhani/update-parameters
Browse files Browse the repository at this point in the history
Update parameter methods
  • Loading branch information
Ed-leRoux authored Aug 23, 2018
2 parents 3965582 + 24319f5 commit a7bcd13
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/ErrorSpecIssue.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class ErrorSpecIssue
*/
protected $issue;

/** @var array an array of parameters to be replaced in the issue message */
protected $parameters;

/**
* ErrorSpecIssue constructor.
* @param string $id
Expand Down Expand Up @@ -48,11 +51,30 @@ public function getReference()
return $this->reference;
}

/**
* @return $this
*/
public function setParameters($parameters)
{
$this->parameters = $parameters;

return $this;
}

/**
* @return array
*/
private function getParameters($parameters)
{
return $this->parameters;
}

/**
* @return string
*/
public function getIssue(array $parameters = [])
public function getIssue()
{
$parameters = $this->getParameters();
// If parameters have been provided, then ensure that each of the keys are wrapped
// with curly braces, and prepare it before passing it through strtr()
if (!empty($parameters)) {
Expand Down

0 comments on commit a7bcd13

Please sign in to comment.