mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-26 22:39:11 +02:00
unifies indentation
This commit is contained in:
@@ -5,7 +5,7 @@ namespace DesignPatterns\Pool;
|
||||
class Pool
|
||||
{
|
||||
|
||||
private $instances = array();
|
||||
private $instances = array();
|
||||
private $class;
|
||||
|
||||
public function __construct($class)
|
||||
@@ -13,19 +13,18 @@ class Pool
|
||||
$this->class = $class;
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
if (count($this->instances) > 0) {
|
||||
return array_pop($this->instances);
|
||||
}
|
||||
public function get()
|
||||
{
|
||||
if (count($this->instances) > 0) {
|
||||
return array_pop($this->instances);
|
||||
}
|
||||
|
||||
return new $this->class();
|
||||
}
|
||||
return new $this->class();
|
||||
}
|
||||
|
||||
public function dispose($instance)
|
||||
{
|
||||
$this->instances[] = $instance;
|
||||
}
|
||||
public function dispose($instance)
|
||||
{
|
||||
$this->instances[] = $instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user