mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-04-02 21:36:14 +03:00
Allow Twig 3
This commit is contained in:
parent
99f5d37601
commit
dc1f11a46f
1 changed files with 6 additions and 1 deletions
|
@ -17,6 +17,7 @@ use Symfony\Component\DependencyInjection\ServiceLocator;
|
|||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Twig\Environment;
|
||||
|
||||
final class SwaggerUiController
|
||||
{
|
||||
|
@ -27,8 +28,12 @@ final class SwaggerUiController
|
|||
/**
|
||||
* @param ContainerInterface $generatorLocator
|
||||
*/
|
||||
public function __construct($generatorLocator, \Twig_Environment $twig)
|
||||
public function __construct($generatorLocator, $twig)
|
||||
{
|
||||
if (!$twig instanceof \Twig_Environment && !$twig instanceof Environment) {
|
||||
throw new \InvalidArgumentException(sprintf('Providing an instance of "%s" as twig is not supported.', get_class($twig)));
|
||||
}
|
||||
|
||||
if (!$generatorLocator instanceof ContainerInterface) {
|
||||
if (!$generatorLocator instanceof ApiDocGenerator) {
|
||||
throw new \InvalidArgumentException(sprintf('Providing an instance of "%s" to "%s" is not supported.', get_class($generatorLocator), __METHOD__));
|
||||
|
|
Loading…
Add table
Reference in a new issue