public static function cascade(array $folders)
    {
        $result = null;
        foreach ($folders as $folder) {
            if (is_dir($folder)) {
                $result = $folder;

                break;
            }
        }

        return $result;
    }