/**
  * On kernel request.
  *
  * @param GetResponseEvent $event
  */
 public function onKernelRequest(GetResponseEvent $event)
 {
     $settings = $this->generalSettingsManager->getSettings();
     foreach ($settings as $id => $value) {
         $prefix = 'ongr_settings_profile_';
         if (strpos($id, $prefix) === 0 && $value === true) {
             $escapedProfile = mb_substr($id, strlen($prefix), null, 'UTF-8');
             $profile = UnderscoreEscaper::unescape($escapedProfile);
             $this->settingsContainer->addProfile($profile);
             $this->settingsContainer->addProvider($this->buildProvider($profile));
         }
     }
 }
Пример #2
0
 /**
  * Tests unsescape method.
  *
  * @param string $expectedOutput
  * @param string $input
  *
  * @dataProvider getUnescapeCases
  */
 public function testUnescape($expectedOutput, $input)
 {
     $output = UnderscoreEscaper::unescape($input);
     $this->assertSame($expectedOutput, $output);
 }