diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-11 09:03:06 +0100 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-11 09:03:06 +0100 |
commit | faa9e89f6254898cd0ed4c375d32260323b7883e (patch) | |
tree | 81a2b218949d4a9d80f376f1b6d2e782c67c0aaa /Praspel.php | |
parent | 5c358ff2ec1fbaed26b598e404b48b15bf7247de (diff) | |
download | Praspel-faa9e89f6254898cd0ed4c375d32260323b7883e.zip Praspel-faa9e89f6254898cd0ed4c375d32260323b7883e.tar.gz Praspel-faa9e89f6254898cd0ed4c375d32260323b7883e.tar.bz2 |
Introduce the “contract (static) registry”.
The contract static registry aims at containing all Praspel contracts.
This is very helpful when a contract manipulates external (out of the
current contract) data.
Diffstat (limited to 'Praspel.php')
-rw-r--r-- | Praspel.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Praspel.php b/Praspel.php index bb6b33d..3aa64d8 100644 --- a/Praspel.php +++ b/Praspel.php @@ -75,6 +75,15 @@ namespace Hoa\Praspel { class Praspel { /** + * Registry of all contracts. + * + * @var \ArrayObject object + */ + protected static $_registry = null; + + + + /** * Short interpreter. * * @access public @@ -120,6 +129,20 @@ class Praspel { return trim(implode("\n", $maatches[1])); } + + /** + * Get registry of all contracts. + * + * @access public + * @return \ArrayObject + */ + public static function getRegistry ( ) { + + if(null === static::$_registry) + static::$_registry = new \ArrayObject(); + + return static::$_registry; + } } } |