<commit_before><?php

namespace Kunstmaan\AdminBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

/**
 * Main settings controller
 */
class SettingsController extends BaseSettingsController
{
    /**
     * Index page for the settings
     *
     * @Route("/", name="KunstmaanAdminBundle_settings")
     * @Template()
     *
     * @throws AccessDeniedException
     * @return array
     */
    public function indexAction()
    {
        $this->checkPermission('ROLE_ADMIN');

        return array();
    }

    /**
     * Show bundles version update information
     *
     * @Route("/bundle-version", name="KunstmaanAdminBundle_settings_bundle_version")
     * @Template("KunstmaanAdminBundle:Settings:bundleVersion.html.twig")
     *
     * @throws AccessDeniedException
     * @return array
     */
    public function bundleVersionAction()
    {
        $this->checkPermission();

        $versionChecker = $this->container->get('kunstmaan_admin.versionchecker');
        if (!$versionChecker->isEnabled()) {
            return;
        }

        return array(
            'data' => $versionChecker->check()
        );
    }
<commit_msg>Do not crash if version checker throws exception<commit_after><?php

namespace Kunstmaan\AdminBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

/**
 * Main settings controller
 */
class SettingsController extends BaseSettingsController
{
    /**
     * Index page for the settings
     *
     * @Route("/", name="KunstmaanAdminBundle_settings")
     * @Template()
     *
     * @throws AccessDeniedException
     * @return array
     */
    public function indexAction()
    {
        $this->checkPermission('ROLE_ADMIN');

        return array();
    }

    /**
     * Show bundles version update information
     *
     * @Route("/bundle-version", name="KunstmaanAdminBundle_settings_bundle_version")
     * @Template("KunstmaanAdminBundle:Settings:bundleVersion.html.twig")
     *
     * @throws AccessDeniedException
     * @return array
     */
    public function bundleVersionAction()
    {
        $this->checkPermission();

        $versionChecker = $this->container->get('kunstmaan_admin.versionchecker');
        if (!$versionChecker->isEnabled()) {
            return array('data' => null);
        }

        $data = null;
        try {
            $data = $versionChecker->check();
        } catch (\Exception $e) {
            $this->container->get('logger')->error(
                $e->getMessage(),
                array('exception' => $e)
            );
        }

        return array(
            'data' => $data
        );
    }
{'fraction_non_alphanumeric': 0.12131596984235778, 'fraction_numerical': 0.0, 'mean_word_length': 2.64875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '7587762', 'n_tokens_mistral': 793, 'n_tokens_neox': 800, 'n_words': 139}