<?php
interface testInterface
{
public function doAction();
}
class Foo implements testInterface
{
public function doAction()
{
echo "Action!";
}
}
class Bar
{
protected $test = "test";
}
class Baz
{
public function __construct(testInterface $class)
{
echo "Everything's ok!";
}
}
$foo = new Foo();
$bar = new Bar();
$baz = new Baz($foo);