You are here

protected static function Twig_Test_IntegrationTestCase::parseTemplates in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Test/IntegrationTestCase.php \Twig_Test_IntegrationTestCase::parseTemplates()
1 call to Twig_Test_IntegrationTestCase::parseTemplates()
Twig_Test_IntegrationTestCase::getTests in vendor/Twig/Test/IntegrationTestCase.php

File

vendor/Twig/Test/IntegrationTestCase.php, line 144

Class

Twig_Test_IntegrationTestCase
Integration test helper

Code

protected static function parseTemplates($test) {
  $templates = array();
  preg_match_all('/--TEMPLATE(?:\\((.*?)\\))?--(.*?)(?=\\-\\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER);
  foreach ($matches as $match) {
    $templates[$match[1] ? $match[1] : 'index.twig'] = $match[2];
  }
  return $templates;
}