Automattic\WooCommerce\Internal\Admin\Logging\FileV2

FileController::convert_paths_to_objectsprivateWC 1.0

Helper method to get an array of File instances.

Method of the class: FileController{}

No Hooks.

Returns

File[].

Usage

// private - for code of main (parent) class only
$result = $this->convert_paths_to_objects( $paths ): array;
$paths(array) (required)
An array of absolute file paths.

FileController::convert_paths_to_objects() code WC 10.8.1

private function convert_paths_to_objects( array $paths ): array {
	$files = array_map(
		function( $path ) {
			$file = new File( $path );
			return $file->is_readable() ? $file : null;
		},
		$paths
	);

	return array_filter( $files );
}