Fixed style

This commit is contained in:
Dominik Liebler
2016-04-07 08:59:31 +02:00
parent d9d3f12132
commit 3fcf860cf3
3 changed files with 7 additions and 3 deletions

View File

@@ -16,7 +16,6 @@ class CharacterFlyweight implements FlyweightInterface
private $name;
/**
* Constructor.
* @param string $name
*/
public function __construct($name)
@@ -27,6 +26,7 @@ class CharacterFlyweight implements FlyweightInterface
/**
* Clients supply the context-dependent information that the flyweight needs to draw itself
* For flyweights representing characters, extrinsic state usually contains e.g. the font
*
* @param string $font
*/
public function draw($font)

View File

@@ -12,7 +12,7 @@ class FlyweightFactory
{
/**
* Associative store for flyweight objects
*
*
* @var Array
*/
private $pool = array();
@@ -28,6 +28,7 @@ class FlyweightFactory
if (!array_key_exists($name, $this->pool)) {
$this->pool[$name] = new CharacterFlyweight($name);
}
return $this->pool[$name];
}
@@ -36,6 +37,6 @@ class FlyweightFactory
*/
public function totalNumber()
{
return sizeof($this->pool);
return count($this->pool);
}
}

View File

@@ -7,5 +7,8 @@ namespace DesignPatterns\Structural\Flyweight;
*/
interface FlyweightInterface
{
/**
* @param string $extrinsicState
*/
public function draw($extrinsicState);
}