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 15, 2024
1 parent 0513531 commit 395c072
Show file tree
Hide file tree
Showing 2 changed files with 13 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
1 change: 1 addition & 0 deletions tests/behat/features/workflow-history.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Feature: Workflow Actions history
And I go to "/admin/pages"
Then I should see "About Us" in the tree

@sboyd
Scenario: I can see page edits as a diff in the Workflow Actions tab
When I click on "About Us" in the tree
Then I should see an edit page form
Expand Down

0 comments on commit 395c072

Please sign in to comment.