mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Added splenum documentation (initial)
- Modified whitespaces for <para> so all is compliant - Added splenum reference in book.xml git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@260481 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
db367ae954
commit
9f2c0d9b7a
5 changed files with 193 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- State: new -->
|
||||
|
||||
<book xml:id="book.spl_types" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
@ -10,9 +10,9 @@
|
|||
<preface xml:id="intro.spl_types">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
This extension aims at helping people making PHP a stronger typed
|
||||
language. It provides different typehandling classes as such as
|
||||
integer, float, double, enum, etc.
|
||||
This extension aims at helping people making PHP a stronger typed
|
||||
language. It provides different typehandling classes as such as
|
||||
<type>integer</type>, <type>float</type>, <type>bool</type>, <type>enum</type>, etc.
|
||||
</para>
|
||||
&warn.experimental;
|
||||
</preface>
|
||||
|
@ -21,7 +21,7 @@
|
|||
&reference.spl_types.reference;
|
||||
&reference.spl_types.splint;
|
||||
&reference.spl_types.splfloat;
|
||||
|
||||
&reference.spl_types.splenum;
|
||||
</book>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
61
reference/spl_types/splenum.xml
Normal file
61
reference/spl_types/splenum.xml
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<reference xml:id="class.splenum" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<title>The SplEnum class</title>
|
||||
<titleabbrev>SplEnum</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ splenum intro -->
|
||||
<section xml:id="splenum.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
SplEnum gives you the ability to emulate and create "Enum" objects natively in PHP.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="splenum.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SplEnum</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<modifier>abstract</modifier><classname>SplEnum</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splenum')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
|
||||
</section>
|
||||
</partintro>
|
||||
</reference>
|
||||
|
||||
<!-- 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:"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
|
||||
-->
|
121
reference/spl_types/splenum/construct.xml
Normal file
121
reference/spl_types/splenum/construct.xml
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="splenum.construct" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>SplEnum::__construct</refname>
|
||||
<refpurpose>Constructs an enumeger object type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<constructorsynopsis>
|
||||
<methodname>SplEnum::__construct</methodname>
|
||||
<void />
|
||||
</constructorsynopsis>
|
||||
<para>
|
||||
This constructor is used to set the value and the strictness of the "Enum"
|
||||
Object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>input</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>input</parameter> parameter accepts an <type>enumeger</type>
|
||||
It will throw an UnexpectedValueException if you pass anything else.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>strict</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This is a <type>boolean</type> to indicate if you want the object to
|
||||
be strict or not. If it's value can be changed or not.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>SplEnum::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
class EnumOne extends SplEnum
|
||||
{
|
||||
const __default = 1;
|
||||
}
|
||||
|
||||
class EnumTwo extends SplEnum
|
||||
{
|
||||
const __default = 2;
|
||||
}
|
||||
|
||||
class EnumThree extends SplEnum
|
||||
{
|
||||
const __default = 3;
|
||||
}
|
||||
|
||||
$enumOne = new EnumOne();
|
||||
$enumTwo = new EnumTwo();
|
||||
$enumThree = new EnumThree();
|
||||
|
||||
|
||||
echo 'Enum one : ' . $enumOne . PHP_EOL;
|
||||
echo 'Enum two : ' . $enumTwo . PHP_EOL;
|
||||
echo 'Enum three: ' . $enumThree . PHP_EOL;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Enum one : 1
|
||||
Enum two : 2
|
||||
Enum three: 3
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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:"../../../../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
|
||||
-->
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<reference xml:id="class.splfloat" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<title>The SplFloat class</title>
|
||||
<titleabbrev>SplFloat</titleabbrev>
|
||||
|
@ -10,8 +10,8 @@
|
|||
<section xml:id="splfloat.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
The SplFloat class is used to enforce strong typing of the float type. By instantiating this
|
||||
class, you insure that your variable is a float and will remain a float.
|
||||
The SplFloat class is used to enforce strong typing of the float type. By instantiating this
|
||||
class, you insure that your variable is a float and will remain a float.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<reference xml:id="class.splint" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<title>The SplInt class</title>
|
||||
<titleabbrev>SplInt</titleabbrev>
|
||||
|
@ -10,8 +10,8 @@
|
|||
<section xml:id="splint.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
The SplInt class is used to enforce strong typing of the integer type. By instantiating this
|
||||
class, you insure that your variable is an integer and will remain an integer.
|
||||
The SplInt class is used to enforce strong typing of the integer type. By instantiating this
|
||||
class, you insure that your variable is an integer and will remain an integer.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
|
Loading…
Reference in a new issue