<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/php-contract/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 04 Apr 2012 21:11:39 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/php-contract/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v8 
+++ v9 
@@ -95,7 +95,7 @@
 
 The callback for a routine can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php). The callback for the **Routine** receives the arguments passed to the method.
 
-A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback. These validators use **setHandler( callable $callback )** for the callback to execute when called, which should return a boolean value. In the case when *false* is returned by the **PreCondition** callback the routine will not execute, and a **PreConditionException** will be thrown. And in the case when "false" is returned by the **PostCondition** callback, the object will be returned to it's last state before the execution of the routine, and a **PostConditionException** will be thrown.
+A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback. These validators use **setHandler( callable $callback )** for the callback to execute when called, which should return a boolean value. In the case when *false* is returned by the **PreCondition** callback the routine will not execute, and a **PreConditionException** will be thrown. And in the case when *false* is returned by the **PostCondition** callback, the object will be returned to it's last state before the execution of the routine, and a **PostConditionException** will be thrown.
 
     $preCondition = new PreCondition();
     $preCondition-&gt;setHandler( function( $object, $arguments ) {
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 21:11:39 -0000</pubDate><guid>https://sourceforge.netcc54e236ba7a99cf99b572f9f0b13bfd700634e5</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v7 
+++ v8 
@@ -93,7 +93,7 @@
 &lt;br/&gt;
 If an argument is passed to the routine but is not of the data type specified by the routine in the arguments array, an **InvalidArgumentTypeException** will be thrown. Also, if a number of arguments is passed to the routine which is less than the number expected by the routine, defined by the length of the arguments array, a **MissingRequiredArgumentsException** will be thrown.
 
-The callback for a routine can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php). The callback for the **Routine** receives 2 arguments, the object and the arguments passed.
+The callback for a routine can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php). The callback for the **Routine** receives the arguments passed to the method.
 
 A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback. These validators use **setHandler( callable $callback )** for the callback to execute when called, which should return a boolean value. In the case when *false* is returned by the **PreCondition** callback the routine will not execute, and a **PreConditionException** will be thrown. And in the case when "false" is returned by the **PostCondition** callback, the object will be returned to it's last state before the execution of the routine, and a **PostConditionException** will be thrown.
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 21:02:21 -0000</pubDate><guid>https://sourceforge.net10db874ab4635bf752436101212f15798c246b62</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v6 
+++ v7 
@@ -116,6 +116,14 @@
     $this-&gt;__routine( $routine );
 
 &lt;br/&gt;
-Finally, the **Contract** class provides an **__invariant( void )** magic method. This method is called internally after every routine execution. The purpose of this method is to ensure the object is in a coherent state, and has not been corrupted. This method should return a boolean value. In the case when *false* is returned, the object will be returned to it's last state before the execution of the routine, and an **InvariantException** will be thrown.
+Finally, the **Contract** class provides an **__invariant( void )** magic method. This method is called internally after every routine execution. The purpose of this method is to ensure the object is in a coherent state, and has not been corrupted.
+
+    public function __invariant()
+    {
+        // check object state
+    }
+
+&lt;br/&gt;
+This method should return a boolean value. In the case when *false* is returned, the object will be returned to it's last state before the execution of the routine, and an **InvariantException** will be thrown.
 
 All exceptions related to the PHP Design by Contract package extend the **ContractException** class.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 20:47:41 -0000</pubDate><guid>https://sourceforge.net538e035e6887026d68f7d89b1bc555c78cdc4dae</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v5 
+++ v6 
@@ -103,9 +103,7 @@
     } );
 
     $postCondition = new PostCondition();
-    $postCondition-&gt;setHandler( function( $object, $return ) {
-        return true;
-    } );
+    $postCondition-&gt;setHandler( array( $this, 'testPostCondition' ) );
 
     $routine-&gt;setPreCondition( $preCondition );
     $routine-&gt;setPostCondition( $postCondition );
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 20:46:08 -0000</pubDate><guid>https://sourceforge.netff7303f91bb9fcf3ae7e953a89fd9566a0cab5d1</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v4 
+++ v5 
@@ -3,121 +3,121 @@
 
 **PHP Design by Contract** provides a basic implementation of contract programming for PHP 5.3+ with namespaces.
 
