Permalink
Browse files

Decorator patterm trait

  • Loading branch information...
1 parent a236629 commit 602a4334b59b0b011c7818f0e4ce5225b05d1cda @dave1010 committed Mar 12, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 Decorator.php
View
@@ -0,0 +1,15 @@
+<?php
+
+trait Decorator {
+
+ protected $object;
+
+ public function __construct($object) {
+ $this->object = $object;
+ }
+
+ public function __call($method, $args) {
+ return call_user_func_array(array($this->object, $method), $args);
+ }
+
+}

0 comments on commit 602a433

Please sign in to comment.