src/IterableCodeExtractor.php
public static function fromDirectory( $dir, Translations $translations, array $options = [] ) {
		$dir = Utils\normalize_path( $dir );

		static::$dir = $dir;

		$include = isset( $options['include'] ) ? $options['include'] : [];
		$exclude = isset( $options['exclude'] ) ? $options['exclude'] : [];

		$files = static::getFilesFromDirectory( $dir, $include, $exclude, $options['extensions'] );

		if ( ! empty( $files ) ) {
			static::fromFile( $files, $translations, $options );
		}

		static::$dir = '';
	}
public static function fromDirectory( $dir, Translations $translations, array $options = [] ) {
		$dir = Utils\normalize_path( $dir );

		static::$dir = $dir;

		$include = isset( $options['include'] ) ? $options['include'] : [];
		$exclude = isset( $options['exclude'] ) ? $options['exclude'] : [];

		$files = static::getFilesFromDirectory( $dir, $include, $exclude, $options['extensions'] );

		if ( ! empty( $files ) ) {
			static::fromFile( $files, $translations, $options );
		}

		static::$dir = '';
	}
Extract the translations from a file.

@param string $dir                Root path to start the recursive traversal in.
@param Translations $translations The translations instance to append the new translations.
@param array        $options      {
Optional. An array of options passed down to static::fromString()

@type bool $wpExtractTemplates Extract 'Template Name' headers in theme files. Default 'false'.
@type array $exclude           A list of path to exclude. Default [].
@type array $extensions        A list of extensions to process. Default [].
}
@return null