mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 16:25:39 +08:00
Do some code quality check and fix #126
This commit is contained in:
@@ -4,20 +4,31 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\store\source;
|
||||
|
||||
use SPC\exception\DownloaderException;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\Downloader;
|
||||
|
||||
class PostgreSQLSource extends CustomSourceBase
|
||||
{
|
||||
public const NAME = 'postgresql';
|
||||
|
||||
public function fetch()
|
||||
/**
|
||||
* @throws DownloaderException
|
||||
* @throws RuntimeException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public function fetch(): void
|
||||
{
|
||||
Downloader::downloadSource('postgresql', self::getLatestInfo());
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws DownloaderException
|
||||
*/
|
||||
public function getLatestInfo(): array
|
||||
{
|
||||
[$url, $filename, $version] = Downloader::getFromFileList('postgresql', [
|
||||
[, $filename, $version] = Downloader::getFromFileList('postgresql', [
|
||||
'url' => 'https://www.postgresql.org/ftp/source/',
|
||||
'regex' => '/href="(?<file>v(?<version>[^"]+)\/)"/',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user