public function testItCanBeCreatedFromTheKey()
 {
     assertSame('No entry found for "example-key".', EntryDoesNotExistException::fromKey('example-key')->getMessage());
 }
コード例 #2
0
 /**
  * @param array $path
  *
  * @throws EntryDoesNotExistException
  *
  * @return mixed
  */
 private function traverseConfig(array $path)
 {
     $pointer =& $this->config;
     foreach ($path as $node) {
         if (!is_array($pointer) || !array_key_exists($node, $pointer)) {
             throw EntryDoesNotExistException::fromKey(implode($this->separator, $path));
         }
         $pointer =& $pointer[$node];
     }
     return $pointer;
 }