Skip to content

Commit

Permalink
Merge pull request #558 from creative-commoners/pulls/7/field-validators
Browse files Browse the repository at this point in the history
API Strongly type return types
  • Loading branch information
GuySartorelli authored Nov 6, 2024
2 parents 13d1eaa + 5aab70f commit f1ec4b7
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/Templates/WorkflowTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
*/
class WorkflowTemplate
{
// These are loosely typed to allow for easy conversion from YAML and backwards compatibility
// e.g. version is likely to be an int, though the DB column it goes into is a Varchar
protected $name;
protected $description;
protected $version;
Expand All @@ -92,29 +94,29 @@ public function __construct($name, $description = '', $version = '0.0', $remindD
$this->sort = $sort;
}

public function getName()
public function getName(): string
{
return $this->name;
return (string) $this->name;
}

public function getVersion()
public function getVersion(): string
{
return $this->version;
return (string) $this->version;
}

public function getDescription()
public function getDescription(): string
{
return $this->description;
return (string) $this->description;
}

public function getRemindDays()
public function getRemindDays(): int
{
return $this->remindDays;
return (int) $this->remindDays;
}

public function getSort()
public function getSort(): int
{
return $this->sort;
return (int) $this->sort;
}

/**
Expand Down

0 comments on commit f1ec4b7

Please sign in to comment.