-The base **Contract** class allows new or existing classes to define properties as protected **Attributes** and methods as **Routines**, which require argument type/class validation, aswell as **PreCondition** and **PostCondition** checks. Instances can also check for state consistency with an invariant check.
-
-Using the Contract helps maintain object access coherent by applying a command/query separation when accessing or modifying the instance.
-
+The base **Contract** class allows new or existing classes to define properties as protected **Attributes** and methods as **Routines**, which require argument type/class validation, aswell as **PreCondition** and **PostCondition** checks. Instances can also test for state consistency with an invariant check.
+
 Installation
 ------------
 
 To use the package it's highly recommended to use a [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compatible autoloader for required classes.
 
 You can find a fully compatible autoloader here: [PHP AutoLoad](https://sourceforge.net/p/php-autoload)
 
 Once you've unpacked the files into your include path the package is ready for use.
 
 Configuration
 -------------
 
 This package does not require any pre-configuration.
 
 Implementation
 --------------
 
 To use the base **Contract** class simply extend it with a new or existing class, for example:
 
     class Person extends Contract {
         
         // class members are defined here
     }
 
 &lt;br/&gt;
-When extending the **Contract** class certain magic methods become available. The first of these methods is **__create()**. This method behaves as a constructor function for the instance object.
+When extending the **Contract** class certain magic methods become available. The first of these methods is **__create( void )**. This method behaves as a constructor function for the instance object.
 
     public function __create()
     {
         // object is defined here
     }
 
 &lt;br/&gt;
-To define the **Attributes** (properties) and **Routines** (functions) available for this object there are 2 additional magic method, **__attribute()** and **__routine()**.
-
-The **Attribute** class defines a property for the object, using **setName()** for the name of the property, **setType()** for the data type stored in the property, and **setValue()** for the default value of the property, for example:
+To define the **Attributes** (properties) and **Routines** (methods) available for this object there are 2 additional magic methods, **__attribute( Attribute $attribute )** and **__routine( Routine $routine )**.
+
+The **Attribute** class defines a property for the object, using **setName( string $name )** for the name of the property, **setType( int $type )** for the data type stored in the property, and **setValue( mixed $value )** for the default value of the property, for example:
 
     $attribute = new Attribute();
     $attribute-&gt;setName( 'example' );
     $attribute-&gt;setType( DataTypes::TYPE_STRING );
     $attribute-&gt;setValue( 'Hello World' );
     
 &lt;br/&gt;
 Only the routine of the same object can modify an attribute. If a routine of another object attempts to modify an attribute an **IllegalAttributeAccessException** will be thrown. Additionally, if the data type of the value being set to the attribute is not the same as the type defined by the attribute an **InvalidAttributeTypeException** will be thrown.
 
 Once the attribute has been defined it can be registered on the object.
 
     $this-&gt;__attribute( $attribute );
 
 &lt;br/&gt;
 The **DataTypes** class defines the data types available as the following constants:
 
 - **TYPE_NULL:** A discriminated null value
 - **TYPE_BOOLEAN:** A boolean logical value
 - **TYPE_NUMERIC:** A valid numeric value
 - **TYPE_INTEGER:** A whole number
 - **TYPE_DOUBLE:** A double precision floating point number
 - **TYPE_STRING:** A string of characters
 - **TYPE_ARRAY:** An array of values *(keys permitted)*
 - **TYPE_OBJECT:** An object
 - **TYPE_LAMBDA:** An instance of **Closure**
 - **TYPE_RESOURCE:** An external PHP resource
 
-A routine can be either a *procedure*, or a *function*. The difference between these types is that a procedure is used to modify the state of an object, but does not return a value, whilst a function is used to access the object and return a value, but not modify it's state. This concept is called *command/query spearation*.
-
-The **Routine** class defines a method for the object, using **setName()** for the name of the method, **setType()** for the type of the routine, **setArguments()** for the validation of the data types of the arguments expected and recieved by the method, and **setHandler()** for the callback to execute when called, for example:
+A routine can be either a *procedure* or a *function*. The difference between these types is that a *procedure* is used to modify the state of an object, but does not return a value, whilst a *function* is used to access the object and return a value, but not modify it's state. This concept is called *command/query spearation*.
+
+The **Routine** class defines a method for the object, using **setName( string $name )** for the name of the method, **setType( int $type )** for the type of the routine, **setArguments( array $arguments )** for the validation of the data types of the arguments expected and recieved by the method, and **setHandler( callable $callback )** for the callback to execute when called, for example:
 
     $routine = new Routine();
     $routine-&gt;setName( 'test' );
     $routine-&gt;setType( Routine::TYPE_PROCEDURE );
     $routine-&gt;setArguments( array(
         DataTypes::TYPE_NULL,
         DataTypes::TYPE_BOOLEAN,
         DataTypes::TYPE_NUMERIC,
         DataTypes::TYPE_INTEGER,
         DataTypes::TYPE_DOUBLE,
         DataTypes::TYPE_STRING,
         DataTypes::TYPE_ARRAY,
         DataTypes::TYPE_OBJECT,
         DataTypes::TYPE_LAMBDA,
         DataTypes::TYPE_RESOURCE,
         'Test\MyContract'
     ) );
     $routine-&gt;setHandler( array( $this, 'testRoutine' ) );
 
 &lt;br/&gt;
-If an argument is passed to the routine but is not of the data type specified by the routine with the arguments array, an **InvalidArgumentTypeException** will be thrown. Also, if a number of arguments is passed to the routine which is less than the number expected by the routine, defined by the length of the arguments array, a **MissingRequiredArgumentsException** will be thrown.
-
-The callback for a routine can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php).
-
-A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback. These validators should return a boolean value. In the case when *false* is returned by the **PreCondition** callback the routine will not execute and a **PreConditionException** will be thrown. And in the case when "false" is returned by the **PostCondition** callback, the object will be returned to it's last state before the execution of the routine, and a **PostConditionException** will be thrown.
+If an argument is passed to the routine but is not of the data type specified by the routine in the arguments array, an **InvalidArgumentTypeException** will be thrown. Also, if a number of arguments is passed to the routine which is less than the number expected by the routine, defined by the length of the arguments array, a **MissingRequiredArgumentsException** will be thrown.
+
+The callback for a routine can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php). The callback for the **Routine** receives 2 arguments, the object and the arguments passed.
+
+A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback. These validators use **setHandler( callable $callback )** for the callback to execute when called, which should return a boolean value. In the case when *false* is returned by the **PreCondition** callback the routine will not execute, and a **PreConditionException** will be thrown. And in the case when "false" is returned by the **PostCondition** callback, the object will be returned to it's last state before the execution of the routine, and a **PostConditionException** will be thrown.
 
     $preCondition = new PreCondition();
