unifies indentation

This commit is contained in:
Jan Brecka
2014-04-08 11:29:03 +02:00
parent d779b1e86a
commit 6e937055cf
5 changed files with 15 additions and 20 deletions

View File

@@ -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;
}
}