Release HEAD - Update diff script

This commit is contained in:
Github Actions 2022-12-29 20:42:36 +00:00
parent d0373d23c4
commit f6cb3ae379
7 changed files with 18 additions and 35 deletions

View File

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
namespace danog\MadelineProto; namespace danog\MadelineProto;
@ -40,7 +40,7 @@ class Installer
*/ */
public function __construct() public function __construct()
{ {
if (PHP_MAJOR_VERSION < 8 || PHP_MINOR_VERSION < 1) { if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 1) || PHP_MAJOR_VERSION <= 7) {
die('MadelineProto requires at least PHP 8.1.'.PHP_EOL); die('MadelineProto requires at least PHP 8.1.'.PHP_EOL);
} }
if (PHP_INT_SIZE < 8) { if (PHP_INT_SIZE < 8) {
@ -83,11 +83,11 @@ class Installer
/** /**
* Extract composer package versions from phar. * Extract composer package versions from phar.
* *
* @param string|null $release
* @return array<string, string> * @return array<string, string>
*/ */
private static function extractVersions($release) private static function extractVersions(?string $release): array
{ {
$release ??= '';
$phar = "madeline-$release.phar"; $phar = "madeline-$release.phar";
$packages = ['danog/madelineproto' => 'old']; $packages = ['danog/madelineproto' => 'old'];
if (!\file_exists("phar://$phar/vendor/composer/installed.json")) { if (!\file_exists("phar://$phar/vendor/composer/installed.json")) {
@ -111,16 +111,10 @@ class Installer
return $packages; return $packages;
} }
/** /**
* Report installs to composer. * Report installs to composer.
*
* @param string $local_release
* @param string $remote_release
*
* @return void
*/ */
private static function reportComposer($local_release, $remote_release) private static function reportComposer(?string $local_release, ?string $remote_release): void
{ {
$previous = self::extractVersions($local_release); $previous = self::extractVersions($local_release);
$current = self::extractVersions($remote_release); $current = self::extractVersions($remote_release);
@ -135,11 +129,7 @@ class Installer
]; ];
} }
if (\defined('HHVM_VERSION')) { $phpVersion = 'PHP '.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;
$phpVersion = 'HHVM '.HHVM_VERSION;
} else {
$phpVersion = 'PHP '.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'.'.PHP_RELEASE_VERSION;
}
$opts = ['http' => $opts = ['http' =>
[ [
'method' => 'POST', 'method' => 'POST',
@ -164,13 +154,13 @@ class Installer
/** /**
* Load phar file. * Load phar file.
*
* @param string|null $release
* @return mixed
*/ */
private static function load($release) private static function load(?string $release): mixed
{ {
if ($release === null) { if ($release === null) {
if ((PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 1) || PHP_MAJOR_VERSION <= 7) {
throw new \Exception('MadelineProto requires at least PHP 8.1.');
}
throw new \Exception('Could not download MadelineProto, please check your internet connection and PHP configuration!'); throw new \Exception('Could not download MadelineProto, please check your internet connection and PHP configuration!');
} }
$phar = "madeline-$release.phar"; $phar = "madeline-$release.phar";
@ -188,21 +178,16 @@ class Installer
/** /**
* Unlock phar. * Unlock phar.
* *
* @return void
*/ */
public static function unlock() public static function unlock(): void
{ {
\flock(self::$lock, LOCK_UN); \flock(self::$lock, LOCK_UN);
} }
/** /**
* Lock installer. * Lock installer.
*
* @param string $version Version file to lock
*
* @return bool
*/ */
private function lock($version) private function lock(string $version): bool
{ {
if ($this->lockInstaller) { if ($this->lockInstaller) {
return true; return true;
@ -213,8 +198,6 @@ class Installer
/** /**
* Install MadelineProto. * Install MadelineProto.
*
* @return mixed
*/ */
public function install() public function install()
{ {

View File

@ -1 +1 @@
37fdcd57a3e8676f58e327f28acb39b4a127229b-71 32cf35e179916a63e1cafb45b899584712f00201-71

View File

@ -1 +1 @@
37fdcd57a3e8676f58e327f28acb39b4a127229b-72 32cf35e179916a63e1cafb45b899584712f00201-72

View File

@ -1 +1 @@
37fdcd57a3e8676f58e327f28acb39b4a127229b-73 32cf35e179916a63e1cafb45b899584712f00201-73

View File

@ -1 +1 @@
37fdcd57a3e8676f58e327f28acb39b4a127229b-74 32cf35e179916a63e1cafb45b899584712f00201-74

View File

@ -1 +1 @@
37fdcd57a3e8676f58e327f28acb39b4a127229b-80 32cf35e179916a63e1cafb45b899584712f00201-80

View File

@ -1 +1 @@
37fdcd57a3e8676f58e327f28acb39b4a127229b-81 32cf35e179916a63e1cafb45b899584712f00201-81