<commit_before><?php

namespace Keosu\Gadget\PushNotificationBundle\EventListener;

use Keosu\CoreBundle\KeosuEvents;
use Keosu\CoreBundle\Event\PackageSideMenuEvent;

use Keosu\Gadget\PushNotificationBundle\KeosuGadgetPushNotificationBundle;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Listener responsible to gadget action
 */
class MenuListener implements EventSubscriberInterface
{

	private $container;

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

	/**
	 * {@inheritDoc}
	 */
	public static function getSubscribedEvents()
	{
		return array(
			KeosuEvents::PACKAGE_GLOBAL_MENU_CONFIG.KeosuGadgetPushNotificationBundle::PACKAGE_NAME => 'onMenuConfigRender',
		);
	}

	public function onMenuConfigRender(PackageSideMenuEvent $event)
	{
		$appId = $this->container->get('keosu_core.curapp')->getCurApp();
		$em = $this->container->get('doctrine')->getManager();
		$app = $em->getRepository('KeosuCoreBundle:App')->find($appId);
		
		if(isset($app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['enablePush'])
			&& $app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['enablePush'] === true) {
			$url = $this->container->get('router')->getGenerator()->generate('keosu_gadget_push_notification_homepage');
			$event->addUrl('Send push',$url);
		}
	}
}
<commit_msg>Fix PushNotification error (Special MaskedIntern)<commit_after><?php

namespace Keosu\Gadget\PushNotificationBundle\EventListener;

use Keosu\CoreBundle\KeosuEvents;
use Keosu\CoreBundle\Event\PackageSideMenuEvent;

use Keosu\Gadget\PushNotificationBundle\KeosuGadgetPushNotificationBundle;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Listener responsible to gadget action
 */
class MenuListener implements EventSubscriberInterface
{

	private $container;

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

	/**
	 * {@inheritDoc}
	 */
	public static function getSubscribedEvents()
	{
		return array(
			KeosuEvents::PACKAGE_GLOBAL_MENU_CONFIG.KeosuGadgetPushNotificationBundle::PACKAGE_NAME => 'onMenuConfigRender',
		);
	}

	public function onMenuConfigRender(PackageSideMenuEvent $event)
	{
		$appId = $this->container->get('keosu_core.curapp')->getCurApp();
		if($appId!=null){
			$em = $this->container->get('doctrine')->getManager();
			$app = $em->getRepository('KeosuCoreBundle:App')->find($appId);

			if(isset($app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['enablePush'])
				&& $app->getConfigPackages()[KeosuGadgetPushNotificationBundle::PACKAGE_NAME]['enablePush'] === true) {
				$url = $this->container->get('router')->getGenerator()->generate('keosu_gadget_push_notification_homepage');
				$event->addUrl('Send push',$url);
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.14083008158921603, 'fraction_numerical': 0.0, 'mean_word_length': 6.877094972067039, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '6721725', 'n_tokens_mistral': 940, 'n_tokens_neox': 894, 'n_words': 111}