예제 #1
0
 /**
  * @param $content
  * @param $extensionName
  * @return array
  */
 public function findInContent($content, $extensionName)
 {
     try {
         $tokens = $this->tokenizer->getTokens($content);
     } catch (InvalidContentException $e) {
         $tokens = [];
     } catch (InvalidSyntaxException $e) {
         $tokens = [];
     }
     return $this->callFactory->createByTokens($extensionName, $tokens);
 }
 public function testCreate()
 {
     print_r($this->factory->createByTokens('twig_extension_teste', $this->createTokens()));
 }