-    $preCondition-&gt;setHandler( array( $this, 'testPreCondition' ) );
+    $preCondition-&gt;setHandler( function( $object, $arguments ) {
+        return true;
+    } );
 
     $postCondition = new PostCondition();
-    $postCondition-&gt;setHandler( function( $object, $arguments ) {
+    $postCondition-&gt;setHandler( function( $object, $return ) {
         return true;
     } );
 
     $routine-&gt;setPreCondition( $preCondition );
     $routine-&gt;setPostCondition( $postCondition );
 
 &lt;br/&gt;
-The callbacks for a conditions can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php).
+The callbacks for a conditions can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php). The callback for the **PreCondition** receives 2 arguments, the object and the arguments passed to the routine, whilst the callback for the **PostCondition** callback also receives 2 arguments, except the second argument is the return value of the routine.
 
 Once the routine has been defined it can be registered on the object.
 
     $this-&gt;__routine( $routine );
 
 &lt;br/&gt;
-Finally, the **Contract** class provides an **__invariant()** magic method. This method is called internally after every routine execution. The purpose of this method is to ensure the object is in a coherent state, and has not been corrupted. This method should return a boolean value. In the case when *false* is returned, the object will be returned to it's last state before the execution of the routine, and an **InvariantException** will be thrown.
+Finally, the **Contract** class provides an **__invariant( void )** magic method. This method is called internally after every routine execution. The purpose of this method is to ensure the object is in a coherent state, and has not been corrupted. This method should return a boolean value. In the case when *false* is returned, the object will be returned to it's last state before the execution of the routine, and an **InvariantException** will be thrown.
 
 All exceptions related to the PHP Design by Contract package extend the **ContractException** class.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 20:44:44 -0000</pubDate><guid>https://sourceforge.net73d6cdb4e8a24c5107af3402cd04e4ca59893bde</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v3 
