|
Revision 53, 0.7 kB
(checked in by mikey, 2 years ago)
|
added possibility of dynamic types (proof of concept, more work has to be put into this if it gets approved)
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
require_once dirname(__FILE__) . '/MyInterface.php'; |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
class AnotherClass implements MyInterface |
|---|
| 16 |
{ |
|---|
| 17 |
|
|---|
| 18 |
* hold bar |
|---|
| 19 |
* |
|---|
| 20 |
* @var MyInterface |
|---|
| 21 |
*/ |
|---|
| 22 |
private $bar; |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
* just foo |
|---|
| 26 |
*/ |
|---|
| 27 |
public function foo() |
|---|
| 28 |
{ |
|---|
| 29 |
|
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
* set bar |
|---|
| 34 |
* |
|---|
| 35 |
* @param MyInterface $bar |
|---|
| 36 |
*/ |
|---|
| 37 |
public function setBar(MyInterface $bar) |
|---|
| 38 |
{ |
|---|
| 39 |
$this->bar = $bar; |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
* return bar |
|---|
| 44 |
* |
|---|
| 45 |
* @return MyInterface |
|---|
| 46 |
*/ |
|---|
| 47 |
public function getBar() |
|---|
| 48 |
{ |
|---|
| 49 |
return $this->bar; |
|---|
| 50 |
} |
|---|
| 51 |
} |
|---|
| 52 |
?> |
|---|