¨4.0.1¨
This commit is contained in:
@@ -6,21 +6,25 @@ abstract class Manager
|
||||
{
|
||||
private $drivers = [];
|
||||
|
||||
|
||||
public function all()
|
||||
{
|
||||
return collect($this->drivers);
|
||||
}
|
||||
|
||||
|
||||
public function names()
|
||||
{
|
||||
return array_keys($this->drivers);
|
||||
}
|
||||
|
||||
|
||||
public function get($name)
|
||||
{
|
||||
return array_get($this->drivers, $name);
|
||||
}
|
||||
|
||||
|
||||
public function register($name, $driver)
|
||||
{
|
||||
$this->drivers[$name] = is_callable($driver) ? call_user_func($driver) : $driver;
|
||||
@@ -28,18 +32,21 @@ abstract class Manager
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function count()
|
||||
{
|
||||
return count($this->drivers);
|
||||
}
|
||||
|
||||
|
||||
public function isNotEmpty()
|
||||
{
|
||||
return !$this->isEmpty();
|
||||
}
|
||||
|
||||
|
||||
public function isEmpty()
|
||||
{
|
||||
return empty($this->drivers);
|
||||
}
|
||||
|
||||
public function isNotEmpty()
|
||||
{
|
||||
return ! $this->isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user