php-doc-en/reference/reflection/reflectionclass/getdoccomment.xml
Sammy 210b5020c0
Add trailing semicolon to getDocComment
Although this is valid PHP, other functions' examples in the class (e.g. `getDefaultProperties` and `getConstructor`) contain this trailing semicolon.

Fixes GH-1432
Closes GH-1486.
2022-03-28 14:09:48 +02:00

100 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="reflectionclass.getdoccomment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionClass::getDocComment</refname>
<refpurpose>Gets doc comments</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>ReflectionClass::getDocComment</methodname>
<void/>
</methodsynopsis>
<para>
Gets doc comments from a class. Doc comments start with /**.
If there are multiple doc comments above the class definition,
the one closest to the class will be taken.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The doc comment if it exists, otherwise &false;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><methodname>ReflectionClass::getDocComment</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
/**
* A test class
*
* @param foo bar
* @return baz
*/
class TestClass { }
$rc = new ReflectionClass('TestClass');
var_dump($rc->getDocComment());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(55) "/**
* A test class
*
* @param foo bar
* @return baz
*/"
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ReflectionClass::getName</methodname></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->