private function getFileMap(PackageInterface $package, $directory)
    {
        $files = [];
        $root  = $this->getInstallPath($package);

        if (!file_exists($root . '/' . $directory)) {
            return [];
        }

        $iterator = new RecursiveDirectoryIterator($root . '/' . $directory, RecursiveDirectoryIterator::SKIP_DOTS);

        /** @var SplFileInfo $file */
        foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
            if ($file->isFile()) {
                $path = str_replace($root . '/' . $directory . '/', '', $file->getPathname());

                $files[$directory . '/' . $path] = $path;
            }
        }

        return $files;
    }
private function getFileMap(PackageInterface $package, $directory)
    {
        $files = [];
        $root  = $this->getInstallPath($package);

        if (!file_exists($root . '/' . $directory)) {
            return [];
        }

        $iterator = new RecursiveDirectoryIterator($root . '/' . $directory, RecursiveDirectoryIterator::SKIP_DOTS);

        /** @var SplFileInfo $file */
        foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
            if ($file->isFile()) {
                $path = str_replace($root . '/' . $directory . '/', '', $file->getPathname());

                $files[$directory . '/' . $path] = $path;
            }
        }

        return $files;
    }
private function getFileMap ( PackageInterface $ package , $ directory ) { $ files = [ ] ; $ root = $ this -> getInstallPath ( $ package ) ; if ( ! file_exists ( $ root . '/' . $ directory ) ) { return [ ] ; } $ iterator = new RecursiveDirectoryIterator ( $ root . '/' . $ directory , RecursiveDirectoryIterator :: SKIP_DOTS ) ; /** @var SplFileInfo $file */ foreach ( new RecursiveIteratorIterator ( $ iterator , RecursiveIteratorIterator :: CHILD_FIRST ) as $ file ) { if ( $ file -> isFile ( ) ) { $ path = str_replace ( $ root . '/' . $ directory . '/' , '' , $ file -> getPathname ( ) ) ; $ files [ $ directory . '/' . $ path ] = $ path ; } } return $ files ; }
Generate a file map from the passed directory.

@param PackageInterface $package   The package being processed.

@param string           $directory The name of the directory to extract.

@return array
Generate a file map from the passed directory .