Skip to content
/ cli Public
generated from hydephp/hyde

Commit

Permalink
Merge pull request #164 from hydephp/release/v0.7.63
Browse files Browse the repository at this point in the history
HydeCLI v0.7.63
caendesilva authored Apr 23, 2024
2 parents ea81306 + 5d952d6 commit adaf259
Showing 9 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/Application.php
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

class Application extends \Hyde\Foundation\Application
{
final public const APP_VERSION = '0.7.62';
final public const APP_VERSION = '0.7.63';

public function getCachedPackagesPath(): string
{
4 changes: 2 additions & 2 deletions app/Commands/Internal/ReportsSelfUpdateCommandIssues.php
Original file line number Diff line number Diff line change
@@ -23,11 +23,11 @@ protected function createIssueTemplateLink(Throwable $exception): string
{
return $this->buildUrl('https://github.com/hydephp/cli/issues/new', [
'title' => 'Error while self-updating the application',
'body' => $this->stripPersonalInformation($this->getIssueMarkdown($exception))
'body' => $this->stripPersonalInformation($this->getIssueMarkdown($exception)),
]);
}

/** @param array<string, string> $params */
/** @param array<string, string> $params */
protected function buildUrl(string $url, array $params): string
{
return sprintf("$url?%s", implode('&', array_map(function (string $key, string $value): string {
18 changes: 11 additions & 7 deletions app/Commands/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
@@ -83,6 +83,7 @@ class SelfUpdateCommand extends Command

/**
* @var string The path to the application executable
*
* @example Generally /user/bin/hyde, /usr/local/bin/hyde, /home/<User>/.config/composer/vendor/bin/hyde, or C:\Users\<User>\AppData\Roaming\Composer\vendor\bin\hyde
*/
protected string $applicationPath;
@@ -157,6 +158,7 @@ public function handle(): int

if (in_array($exception->getMessage(), $known, true)) {
$this->output->error($exception->getMessage());

return Command::FAILURE;
}
}
@@ -235,7 +237,7 @@ protected function findApplicationPath(): string
return get_included_files()[0]; // Could also try realpath($_SERVER['argv'][0]) (used by Composer)
}

/** @param self::STATE_* $state */
/** @param self::STATE_* $state */
protected function printVersionStateInformation(int $state): void
{
$message = match ($state) {
@@ -251,7 +253,7 @@ protected function printVersionStateInformation(int $state): void
}
}

/** @param self::STRATEGY_* $strategy */
/** @param self::STRATEGY_* $strategy */
protected function updateApplication(string $strategy): void
{
$this->debug('Updating the application...');
@@ -333,9 +335,8 @@ protected function downloadFile(string $url, string $destination): void
/**
* Verify the signature of the downloaded file against the public embedded public key.
*
* @param string $phar The path to the downloaded PHAR file
* @param string $signature The path to the downloaded signature file
*
* @param string $phar The path to the downloaded PHAR file
* @param string $signature The path to the downloaded signature file
* @return bool Whether the signature is valid, true if it is, false otherwise
*
* @throws RuntimeException If the public key could not be loaded or the needed algorithm is missing.
@@ -477,7 +478,8 @@ protected function printNewlineIfVerbose(): void

protected function makeGitHubReleaseObject(array $data): object
{
return new class ($data) {
return new class($data)
{
protected readonly array $data;

/** @var string The tag name of the release */
@@ -530,17 +532,19 @@ protected function assertReleaseEntryIsValid(bool $condition): void
* The public key used to verify the signature of the downloaded file.
*
* @uid HydePHP CLI Bravo RSA Key
*
* @id EE5FC423177F61B096D768E3B3D3CA94C5435426
*
* @created 2024‑04‑22
*
* @expires <never>
*
* @link https://trustservices.hydephp.com/certificates/EE5FC423177F61B096D768E3B3D3CA94C5435426.pem
* @link https://github.com/hydephp/certificates/tree/master/EE5FC423177F61B096D768E3B3D3CA94C5435426
*
* @return string The public key in ASCII-armored format
*/
protected static final function publicKey(): string
final protected static function publicKey(): string
{
return <<<'TXT'
-----BEGIN PUBLIC KEY-----
1 change: 0 additions & 1 deletion bin/bump-application-version.php
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
*
* @usage php bin/bump-application-version.php [major|minor|patch]
*/

echo "Bumping application version!\n";

// Get type from argument input
Binary file modified builds/hyde
Binary file not shown.
Binary file modified builds/hyde.sig
Binary file not shown.
Binary file modified builds/signature.bin
Binary file not shown.
6 changes: 6 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"preset": "laravel",
"rules": {
"class_attributes_separation" : false
}
}
2 changes: 1 addition & 1 deletion tests/Unit/SelfUpdateCommandUnitTest.php
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@
it('validates release data correctly', function () {
$data = ['tag_name' => 'v1.0.0', 'assets' => [
['name' => 'hyde', 'browser_download_url' => 'https://example.com'],
['name' => 'hyde.sig', 'browser_download_url' => 'https://example.com']
['name' => 'hyde.sig', 'browser_download_url' => 'https://example.com'],
]];

$command = new InspectableSelfUpdateCommand();

0 comments on commit adaf259

Please sign in to comment.