コード例 #1
0
        public override T VisitStaticFunctionCall(BoundStaticFunctionCall call)
        {
            CheckMissusedPrimitiveType(call.TypeRef);

            CheckUndefinedMethodCall(call, call.TypeRef.ResolveTypeSymbol(DeclaringCompilation) as TypeSymbol, call.Name);

            // check deprecated
            CheckObsoleteSymbol(call.PhpSyntax, call.TargetMethod, isMemberCall: true);

            // remember there is call to `parent::__construct`
            if (call.TypeRef is BoundReservedTypeRef rt && rt.ReservedType == ReservedTypeRef.ReservedType.parent &&
                call.Name.IsDirect &&
                call.Name.NameValue.Name.IsConstructName)
            {
                CallsParentCtor = true;
            }

            // check the called method is not abstract
            if (call.TargetMethod.IsValidMethod() && call.TargetMethod.IsAbstract)
            {
                // ERR
                Add(call.PhpSyntax.Span, Devsense.PHP.Errors.Errors.AbstractMethodCalled, call.TargetMethod.ContainingType.PhpName(), call.Name.NameValue.Name.Value);
            }

            //
            return base.VisitStaticFunctionCall(call);
        }
コード例 #2
0
 public override object VisitStaticFunctionCall(BoundStaticFunctionCall x)
 {
     return(x.Update(
                (BoundTypeRef)Accept(x.TypeRef),
                (BoundRoutineName)Accept(x.Name),
                VisitImmutableArray(x.ArgumentsInSourceOrder),
                VisitImmutableArray(x.TypeArguments)));
 }
コード例 #3
0
        public override void VisitStaticFunctionCall(BoundStaticFunctionCall call)
        {
            // TODO: Enable the diagnostic when the __callStatic() method is properly processed during analysis
            //CheckUndefinedMethodCall(call, call.TypeRef?.ResolvedType, call.Name);
            base.VisitStaticFunctionCall(call);

            // check deprecated
            CheckObsoleteSymbol(call.PhpSyntax, call.TargetMethod);
        }
コード例 #4
0
ファイル: SourceCompiler.cs プロジェクト: dlob/peachpie
            public override bool VisitStaticFunctionCall(BoundStaticFunctionCall x)
            {
                if (x.TypeRef.IsSelf() || x.TypeRef.IsParent())
                {
                    if (_lazyStaticCalls == null)
                    {
                        _lazyStaticCalls = new List <MethodSymbol>();
                    }

                    if (x.TargetMethod.IsValidMethod() && x.TargetMethod.IsStatic)
                    {
                        _lazyStaticCalls.Add(x.TargetMethod);
                    }
                    else if (x.TargetMethod is AmbiguousMethodSymbol ambiguous)
                    {
                        _lazyStaticCalls.AddRange(ambiguous.Ambiguities.Where(sm => sm.IsStatic));
                    }
                }

                return(base.VisitStaticFunctionCall(x));
            }
コード例 #5
0
 public override void VisitStaticFunctionCall(BoundStaticFunctionCall call)
 {
     // TODO: Enable the diagnostic when the __callStatic() method is properly processed during analysis
     //CheckUndefinedMethodCall(call, call.TypeRef?.ResolvedType, call.Name);
     base.VisitStaticFunctionCall(call);
 }