use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Templating\EngineInterface;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpKernel\UriSigner;
+use Symfony\Component\Templating\EngineInterface;
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Loader\ExistsLoaderInterface;
}
// we need to sign the absolute URI, but want to return the path only.
- $uri = substr($this->signer->sign($this->generateFragmentUri($uri, $request, true)), strlen($request->getSchemeAndHttpHost()));
+ $uri = substr($this->signer->sign($this->generateFragmentUri($uri, $request, true)), \strlen($request->getSchemeAndHttpHost()));
}
// We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content.
$content = $template;
}
- $attributes = isset($options['attributes']) && is_array($options['attributes']) ? $options['attributes'] : array();
+ $attributes = isset($options['attributes']) && \is_array($options['attributes']) ? $options['attributes'] : array();
if (isset($options['id']) && $options['id']) {
$attributes['id'] = $options['id'];
}
$renderedAttributes = '';
- if (count($attributes) > 0) {
+ if (\count($attributes) > 0) {
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
foreach ($attributes as $attribute => $value) {
$renderedAttributes .= sprintf(
if ($this->templating instanceof EngineInterface) {
try {
return $this->templating->exists($template);
- } catch (\InvalidArgumentException $e) {
+ } catch (\Exception $e) {
return false;
}
}