Exemple #1
0
        void WriteType(SourceTypeSymbol type)
        {
            _writer.WriteLine($"<member name=\"{CommentIdResolver.GetId(type)}\">");
            var phpdoc = type.Syntax?.PHPDoc;

            if (phpdoc != null)
            {
                WriteSummary(phpdoc.Summary);
            }
            _writer.WriteLine("</member>");
        }
Exemple #2
0
        void WriteRoutine(SourceRoutineSymbol routine)
        {
            var ps = routine.Parameters;

            //
            _writer.WriteLine($"<member name=\"{CommentIdResolver.GetId(routine)}\">");

            // PHPDoc
            var phpdoc = routine.PHPDocBlock;

            if (phpdoc != null)
            {
                WriteSummary(phpdoc.Summary);

                // user parameters
                foreach (var p in phpdoc.Params)
                {
                    // TODO: note the parameter type into Doc comment

                    if (p.VariableName != null && !string.IsNullOrEmpty(p.Description))
                    {
                        WriteParam(p.VariableName.TrimStart('$'), p.Description);
                    }
                }
                var rtag = phpdoc.Returns;
                if (rtag != null && !string.IsNullOrEmpty(rtag.Description))
                {
                    _writer.WriteLine("<returns>{0}</returns>", XmlEncode(rtag.Description));
                }
            }

            // implicit parameters
            foreach (var p in ps)
            {
                if (p.IsImplicitlyDeclared)
                {
                    if (SpecialParameterSymbol.IsContextParameter(p))
                    {
                        WriteParam(p.MetadataName, PhpResources.XmlDoc_ContextParamDescription);
                    }
                }
                else
                {
                    break;  // implicit parameters are always at begining
                }
            }

            _writer.WriteLine("</member>");
        }