. */ declare(strict_types=1); namespace FireflyIII\Helpers\Update; use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface; use Log; /** * Trait UpdateTrait * */ trait UpdateTrait { /** * Returns an array with info on the next release, if any. * 'message' => 'A new version is available. * 'level' => 'info' / 'success' / 'error' * * @return array */ public function getLatestRelease(): array { Log::debug('Now in getLatestRelease()'); /** @var UpdateRequestInterface $checker */ $checker = app(UpdateRequestInterface::class); $channelConfig = app('fireflyconfig')->get('update_channel', 'stable'); $channel = $channelConfig ? $channelConfig->data : 'stable'; return $checker->getUpdateInformation($channel); } }