Guest User

Untitled

a guest
Feb 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. interface iPost {
  2. public function find($id);
  3. }
  4.  
  5. class Post implements iPost {
  6. public function find($id){
  7. return $id;
  8. }
  9. }
  10.  
  11. class PostController {
  12. private $post;
  13.  
  14. public function __construct() {
  15. $this->post = new Post();
  16. }
  17. }
  18.  
  19. class PostController {
  20. private $post;
  21.  
  22. public function __construct(Post $post) {
  23. $this->post = $post;
  24. }
  25. }
  26.  
  27. class PostController {
  28. private $post;
  29.  
  30. public function __construct(iPost $post) {
  31. $this->post = $post;
  32. }
  33. }
Add Comment
Please, Sign In to add comment