Permalink
Browse files

Case 忘了加上 break

  • Loading branch information...
1 parent 22b497e commit 4c015e7c250e0db86916f15789ae216745554ecb @oomusou committed Jul 24, 2016
Showing with 17 additions and 1 deletion.
  1. +17 −1 app/Services/PostService.php
@@ -27,8 +27,24 @@ public function __construct(PostRepository $postRepository)
*/
public function showTitle(int $id, string $default) : string
{
+ switch ($id) {
+ case 1 :
+
+
+
+ $defaultTitle = 'No title 1';
+
+ case 2 :
+ $defaultTitle = 'No title 2';
+ break;
+
+ default:
+ $defaultTitle = $default;
+ break;
+ }
+
return $this->postRepository
- ->getTtle($id, $default)
+ ->getTitle($id, $defaultTitle)
->title;
}
}

0 comments on commit 4c015e7

Please sign in to comment.