Automattic\WooCommerce\Internal\Admin\Logging\FileV2

FileController::convert_paths_to_objects()privateWC 1.0

Helper method to get an array of File instances.

Метод класса: FileController{}

Хуков нет.

Возвращает

File[].

Использование

// private - только в коде основоного (родительского) класса
$result = $this->convert_paths_to_objects( $paths ): array;
$paths(массив) (обязательный)
An array of absolute file paths.

Код FileController::convert_paths_to_objects() WC 9.7.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 );
}