/** * {@inheritdoc} */ public static function fromString($string, Translations $translations, array $options = []) { $options += static::$options; $functions = new PhpFunctionsScanner($string); if ($options['extractComments'] !== false) { $functions->enableCommentsExtraction($options['extractComments']); } $functions->saveGettextFunctions($translations, $options); }
/** * {@inheritdoc} */ public static function fromString($string, Translations $translations = null, $file = '') { if ($translations === null) { $translations = new Translations(); } $functions = new PhpFunctionsScanner($string); if (self::$extractComments !== false) { $functions->enableCommentsExtraction(self::$extractComments); } $functions->saveGettextFunctions(self::$functions, $translations, $file); return $translations; }