[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/reflection/reflectionclass/_getconstant.xml_getd
From:       Christoph_Michael_Becker <cmb () php ! net>
Date:       2019-02-25 11:37:39
Message-ID: svn-cmb-1551094659-346901-2092644611 () svn ! php ! net
[Download RAW message or body]

cmb                                      Mon, 25 Feb 2019 11:37:39 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=346901

Log:
Improve docs

Patch provided by Florian Berberich.

Changed paths:
    U   phpdoc/en/trunk/reference/reflection/reflectionclass/getconstant.xml
    U   phpdoc/en/trunk/reference/reflection/reflectionclass/getdoccomment.xml

Modified: phpdoc/en/trunk/reference/reflection/reflectionclass/getconstant.xml
===================================================================
--- phpdoc/en/trunk/reference/reflection/reflectionclass/getconstant.xml	2019-02-25 \
                11:29:27 UTC (rev 346900)
+++ phpdoc/en/trunk/reference/reflection/reflectionclass/getconstant.xml	2019-02-25 \
11:37:39 UTC (rev 346901) @@ -29,7 +29,7 @@
      <term><parameter>name</parameter></term>
      <listitem>
       <para>
-       Name of the constant.
+       The name of the class constant to get.
       </para>
      </listitem>
     </varlistentry>
@@ -40,10 +40,45 @@
  <refsect1 role="returnvalues">
   &reftitle.returnvalues;
   <para>
-   Value of the constant.
+   Value of the constant with the name <parameter>name</parameter>.
+   Returns &false; if the constant was not found in the class.
   </para>
  </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <para>
+   <example>
+    <title>Usage of <methodname>ReflectionClass::getConstant</methodname></title>
+    <programlisting role="php">
+<![CDATA[
+<?php

+class Example {
+    const C1 = false;
+    const C2 = 'I am a constant';
+}
+
+$reflection = new ReflectionClass('Example');
+
+var_dump($reflection->getConstant('C1'));
+var_dump($reflection->getConstant('C2'));
+var_dump($reflection->getConstant('C3'));
+?>
+]]>
+    </programlisting>
+    &example.outputs;
+    <screen>
+<![CDATA[
+bool(false)
+string(15) "I am a constant"
+bool(false)
+]]>
+    </screen>
+   </example>
+  </para>
+ </refsect1>
+
  <refsect1 role="seealso">
   &reftitle.seealso;
   <para>

Modified: phpdoc/en/trunk/reference/reflection/reflectionclass/getdoccomment.xml
===================================================================
--- phpdoc/en/trunk/reference/reflection/reflectionclass/getdoccomment.xml	2019-02-25 \
                11:29:27 UTC (rev 346900)
+++ phpdoc/en/trunk/reference/reflection/reflectionclass/getdoccomment.xml	2019-02-25 \
11:37:39 UTC (rev 346901) @@ -14,11 +14,11 @@
    <void />
   </methodsynopsis>
   <para>
-   Gets doc comments from a class.
+   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>

-  &warn.undocumented.func;
-
  </refsect1>

  <refsect1 role="parameters">



-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic