Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (26 sloc) 0.806 kb
<?php
namespace MovieApp {
class Lister implements FinderAwareInterface {
public $finder;
public function setFinder(Finder $finder){
$this->finder = $finder;
}
}
class Finder {
public function findAllByName($name) {}
}
interface FinderAwareInterface {
public function setFinder(Finder $finder);
}
}
namespace {
// bootstrap
include 'zf2bootstrap' . ((stream_resolve_include_path('zf2bootstrap.php')) ? '.php' : '.dist.php');
$di = new Zend\Di\Di;
$lister = new MovieApp\Lister;
$di->injectDependencies($lister);
// expression to test
$works = ($lister->finder instanceof MovieApp\Finder);
// display result
echo (($works) ? 'It works!' : 'It DOES NOT work!') . PHP_EOL;
}
Jump to Line
Something went wrong with that request. Please try again.