Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Strongly type return types #558

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
GuySartorelli marked this conversation as resolved.
Show resolved Hide resolved
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;
}
GuySartorelli marked this conversation as resolved.
Show resolved Hide resolved

/**
Expand Down