Last active
December 25, 2015 12:59
-
-
Save marcelsud/6979927 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\Movie; | |
class SomeDatabaseMapper | |
{ | |
public function findAll($table) | |
{ | |
//Find all entries in some way | |
} | |
} | |
class MovieFinder | |
{ | |
public function findAll() | |
{ | |
return (new SomeDatabaseMapper)->findAll("movies"); | |
} | |
} | |
class MovieLister | |
{ | |
public function list() | |
{ | |
return (new MovieFinder)->findAll(); | |
} | |
} | |
$movieLister = new MovieLister; | |
$movieList = $movieLister->list(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment