26    public function handle(array 
$keys = [], $directory = 
'', $recursive = 
false)
 
   28        $contents = $this->filesystem->listContents($directory, $recursive);
 
   30        foreach ($contents as 
$index => $object) {
 
   31            if ($object[
'type'] === 
'file') {
 
   32                $missingKeys = array_diff(
$keys, array_keys($object));
 
   33                $contents[
$index] = array_reduce($missingKeys, [$this, 
'getMetadataByName'], $object);
 
   50        $method = 
'get' . ucfirst(
$key);
 
   52        if ( ! method_exists($this->filesystem, $method)) {
 
   53            throw new \InvalidArgumentException(
'Could not get meta-data for key: ' . 
$key);
 
   56        $object[
$key] = $this->filesystem->{$method}($object[
'path']);
 
An exception for terminatinating execution or to throw for unit testing.
handle(array $keys=[], $directory='', $recursive=false)
List contents with metadata.
getMethod()
Get the method name.
getMetadataByName(array $object, $key)
Get a meta-data value by key name.