added README.rst to FlyweightFactory

This commit is contained in:
Dominik Liebler
2016-04-07 08:53:37 +02:00
parent b8e602f66d
commit d9d3f12132
2 changed files with 56 additions and 0 deletions

View File

@@ -12,12 +12,14 @@ class FlyweightFactory
{
/**
* Associative store for flyweight objects
*
* @var Array
*/
private $pool = array();
/**
* Magic getter
*
* @param string $name
* @return Flyweight
*/
@@ -29,6 +31,9 @@ class FlyweightFactory
return $this->pool[$name];
}
/**
* @return int
*/
public function totalNumber()
{
return sizeof($this->pool);