Permalink
Browse files

支援 PHP 7 type hint 與 return type 的 getter 與 setter

  • Loading branch information...
1 parent 7974562 commit d4da6261ee4bed2d0bf916d6ffd22b1c5c364237 Sam.IO.Hsiao committed Jul 28, 2016
Showing with 19 additions and 0 deletions.
  1. +19 −0 app/Services/PostService.php
@@ -11,6 +11,9 @@ class PostService
/** @var PostRepository */
private $postRepository;
+ /** @var int */
+ private $postId;
+
/**
* PostService constructor.
* @param PostRepository $postRepository
@@ -29,4 +32,20 @@ public function showTitle(int $id, string $default) : string
{
return $this->postRepository->getTitle($id, $default);
}
+
+ /**
+ * @return int
+ */
+ public function getPostId(): int
+ {
+ return $this->postId;
+ }
+
+ /**
+ * @param int $postId
+ */
+ public function setPostId(int $postId)
+ {
+ $this->postId = $postId;
+ }
}

0 comments on commit d4da626

Please sign in to comment.