From 8a0f811a0eede1c24b6fd92b29bff33ea48229be Mon Sep 17 00:00:00 2001 From: David Coallier Date: Fri, 30 May 2008 15:38:22 +0000 Subject: [PATCH] - Added initial documentation for SplTypes. SplEnum, SplBook and SplType are yet to come. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@260472 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/spl_types/book.xml | 46 +++++++++ reference/spl_types/configure.xml | 33 +++++++ reference/spl_types/reference.xml | 27 ++++++ reference/spl_types/splfloat.xml | 62 +++++++++++++ reference/spl_types/splfloat/construct.xml | 103 +++++++++++++++++++++ reference/spl_types/splint.xml | 62 +++++++++++++ reference/spl_types/splint/construct.xml | 98 ++++++++++++++++++++ 7 files changed, 431 insertions(+) create mode 100644 reference/spl_types/book.xml create mode 100644 reference/spl_types/configure.xml create mode 100644 reference/spl_types/reference.xml create mode 100644 reference/spl_types/splfloat.xml create mode 100644 reference/spl_types/splfloat/construct.xml create mode 100644 reference/spl_types/splint.xml create mode 100644 reference/spl_types/splint/construct.xml diff --git a/reference/spl_types/book.xml b/reference/spl_types/book.xml new file mode 100644 index 0000000000..49d2f41b5b --- /dev/null +++ b/reference/spl_types/book.xml @@ -0,0 +1,46 @@ + + + + + + SPL_Types + + + + &reftitle.intro; + + 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. + + &warn.experimental; + + + + &reference.spl_types.reference; + &reference.spl_types.splint; + &reference.spl_types.splfloat; + + + + + diff --git a/reference/spl_types/configure.xml b/reference/spl_types/configure.xml new file mode 100644 index 0000000000..112c2c177c --- /dev/null +++ b/reference/spl_types/configure.xml @@ -0,0 +1,33 @@ + + +
+ &reftitle.install; + + &pecl.info; + http://pecl.php.net/package/spl_types + + + pecl install spl_types + +
+ + diff --git a/reference/spl_types/reference.xml b/reference/spl_types/reference.xml new file mode 100644 index 0000000000..1734278e20 --- /dev/null +++ b/reference/spl_types/reference.xml @@ -0,0 +1,27 @@ + + + + SPL_Types &Functions; + SPL_Types + + + diff --git a/reference/spl_types/splfloat.xml b/reference/spl_types/splfloat.xml new file mode 100644 index 0000000000..cd07c1d843 --- /dev/null +++ b/reference/spl_types/splfloat.xml @@ -0,0 +1,62 @@ + + + + The SplFloat class + SplFloat + + + + +
+ &reftitle.intro; + + 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. + +
+ + +
+ &reftitle.classsynopsis; + + + + SplFloat + + + + + SplFloat + + + + + + Methods + + + +
+
+
+ + diff --git a/reference/spl_types/splfloat/construct.xml b/reference/spl_types/splfloat/construct.xml new file mode 100644 index 0000000000..acf3376d67 --- /dev/null +++ b/reference/spl_types/splfloat/construct.xml @@ -0,0 +1,103 @@ + + + + + SplFloat::__construct + Constructs a float object type + + + + &reftitle.description; + + SplFloat::__construct + + + + This constructs a new object of type float. + + + + + &reftitle.parameters; + + + input + + + The input parameter accepts a float + or an integer. If you pass an integer, it will be converted + to float. + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.examples; + + + <function>SplFloat::__construct</function> example + +getMessage() . PHP_EOL; +} + +var_dump($float); +var_dump($newFloat); +?> +]]> + + &example.outputs; + + + float(3.154) +} +object(SplFloat)#2 (1) { + ["__default"]=> + float(3) +} +]]> + + + + + + + diff --git a/reference/spl_types/splint.xml b/reference/spl_types/splint.xml new file mode 100644 index 0000000000..51ef02d17d --- /dev/null +++ b/reference/spl_types/splint.xml @@ -0,0 +1,62 @@ + + + + The SplInt class + SplInt + + + + +
+ &reftitle.intro; + + 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. + +
+ + +
+ &reftitle.classsynopsis; + + + + SplInt + + + + + SplInt + + + + + + Methods + + + +
+
+
+ + diff --git a/reference/spl_types/splint/construct.xml b/reference/spl_types/splint/construct.xml new file mode 100644 index 0000000000..f8ac8a8a4f --- /dev/null +++ b/reference/spl_types/splint/construct.xml @@ -0,0 +1,98 @@ + + + + + SplInt::__construct + Constructs an integer object type + + + + &reftitle.description; + + SplInt::__construct + + + + This constructs a new object of type float. + + + + + &reftitle.parameters; + + + input + + + The input parameter accepts an integer + It will throw an UnexpectedValueException if you pass anything else. + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.examples; + + + <function>SplInt::__construct</function> example + +getMessage() . PHP_EOL; +} + +var_dump($int); +echo $int; // Outputs 94 +?> +]]> + + &example.outputs; + + + int(94) +} +94 +]]> + + + + + + +