Пример #1
0
 /** @test */
 public function itWalksKeysRecursively()
 {
     $arr = array('one.' => 1, 'more.' => array('two.' => 2));
     $expected = array('one' => 1, 'more' => array('two' => 2));
     $func = function ($key) {
         return rtrim($key, '.');
     };
     Arr::walkKeysRecursive($arr, $func);
     $this->assertEquals($expected, $arr);
 }
Пример #2
0
 /**
  * @param $ext
  * @return array
  */
 protected function getTyposcriptForExtension($ext)
 {
     $allTyposcript = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
     if (!isset($allTyposcript['plugin.']["tx_{$ext}."])) {
         return FALSE;
     }
     $keyTrimmer = function ($key) {
         return rtrim($key, '.');
     };
     $extConf = $allTyposcript['plugin.']["tx_{$ext}."];
     Arr::walkKeysRecursive($extConf, $keyTrimmer);
     return $extConf;
 }