+++ v4 
@@ -50,61 +50,74 @@
     $attribute-&gt;setValue( 'Hello World' );
     
 &lt;br/&gt;
+Only the routine of the same object can modify an attribute. If a routine of another object attempts to modify an attribute an **IllegalAttributeAccessException** will be thrown. Additionally, if the data type of the value being set to the attribute is not the same as the type defined by the attribute an **InvalidAttributeTypeException** will be thrown.
+
 Once the attribute has been defined it can be registered on the object.
 
     $this-&gt;__attribute( $attribute );
 
 &lt;br/&gt;
 The **DataTypes** class defines the data types available as the following constants:
 
 - **TYPE_NULL:** A discriminated null value
 - **TYPE_BOOLEAN:** A boolean logical value
 - **TYPE_NUMERIC:** A valid numeric value
 - **TYPE_INTEGER:** A whole number
 - **TYPE_DOUBLE:** A double precision floating point number
 - **TYPE_STRING:** A string of characters
 - **TYPE_ARRAY:** An array of values *(keys permitted)*
 - **TYPE_OBJECT:** An object
 - **TYPE_LAMBDA:** An instance of **Closure**
 - **TYPE_RESOURCE:** An external PHP resource
 
 A routine can be either a *procedure*, or a *function*. The difference between these types is that a procedure is used to modify the state of an object, but does not return a value, whilst a function is used to access the object and return a value, but not modify it's state. This concept is called *command/query spearation*.
 
 The **Routine** class defines a method for the object, using **setName()** for the name of the method, **setType()** for the type of the routine, **setArguments()** for the validation of the data types of the arguments expected and recieved by the method, and **setHandler()** for the callback to execute when called, for example:
 
     $routine = new Routine();
     $routine-&gt;setName( 'test' );
     $routine-&gt;setType( Routine::TYPE_PROCEDURE );
     $routine-&gt;setArguments( array(
         DataTypes::TYPE_NULL,
         DataTypes::TYPE_BOOLEAN,
         DataTypes::TYPE_NUMERIC,
         DataTypes::TYPE_INTEGER,
         DataTypes::TYPE_DOUBLE,
         DataTypes::TYPE_STRING,
         DataTypes::TYPE_ARRAY,
         DataTypes::TYPE_OBJECT,
         DataTypes::TYPE_LAMBDA,
         DataTypes::TYPE_RESOURCE,
         'Test\MyContract'
     ) );
