<commit_before><?php
/**
 * User: <NAME>
 * Date: 19/03/2017
 * Email: <EMAIL>.
 */
namespace Sil\RouteSecurityBundle\Twig;

use Sil\RouteSecurityBundle\Security\AccessControl;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

/**
 * Class RouteSecurityExtension.
 */
class RouteSecurityExtension extends AbstractExtension
{
    private $accessControl;

    public function __construct(AccessControl $accessControl)
    {
        $this->accessControl = $accessControl;
    }

    public function getFunctions()
    {
        return [
            new TwigFunction('hasUserAccessToRoute', [$this->accessControl, 'hasUserAccessToRoute']),
            new TwigFunction('hasUserAccessToRoutes', [$this->accessControl, 'hasUserAccessToRoutes']),
            new TwigFunction('hasUserAccessAtLeastOneRoute', [$this->accessControl, 'hasUserAccessAtLeastOneRoute']),
        ];
    }
}<commit_msg>Add native return type declaration (array) to Twig functions extension<commit_after><?php
/**
 * User: <NAME>
 * Date: 19/03/2017
 * Email: <EMAIL>.
 */
namespace Sil\RouteSecurityBundle\Twig;

use Sil\RouteSecurityBundle\Security\AccessControl;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

/**
 * Class RouteSecurityExtension.
 */
class RouteSecurityExtension extends AbstractExtension
{
    private $accessControl;

    public function __construct(AccessControl $accessControl)
    {
        $this->accessControl = $accessControl;
    }

    public function getFunctions(): array
    {
        return [
            new TwigFunction('hasUserAccessToRoute', [$this->accessControl, 'hasUserAccessToRoute']),
            new TwigFunction('hasUserAccessToRoutes', [$this->accessControl, 'hasUserAccessToRoutes']),
            new TwigFunction('hasUserAccessAtLeastOneRoute', [$this->accessControl, 'hasUserAccessAtLeastOneRoute']),
        ];
    }
}
{'fraction_non_alphanumeric': 0.11534334763948498, 'fraction_numerical': 0.008583690987124463, 'mean_word_length': 4.05420054200542, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4529980', 'n_tokens_mistral': 540, 'n_tokens_neox': 518, 'n_words': 100}