Skip to content

Commit

Permalink
docs: add return types in sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Nov 1, 2023
1 parent c99c118 commit 7a04c51
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/view_cells/014.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AlertMessageCell extends Cell
protected $message;
private $computed;

public function mount()
public function mount(): void
{
$this->computed = sprintf('%s - %s', $this->type, $this->message);
}
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/view_cells/016.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RecentPostsCell extends Cell
{
protected $posts;

public function linkPost($post)
public function linkPost($post): string
{
return anchor('posts/' . $post->id, $post->title);
}
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/view_cells/018.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class RecentPostsCell extends Cell
{
protected $posts;

public function mount()
public function mount(): void
{
$this->posts = model('PostModel')->orderBy('created_at', 'DESC')->findAll(10);
}
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/outgoing/view_cells/019.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RecentPostsCell extends Cell
{
protected $posts;

public function mount(?int $categoryId)
public function mount(?int $categoryId): void
{
$this->posts = model('PostModel')
->when(
Expand Down

0 comments on commit 7a04c51

Please sign in to comment.