private function getFiles($directory)
    {
        $fileList = [];
        $files = scandir($directory);
        $this->log(sprintf("Scanning dir %s, found %d files", $directory, count($files)));
        foreach ($files as $index => $file) {
            // recursive retrieve files in subdirectories
            if (true === is_dir($directory . DIRECTORY_SEPARATOR . $file) && !in_array($file, [".", ".."])) {
                $fileList = array_merge(
                    $fileList,
                    $this->getFiles($directory . DIRECTORY_SEPARATOR . $file)
                );
                continue;
            }

            // not the file we want
            if (false === $this->isRequiredFile($file)) {
                $this->log(sprintf("Files %s is not required", $directory . DIRECTORY_SEPARATOR . $file));
                continue;
            }
            $this->log(sprintf("Collected %s", $directory . DIRECTORY_SEPARATOR . $file));
            $fileList[] = $directory . DIRECTORY_SEPARATOR . $file;
        }
        return $fileList;
    }