Fixed style

This commit is contained in:
Christophe Vidal
2016-06-14 08:33:07 +07:00
parent 2888ac456a
commit c8e0c74f46
8 changed files with 12 additions and 20 deletions

View File

@@ -2,8 +2,6 @@
namespace DesignPatterns\Structural\Flyweight;
use DesignPatterns\Structural\Flyweight\CharacterFlyweight;
/**
* A factory manages shared flyweights. Clients shouldn't instaniate them directly,
* but let the factory take care of returning existing objects or creating new ones.
@@ -11,16 +9,17 @@ use DesignPatterns\Structural\Flyweight\CharacterFlyweight;
class FlyweightFactory
{
/**
* Associative store for flyweight objects
* Associative store for flyweight objects.
*
* @var Array
* @var array
*/
private $pool = array();
/**
* Magic getter
* Magic getter.
*
* @param string $name
*
* @return Flyweight
*/
public function __get($name)
@@ -28,7 +27,7 @@ class FlyweightFactory
if (!array_key_exists($name, $this->pool)) {
$this->pool[$name] = new CharacterFlyweight($name);
}
return $this->pool[$name];
}