Пример #1
0
        self::$retStatic .= "after myStaticMethodWithArgs\n";
        return self::$retStatic;
    }
    function __call($method, $arguments)
    {
        $r = "before __call\n";
        $r .= sfMixer::callMixins();
        $r .= "after __call\n";
        return $r;
    }
}
$m = new myClass();
$t->is($m->myMethod(), "before myMethod\nafter myMethod\n", 'method call without mixins');
$t->is(myClass::myStaticMethod(), "before myStaticMethod\nafter myStaticMethod\n", 'static method call without mixins');
try {
    $m->newMethod();
    $t->fail('method call that does not exist');
} catch (Exception $e) {
    $t->pass('method call that does not exist');
}
class myClassMixins
{
    public function myMixinMethod($object)
    {
        $object->ret .= "in myMethod mixin method\n";
    }
    public function myMethodWithSeveralHooks($object)
    {
        $object->ret .= "in myMethodWithSeveralHooks mixin method for default hook\n";
    }
    public function myMethodWithSeveralHooksBefore($object)