Skip to content

Commit

Permalink
Add SensitiveParameterValue documentation (php#2165)
Browse files Browse the repository at this point in the history
* Bootstrap SensitiveParameterValue with docgen

* Run `gen_stub.php --replace-classsynopses` and `--replace-methodsynopses`

* Add property

* Add descriptions for SensitiveParameterValue

see php#2162
see php#2163

* Drop trailing whitespace
  • Loading branch information
TimWolla authored and claudepache committed Jun 1, 2023
1 parent 369f6d8 commit ec3b628
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 0 deletions.
1 change: 1 addition & 0 deletions language/predefined/interfaces.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
&language.predefined.stringable;
&language.predefined.unitenum;
&language.predefined.backedenum;
&language.predefined.sensitiveparametervalue;

</part>

Expand Down
101 changes: 101 additions & 0 deletions language/predefined/sensitiveparametervalue.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<phpdoc:classref xml:id="class.sensitiveparametervalue" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The SensitiveParameterValue class</title>
<titleabbrev>SensitiveParameterValue</titleabbrev>

<partintro>

<!-- {{{ SensitiveParameterValue intro -->
<section xml:id="sensitiveparametervalue.intro">
&reftitle.intro;
<para>
The <classname>SensitiveParameterValue</classname> class allows wrapping sensitive
values to protect them against accidental exposure.
</para>
<para>
Values of parameters having the <classname>SensitiveParameter</classname> attribute
will automatically be wrapped inside of a <classname>SensitiveParameterValue</classname>
object within stack traces.
</para>
</section>
<!-- }}} -->

<section xml:id="sensitiveparametervalue.synopsis">
&reftitle.classsynopsis;

<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass>
<classname>SensitiveParameterValue</classname>
</ooclass>

<classsynopsisinfo>
<ooclass>
<modifier>final</modifier>
<classname>SensitiveParameterValue</classname>
</ooclass>
</classsynopsisinfo>

<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<fieldsynopsis>
<modifier>private</modifier>
<modifier>readonly</modifier>
<type>mixed</type>
<varname linkend="sensitiveparametervalue.props.value">value</varname>
</fieldsynopsis>

<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.sensitiveparametervalue')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='SensitiveParameterValue'])">
<xi:fallback/>
</xi:include>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.sensitiveparametervalue')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='SensitiveParameterValue'])">
<xi:fallback/>
</xi:include>
</classsynopsis>
<!-- }}} -->

</section>

<!-- {{{ Random\Randomizer properties -->
<section xml:id="sensitiveparametervalue.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="sensitiveparametervalue.props.value">
<term><varname>value</varname></term>
<listitem>
<para>
The sensitive value to be protected against accidental exposure.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<!-- }}} -->

</partintro>

&language.predefined.sensitiveparametervalue.construct;
&language.predefined.sensitiveparametervalue.debuginfo;
&language.predefined.sensitiveparametervalue.getvalue;

</phpdoc:classref>
<!-- 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
-->
69 changes: 69 additions & 0 deletions language/predefined/sensitiveparametervalue/construct.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="sensitiveparametervalue.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SensitiveParameterValue::__construct</refname>
<refpurpose>Constructs a new SensitiveParameterValue object</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<constructorsynopsis role="SensitiveParameterValue">
<modifier>public</modifier> <methodname>SensitiveParameterValue::__construct</methodname>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</constructorsynopsis>
<para>

</para>

&warn.undocumented.func;

</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
An arbitrary value that should be stored inside the <classname>SensitiveParameterValue</classname> object.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<!-- Return values commented out, as constructors generally don't return a
value. Uncomment this if you do need a return values section (for
example, because there's also a procedural version of the method).
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
</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
-->
52 changes: 52 additions & 0 deletions language/predefined/sensitiveparametervalue/debuginfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="sensitiveparametervalue.debuginfo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SensitiveParameterValue::__debugInfo</refname>
<refpurpose>Protects the sensitive value against accidental exposure</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="SensitiveParameterValue">
<modifier>public</modifier> <type>array</type><methodname>SensitiveParameterValue::__debugInfo</methodname>
<void/>
</methodsynopsis>
<para>
Returns an empty &array; to protect the sensitive value against accidental exposure when using <function>var_dump</function>.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
An empty &array;.
</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
-->
55 changes: 55 additions & 0 deletions language/predefined/sensitiveparametervalue/getvalue.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="sensitiveparametervalue.getvalue" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SensitiveParameterValue::getValue</refname>
<refpurpose>Returns the sensitive value</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="SensitiveParameterValue">
<modifier>public</modifier> <type>mixed</type><methodname>SensitiveParameterValue::getValue</methodname>
<void/>
</methodsynopsis>
<para>

</para>

&warn.undocumented.func;

</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The sensitive value.
</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
-->
4 changes: 4 additions & 0 deletions language/predefined/versions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@
<function name="AllowDynamicProperties::__construct" from="PHP 8 &gt;= 8.2.0"/>
<function name="SensitiveParameter" from="PHP 8 &gt;= 8.2.0"/>
<function name="SensitiveParameter::__construct" from="PHP 8 &gt;= 8.2.0"/>
<function name="SensitiveParameterValue" from="PHP 8 &gt;= 8.2.0"/>
<function name="SensitiveParameterValue::__construct" from="PHP 8 &gt;= 8.2.0"/>
<function name="SensitiveParameterValue::__debugInfo" from="PHP 8 &gt;= 8.2.0"/>
<function name="SensitiveParameterValue::getValue" from="PHP 8 &gt;= 8.2.0"/>
</versions>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down

0 comments on commit ec3b628

Please sign in to comment.