mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-13 02:14:04 +02:00
Fixed style
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user