File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ class CharacterFlyweight implements FlyweightInterface
16
16
private $ name ;
17
17
18
18
/**
19
- * Constructor.
20
19
* @param string $name
21
20
*/
22
21
public function __construct ($ name )
@@ -27,6 +26,7 @@ public function __construct($name)
27
26
/**
28
27
* Clients supply the context-dependent information that the flyweight needs to draw itself
29
28
* For flyweights representing characters, extrinsic state usually contains e.g. the font
29
+ *
30
30
* @param string $font
31
31
*/
32
32
public function draw ($ font )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class FlyweightFactory
12
12
{
13
13
/**
14
14
* Associative store for flyweight objects
15
- *
15
+ *
16
16
* @var Array
17
17
*/
18
18
private $ pool = array ();
@@ -28,6 +28,7 @@ public function __get($name)
28
28
if (!array_key_exists ($ name , $ this ->pool )) {
29
29
$ this ->pool [$ name ] = new CharacterFlyweight ($ name );
30
30
}
31
+
31
32
return $ this ->pool [$ name ];
32
33
}
33
34
@@ -36,6 +37,6 @@ public function __get($name)
36
37
*/
37
38
public function totalNumber ()
38
39
{
39
- return sizeof ($ this ->pool );
40
+ return count ($ this ->pool );
40
41
}
41
42
}
Original file line number Diff line number Diff line change 7
7
*/
8
8
interface FlyweightInterface
9
9
{
10
+ /**
11
+ * @param string $extrinsicState
12
+ */
10
13
public function draw ($ extrinsicState );
11
14
}
You can’t perform that action at this time.
0 commit comments