public function buildStrategy($strategy, $concrete = null)
{
// If we passed a concrete implementation
// build it, otherwise get the bound one
$handle = strtolower($strategy);
if ($concrete) {
$path = 'Rocketeer\\Strategies\\' . ucfirst($strategy) . '\\%sStrategy';
$class = sprintf($path, $concrete);
$concrete = $this->findQualifiedName($concrete, [$path]);
if (!$concrete) {
throw new RuntimeException(sprintf('Class "%s" for strategy "%s" not found', $class, $strategy));
}
return new $concrete($this->app);
}
if (!isset($this->app['rocketeer.strategies.' . $handle])) {
return false;
}
return $this->app['rocketeer.strategies.' . $handle];
}