Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface iPost {
- public function find($id);
- }
- class Post implements iPost {
- public function find($id){
- return $id;
- }
- }
- class PostController {
- private $post;
- public function __construct() {
- $this->post = new Post();
- }
- }
- class PostController {
- private $post;
- public function __construct(Post $post) {
- $this->post = $post;
- }
- }
- class PostController {
- private $post;
- public function __construct(iPost $post) {
- $this->post = $post;
- }
- }
Add Comment
Please, Sign In to add comment