Skip to content

Commit

Permalink
API Strongly type return types
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 31, 2024
1 parent 13d1eaa commit 5aab70f
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 5aab70f

Please sign in to comment.