Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -19,13 +19,7 @@ interface Checker
const MONTHLY = 'monthly';
const NEVER = 'never';
/**
* @return bool
*/
public function isLatest(): bool;
/**
* @return string
*/
public function getLatest(): string;
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -19,9 +19,6 @@ class GitHubChecker implements Checker
private $latest;
/**
* @return bool
*/
public function isLatest(): bool
{
// version_compare doesn't handle semver completely;
@@ -31,9 +28,6 @@ class GitHubChecker implements Checker
return \version_compare($version, $this->getLatest(), '>=');
}
/**
* @return string
*/
public function getLatest(): string
{
if (!isset($this->latest)) {
@@ -75,7 +69,7 @@ class GitHubChecker implements Checker
$context = \stream_context_create([
'http' => [
'user_agent' => 'PsySH/'.Shell::VERSION,
'timeout' => 3,
'timeout' => 1.0,
],
]);

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -43,6 +43,9 @@ class IntervalChecker extends GitHubChecker
return $release;
}
/**
* @throws \RuntimeException if interval passed to constructor is not supported
*/
private function getDateInterval(): \DateInterval
{
switch ($this->interval) {
@@ -53,6 +56,8 @@ class IntervalChecker extends GitHubChecker
case Checker::MONTHLY:
return new \DateInterval('P1M');
}
throw new \RuntimeException('Invalid interval configured');
}
private function updateCache($release)

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -14,21 +14,15 @@ namespace Psy\VersionUpdater;
use Psy\Shell;
/**
* A version checker stub which always thinks the current verion is up to date.
* A version checker stub which always thinks the current version is up to date.
*/
class NoopChecker implements Checker
{
/**
* @return bool
*/
public function isLatest(): bool
{
return true;
}
/**
* @return string
*/
public function getLatest(): string
{
return Shell::VERSION;