Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
bumped deps, removed doctrine/common
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 8, 2019
1 parent d25f0de commit 85dcbb1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
12 changes: 10 additions & 2 deletions EventListener/ControllerListener.php
Expand Up @@ -16,7 +16,6 @@
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface;
use Doctrine\Common\Util\ClassUtils;

/**
* The ControllerListener class parses annotation blocks located in
Expand Down Expand Up @@ -53,7 +52,7 @@ public function onKernelController(FilterControllerEvent $event)
return;
}

$className = class_exists('Doctrine\Common\Util\ClassUtils') ? ClassUtils::getClass($controller[0]) : \get_class($controller[0]);
$className = $this->getRealClass($controller[0]);
$object = new \ReflectionClass($className);
$method = $object->getMethod($controller[1]);

Expand Down Expand Up @@ -112,4 +111,13 @@ public static function getSubscribedEvents()
KernelEvents::CONTROLLER => 'onKernelController',
];
}

private static function getRealClass(string $class): string
{
if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) {
return $class;
}

return substr($class, $pos + Proxy::MARKER_LENGTH + 2);
}
}
12 changes: 10 additions & 2 deletions Templating/TemplateGuesser.php
Expand Up @@ -14,7 +14,6 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Doctrine\Common\Util\ClassUtils;

/**
* The TemplateGuesser class handles the guessing of template name based on controller.
Expand Down Expand Up @@ -62,7 +61,7 @@ public function guessTemplateName($controller, Request $request)
throw new \InvalidArgumentException(sprintf('First argument of %s must be an array callable or an object defining the magic method __invoke. "%s" given.', __METHOD__, \gettype($controller)));
}

$className = class_exists('Doctrine\Common\Util\ClassUtils') ? ClassUtils::getClass($controller[0]) : \get_class($controller[0]);
$className = $this->getRealClass($controller[0]);

$matchController = null;
foreach ($this->controllerPatterns as $pattern) {
Expand Down Expand Up @@ -113,4 +112,13 @@ private function getBundleForClass($class)
$reflectionClass = $reflectionClass->getParentClass();
} while ($reflectionClass);
}

private static function getRealClass(string $class): string
{
if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) {
return $class;
}

return substr($class, $pos + Proxy::MARKER_LENGTH + 2);
}
}
27 changes: 14 additions & 13 deletions composer.json
Expand Up @@ -11,24 +11,25 @@
}
],
"require": {
"php": ">=7.1.3",
"symfony/config": "^3.3|^4.0",
"symfony/framework-bundle": "^3.4|^4.0",
"symfony/dependency-injection": "^3.3|^4.0",
"symfony/http-kernel": "^3.3|^4.0",
"doctrine/common": "^2.2"
"php": ">=7.2.0",
"symfony/config": "^3.4|^4.2",
"symfony/framework-bundle": "^3.4|^4.2",
"symfony/dependency-injection": "^3.4|^4.2",
"symfony/http-kernel": "^3.4|^4.2",
"doctrine/annotations": "^1.0",
"doctrine/persistence": "^1.0"
},
"require-dev": {
"symfony/expression-language": "^3.3|^4.0",
"symfony/finder": "^3.3|^4.0",
"symfony/expression-language": "^3.4|^4.2",
"symfony/finder": "^3.4|^4.2",
"symfony/psr-http-message-bridge": "^1.1",
"symfony/security-bundle": "^3.3|^4.0",
"symfony/yaml": "^3.3|^4.0",
"symfony/twig-bundle": "^3.3|^4.0",
"symfony/security-bundle": "^3.4|^4.2",
"symfony/yaml": "^3.4|^4.2",
"symfony/twig-bundle": "^3.4|^4.2",
"twig/twig": "~1.12|~2.0",
"symfony/browser-kit": "^3.3|^4.0",
"symfony/browser-kit": "^3.4|^4.2",
"symfony/phpunit-bridge": "^3.4.19|^4.1.8",
"symfony/dom-crawler": "^3.3|^4.0",
"symfony/dom-crawler": "^3.4|^4.2",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"symfony/monolog-bundle": "^3.2",
Expand Down

0 comments on commit 85dcbb1

Please sign in to comment.