e12188b7d3
* Switch to semver format * Rewrite new version check to use Github Releases and cron * Styling * Remove v from in front of version * New version check test fix * Uncomment test case
34 lines
659 B
PHP
34 lines
659 B
PHP
<?php
|
|
|
|
namespace App\Cron\Nightly;
|
|
|
|
use App\Contracts\Listener;
|
|
use App\Events\CronNightly;
|
|
use App\Services\VersionService;
|
|
|
|
/**
|
|
* Determine if any pilots should be set to ON LEAVE status
|
|
*/
|
|
class NewVersionCheck extends Listener
|
|
{
|
|
private $versionSvc;
|
|
|
|
/**
|
|
* @param VersionService $versionSvc
|
|
*/
|
|
public function __construct(VersionService $versionSvc)
|
|
{
|
|
$this->versionSvc = $versionSvc;
|
|
}
|
|
|
|
/**
|
|
* Set any users to being on leave after X days
|
|
*
|
|
* @param CronNightly $event
|
|
*/
|
|
public function handle(CronNightly $event): void
|
|
{
|
|
$this->versionSvc->isNewVersionAvailable();
|
|
}
|
|
}
|