mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 01:38:41 +00:00
fix languages 4
This commit is contained in:
parent
ca4ad775d2
commit
4b8475f890
|
|
@ -39,12 +39,8 @@ class CronJob extends TaskAbstract
|
|||
*/
|
||||
public static function createWith(array $jobData) : TaskAbstract
|
||||
{
|
||||
if (!\is_string($jobData[0]) || !\is_string($jobData[1])) {
|
||||
return new self('');
|
||||
}
|
||||
|
||||
$interval = \array_splice($jobData, 1, 5);
|
||||
|
||||
return new self($jobData[0], $jobData[1], \implode(' ', $interval));
|
||||
return new self($jobData[0] ?? '', $jobData[1] ?? '', \implode(' ', $interval));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,21 +42,15 @@ class Schedule extends TaskAbstract
|
|||
*/
|
||||
public static function createWith(array $jobData) : TaskAbstract
|
||||
{
|
||||
if (!\is_string($jobData[1]) || !\is_string($jobData[8])
|
||||
|| !\is_string($jobData[7]) || !\is_string($jobData[10])
|
||||
) {
|
||||
return new self('');
|
||||
}
|
||||
|
||||
$job = new self($jobData[1], $jobData[8], $jobData[7]);
|
||||
$job = new self($jobData[1] ?? '', $jobData[8] ?? '', $jobData[7] ?? '');
|
||||
|
||||
$job->status = (int) $jobData[3];
|
||||
|
||||
if (DateTime::isValid($jobData[2])) {
|
||||
if ($jobData[2] !== null && DateTime::isValid($jobData[2])) {
|
||||
$job->setNextRunTime(new \DateTime($jobData[2]));
|
||||
}
|
||||
|
||||
if (DateTime::isValid($jobData[5])) {
|
||||
if ($jobData[5] !== null && DateTime::isValid($jobData[5])) {
|
||||
$job->setLastRuntime(new \DateTime($jobData[5]));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user