private function __callTraitMethods($name, $arguments)
    {
        $result = next::caller();

        $traitMethods = $this->getTraitMethods();

        if (!isset($traitMethods[$name])) {
            return $result;
        }

        $method = $this->__reflection()->getMethod($name);

        // don't allow calling private methods unless allowed
        if (!$method->isPublic() && !$this->__enableClassScope) {
            return $result;
        }

        $methods = $traitMethods[$name];
        $methods = array_reverse($methods);

        $scope = $this;
        $level = -1;

        $parent = function($arguments) use($scope, $methods, &$level) {
            $level++;
            if ($level >= count($methods)) {
                return next::caller();
            }
            $result = call_user_func_array([$scope, $methods[$level]], $arguments);
            $level--;
            return $result;
        };

        next::__registerParentCallback($parent);
        $result = $parent($arguments);
        next::__registerParentCallback(null);

        return $result;
    }