-    $routine-&gt;setHandler( array( $this, 'test_callback' ) );
-
-&lt;br/&gt;
-A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback.
-
-    $preCondition = new PreCondition( array( $this, 'validate' ) );
-
-    $postCondition = new PostCondition( function( $object, $arguments ) {
+    $routine-&gt;setHandler( array( $this, 'testRoutine' ) );
+
+&lt;br/&gt;
+If an argument is passed to the routine but is not of the data type specified by the routine with the arguments array, an **InvalidArgumentTypeException** will be thrown. Also, if a number of arguments is passed to the routine which is less than the number expected by the routine, defined by the length of the arguments array, a **MissingRequiredArgumentsException** will be thrown.
+
+The callback for a routine can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php).
+
+A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback. These validators should return a boolean value. In the case when *false* is returned by the **PreCondition** callback the routine will not execute and a **PreConditionException** will be thrown. And in the case when "false" is returned by the **PostCondition** callback, the object will be returned to it's last state before the execution of the routine, and a **PostConditionException** will be thrown.
+
+    $preCondition = new PreCondition();
+    $preCondition-&gt;setHandler( array( $this, 'testPreCondition' ) );
+
+    $postCondition = new PostCondition();
+    $postCondition-&gt;setHandler( function( $object, $arguments ) {
         return true;
     } );
 
     $routine-&gt;setPreCondition( $preCondition );
     $routine-&gt;setPostCondition( $postCondition );
 
 &lt;br/&gt;
+The callbacks for a conditions can be any value considered by PHP as [callable](http://www.php.net/manual/en/language.types.callable.php).
+
 Once the routine has been defined it can be registered on the object.
 
     $this-&gt;__routine( $routine );
 
-Finally, the **Contract** class .
+&lt;br/&gt;
+Finally, the **Contract** class provides an **__invariant()** magic method. This method is called internally after every routine execution. The purpose of this method is to ensure the object is in a coherent state, and has not been corrupted. This method should return a boolean value. In the case when *false* is returned, the object will be returned to it's last state before the execution of the routine, and an **InvariantException** will be thrown.
+
+All exceptions related to the PHP Design by Contract package extend the **ContractException** class.
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 20:26:57 -0000</pubDate><guid>https://sourceforge.netc028ad794cb0be6e63f4725bc10bcd012c36d5af</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -19,38 +19,92 @@
 Configuration
 -------------
 
-This package does not require any preconfiguration.
-
-Implementation:
----------------
-
+This package does not require any pre-configuration.
+
+Implementation
+--------------
+
 To use the base **Contract** class simply extend it with a new or existing class, for example:
 
     class Person extends Contract {
         
         // class members are defined here
     }
 
 &lt;br/&gt;
 When extending the **Contract** class certain magic methods become available. The first of these methods is **__create()**. This method behaves as a constructor function for the instance object.
 
     public function __create()
     {
         // object is defined here
     }
 
 &lt;br/&gt;
 To define the **Attributes** (properties) and **Routines** (functions) available for this object there are 2 additional magic method, **__attribute()** and **__routine()**.
 
-The **Attribute** class defines a property for the object, using the **setName()** for the name of the property, **setType()** for the data type stored in the property, and **setValue()** for the default value of the property, for example:
-
-    $example = new Attribute();
-    $example-&gt;setName( 'example' );
-    $example-&gt;setType( DataTypes::TYPE_STRING );
-    $example-&gt;setValue( 'Hello World' );
+The **Attribute** class defines a property for the object, using **setName()** for the name of the property, **setType()** for the data type stored in the property, and **setValue()** for the default value of the property, for example:
+
+    $attribute = new Attribute();
+    $attribute-&gt;setName( 'example' );
+    $attribute-&gt;setType( DataTypes::TYPE_STRING );
+    $attribute-&gt;setValue( 'Hello World' );
     
 &lt;br/&gt;
+Once the attribute has been defined it can be registered on the object.
+
+    $this-&gt;__attribute( $attribute );
+
+&lt;br/&gt;
 The **DataTypes** class defines the data types available as the following constants:
 
-- **TYPE_NULL:** A Null value
-- ****
+- **TYPE_NULL:** A discriminated null value
+- **TYPE_BOOLEAN:** A boolean logical value
+- **TYPE_NUMERIC:** A valid numeric value
+- **TYPE_INTEGER:** A whole number
+- **TYPE_DOUBLE:** A double precision floating point number
+- **TYPE_STRING:** A string of characters
+- **TYPE_ARRAY:** An array of values *(keys permitted)*
+- **TYPE_OBJECT:** An object
+- **TYPE_LAMBDA:** An instance of **Closure**
+- **TYPE_RESOURCE:** An external PHP resource
+
+A routine can be either a *procedure*, or a *function*. The difference between these types is that a procedure is used to modify the state of an object, but does not return a value, whilst a function is used to access the object and return a value, but not modify it's state. This concept is called *command/query spearation*.
+
+The **Routine** class defines a method for the object, using **setName()** for the name of the method, **setType()** for the type of the routine, **setArguments()** for the validation of the data types of the arguments expected and recieved by the method, and **setHandler()** for the callback to execute when called, for example:
+
+    $routine = new Routine();
+    $routine-&gt;setName( 'test' );
+    $routine-&gt;setType( Routine::TYPE_PROCEDURE );
+    $routine-&gt;setArguments( array(
+        DataTypes::TYPE_NULL,
+        DataTypes::TYPE_BOOLEAN,
+        DataTypes::TYPE_NUMERIC,
+        DataTypes::TYPE_INTEGER,
+        DataTypes::TYPE_DOUBLE,
+        DataTypes::TYPE_STRING,
+        DataTypes::TYPE_ARRAY,
+        DataTypes::TYPE_OBJECT,
+        DataTypes::TYPE_LAMBDA,
+        DataTypes::TYPE_RESOURCE,
+        'Test\MyContract'
+    ) );
+    $routine-&gt;setHandler( array( $this, 'test_callback' ) );
+
+&lt;br/&gt;
+A routine can also optionally define a **PreCondition** and a **PostCondition**. These are executed before and after the routine's callback.
+
+    $preCondition = new PreCondition( array( $this, 'validate' ) );
+
+    $postCondition = new PostCondition( function( $object, $arguments ) {
+        return true;
+    } );
+
+    $routine-&gt;setPreCondition( $preCondition );
+    $routine-&gt;setPostCondition( $postCondition );
+
+&lt;br/&gt;
+Once the routine has been defined it can be registered on the object.
+
+    $this-&gt;__routine( $routine );
+
+Finally, the **Contract** class .
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 19:59:12 -0000</pubDate><guid>https://sourceforge.net9d0db0adae97a37cea804203eaa53a6c15aff3a7</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,8 +1,56 @@
-Welcome to your wiki!
-
-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
-
-The wiki uses [Markdown](/p/php-contract/wiki/markdown_syntax/) syntax.
-
-[[project_admins]]
-[[download_button]]
+PHP Design by Contract
+======================
+
+**PHP Design by Contract** provides a basic implementation of contract programming for PHP 5.3+ with namespaces.
+
+The base **Contract** class allows new or existing classes to define properties as protected **Attributes** and methods as **Routines**, which require argument type/class validation, aswell as **PreCondition** and **PostCondition** checks. Instances can also check for state consistency with an invariant check.
+
+Using the Contract helps maintain object access coherent by applying a command/query separation when accessing or modifying the instance.
+
+Installation
+------------
+
+To use the package it's highly recommended to use a [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compatible autoloader for required classes.
+
+You can find a fully compatible autoloader here: [PHP AutoLoad](https://sourceforge.net/p/php-autoload)
+
+Once you've unpacked the files into your include path the package is ready for use.
+
+Configuration
+-------------
+
+This package does not require any preconfiguration.
+
+Implementation:
+---------------
+
+To use the base **Contract** class simply extend it with a new or existing class, for example:
+
+    class Person extends Contract {
+        
+        // class members are defined here
+    }
+
+&lt;br/&gt;
+When extending the **Contract** class certain magic methods become available. The first of these methods is **__create()**. This method behaves as a constructor function for the instance object.
+
+    public function __create()
+    {
+        // object is defined here
+    }
+
+&lt;br/&gt;
+To define the **Attributes** (properties) and **Routines** (functions) available for this object there are 2 additional magic method, **__attribute()** and **__routine()**.
+
+The **Attribute** class defines a property for the object, using the **setName()** for the name of the property, **setType()** for the data type stored in the property, and **setValue()** for the default value of the property, for example:
+
+    $example = new Attribute();
+    $example-&gt;setName( 'example' );
+    $example-&gt;setType( DataTypes::TYPE_STRING );
+    $example-&gt;setValue( 'Hello World' );
+    
+&lt;br/&gt;
+The **DataTypes** class defines the data types available as the following constants:
+
+- **TYPE_NULL:** A Null value
+- ****
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Wed, 04 Apr 2012 17:28:26 -0000</pubDate><guid>https://sourceforge.net8f46cc08844d179ba963c2a886df7b17131f607d</guid></item><item><title>WikiPage Home modified by James Watts</title><link>https://sourceforge.net/p/php-contract/wiki/Home/</link><description>Welcome to your wiki!

This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].

The wiki uses [Markdown](/p/php-contract/wiki/markdown_syntax/) syntax.

[[project_admins]]
[[download_button]]
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Watts</dc:creator><pubDate>Sat, 24 Mar 2012 14:02:56 -0000</pubDate><guid>https://sourceforge.net99a2c2c4d385d324a89aaf294c7e9ebca70261f7</guid></item></channel></rss>