예제 #1
0
        public PhpArray getMethods(long filter = -1)
        {
            IEnumerable <RoutineInfo> routines = _tinfo.RuntimeMethods;

            if (_tinfo.IsInterface)
            {
                // enumerate all the interface and collect their methods:
                foreach (var t in _tinfo.Type.ImplementedInterfaces)
                {
                    routines = routines.Concat(t.GetPhpTypeInfo().RuntimeMethods);
                }

                // TODO: remove duplicit names
            }
            else
            {
                // routines are already merged from all the type hierarchy:
            }

            //
            var result = new PhpArray();

            foreach (var routine in routines)
            {
                var rmethod = new ReflectionMethod(routine);
                if (filter == -1 || ((int)rmethod.getModifiers() & filter) != 0)
                {
                    result.Add(rmethod);
                }
            }

            return(result);
        }
예제 #2
0
        public PhpArray getMethods(long filter = -1)
        {
            var result = new PhpArray();

            foreach (var routine in _tinfo.RuntimeMethods)
            {
                var rmethod = new ReflectionMethod(_tinfo, routine);
                if (filter == -1 || ((int)rmethod.getModifiers() & filter) != 0)
                {
                    result.Add(rmethod);
                }
            }

            return(result);
        }