daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Feb 17th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top