Skip to content

Instantly share code, notes, and snippets.

@marcelsud
Last active December 25, 2015 12:59
Show Gist options
  • Save marcelsud/6979927 to your computer and use it in GitHub Desktop.
Save marcelsud/6979927 to your computer and use it in GitHub Desktop.
<?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