Automattic\WooCommerce\Internal\Admin\Logging\FileV2
FileController::convert_paths_to_objects
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() 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 );
}