Example #1
0
        /**
         * The object @is callable if it has an __invoke method
         */
        public override bool isCallable(Env env, bool isCheckSyntaxOnly, Value nameRef)
        {
            // php/127c, isCheckSyntaxOnly @is not used

            if (_quercusClass.getInvoke() == null)
            {
                if (nameRef != null)
                {
                    nameRef.set(NullValue.NULL);
                }

                return(false);
            }

            if (nameRef != null)
            {
                StringValue sb = env.createStringBuilder();
                sb.append(_quercusClass.getName());
                sb.append("::");
                sb.append("__invoke");

                nameRef.set(sb);
            }

            return(true);
        }