fix deprecations

This commit is contained in:
Alexey Chelnakov 2022-09-26 18:01:45 +03:00
parent e0cbba35c6
commit becd5e2aeb

View File

@ -48,11 +48,6 @@ class ApiDocExtractor
*/ */
private $commentExtractor; private $commentExtractor;
/**
* @var ControllerNameParser
*/
protected $controllerNameParser;
/** /**
* @var ParserInterface[] * @var ParserInterface[]
*/ */
@ -68,13 +63,12 @@ class ApiDocExtractor
*/ */
protected $annotationsProviders; protected $annotationsProviders;
public function __construct(ContainerInterface $container, RouterInterface $router, Reader $reader, DocCommentExtractor $commentExtractor, ControllerNameParser $controllerNameParser, array $handlers, array $annotationsProviders) public function __construct(ContainerInterface $container, RouterInterface $router, Reader $reader, DocCommentExtractor $commentExtractor, array $handlers, array $annotationsProviders)
{ {
$this->container = $container; $this->container = $container;
$this->router = $router; $this->router = $router;
$this->reader = $reader; $this->reader = $reader;
$this->commentExtractor = $commentExtractor; $this->commentExtractor = $commentExtractor;
$this->controllerNameParser = $controllerNameParser;
$this->handlers = $handlers; $this->handlers = $handlers;
$this->annotationsProviders = $annotationsProviders; $this->annotationsProviders = $annotationsProviders;
} }
@ -227,9 +221,9 @@ class ApiDocExtractor
*/ */
public function getReflectionMethod($controller) public function getReflectionMethod($controller)
{ {
if (false === strpos($controller, '::') && 2 === substr_count($controller, ':')) { // if (false === strpos($controller, '::') && 2 === substr_count($controller, ':')) {
$controller = $this->controllerNameParser->parse($controller); // $controller = $this->controllerNameParser->parse($controller);
} // }
if (preg_match('#(.+)::([\w]+)#', $controller, $matches)) { if (preg_match('#(.+)::([\w]+)#', $controller, $matches)) {
$class = $matches[1]; $class = $matches[1];