original_string: protected function parseInstructions($content, $instruction)
      {
          $twig    = new Twig_Environment(new Twig_Loader_String());
          $sources = $this->getStringsBetween($content, "[[{$instruction}]]", "[[/{$instruction}]]");
          foreach ($sources as $source) {
              $toReplace = $source;
              $source    = $this->clearCondition($source);
              if ($source === '') {
                  return $content;
              }
              $variables    = $this->extractVariables($source);
              $renderParams = [];
  
              foreach (array_keys($variables) as $index => $key) {
                  $localVariable                = 'var_' . $index;
                  $source                       = str_replace($key, $localVariable, $source);
                  $renderParams[$localVariable] = $variables[$key];
              }
              $content = str_replace(["[[{$instruction}]]", "[[/{$instruction}]]", $toReplace], ['', '', $twig->render($source, $renderParams)], $content);
          }
          return $content;
      }
code: protected function parseInstructions($content, $instruction)
      {
          $twig    = new Twig_Environment(new Twig_Loader_String());
          $sources = $this->getStringsBetween($content, "[[{$instruction}]]", "[[/{$instruction}]]");
          foreach ($sources as $source) {
              $toReplace = $source;
              $source    = $this->clearCondition($source);
              if ($source === '') {
                  return $content;
              }
              $variables    = $this->extractVariables($source);
              $renderParams = [];
  
              foreach (array_keys($variables) as $index => $key) {
                  $localVariable                = 'var_' . $index;
                  $source                       = str_replace($key, $localVariable, $source);
                  $renderParams[$localVariable] = $variables[$key];
              }
              $content = str_replace(["[[{$instruction}]]", "[[/{$instruction}]]", $toReplace], ['', '', $twig->render($source, $renderParams)], $content);
          }
          return $content;
      }
code_tokens: protected function parseInstructions ( $ content , $ instruction ) { $ twig = new Twig_Environment ( new Twig_Loader_String ( ) ) ; $ sources = $ this -> getStringsBetween ( $ content , "[[{$instruction}]]" , "[[/{$instruction}]]" ) ; foreach ( $ sources as $ source ) { $ toReplace = $ source ; $ source = $ this -> clearCondition ( $ source ) ; if ( $ source === '' ) { return $ content ; } $ variables = $ this -> extractVariables ( $ source ) ; $ renderParams = [ ] ; foreach ( array_keys ( $ variables ) as $ index => $ key ) { $ localVariable = 'var_' . $ index ; $ source = str_replace ( $ key , $ localVariable , $ source ) ; $ renderParams [ $ localVariable ] = $ variables [ $ key ] ; } $ content = str_replace ( [ "[[{$instruction}]]" , "[[/{$instruction}]]" , $ toReplace ] , [ '' , '' , $ twig -> render ( $ source , $ renderParams ) ] , $ content ) ; } return $ content ; }
docstring: parsing instructions in notification content
  
  @param String $content
  @param String $instruction
  @return String
docstring_tokens: parsing instructions in notification content