Run php-cs-fixer on src
This commit is contained in:
@@ -4,39 +4,38 @@ declare(strict_types=1);
|
||||
|
||||
namespace pvv\side\social;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use pvv\side\Activity;
|
||||
|
||||
class AnimekveldActivity implements Activity {
|
||||
public function nextDate(\DateTimeImmutable $date): DateTimeImmutable {
|
||||
public function nextDate(\DateTimeImmutable $date): \DateTimeImmutable {
|
||||
if (
|
||||
intval($date->format("H")) > 20 ||
|
||||
(intval($date->format("H")) === 19 && intval($date->format("i")) > 30)
|
||||
(int) $date->format('H') > 20
|
||||
|| ((int) $date->format('H') === 19 && (int) $date->format('i') > 30)
|
||||
) {
|
||||
return $this->nextDate(
|
||||
$date->add(new \DateInterval("P1D"))->setTime(19, 30, 0),
|
||||
$date->add(new \DateInterval('P1D'))->setTime(19, 30, 0),
|
||||
);
|
||||
}
|
||||
$date = $date->setTime(19, 30, 0);
|
||||
if (intval($date->format("N")) !== 5) {
|
||||
return $this->nextDate($date->add(new \DateInterval("P1D")));
|
||||
if ((int) $date->format('N') !== 5) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D')));
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
public function prevDate(\DateTimeImmutable $date): DateTimeImmutable {
|
||||
public function prevDate(\DateTimeImmutable $date): \DateTimeImmutable {
|
||||
if (
|
||||
intval($date->format("H")) < 19 ||
|
||||
(intval($date->format("H")) === 20 && intval($date->format("i")) < 30)
|
||||
(int) $date->format('H') < 19
|
||||
|| ((int) $date->format('H') === 20 && (int) $date->format('i') < 30)
|
||||
) {
|
||||
return $this->prevDate(
|
||||
$date->sub(new \DateInterval("P1D"))->setTime(19, 30, 0),
|
||||
$date->sub(new \DateInterval('P1D'))->setTime(19, 30, 0),
|
||||
);
|
||||
}
|
||||
$date = $date->setTime(19, 30, 0);
|
||||
if (intval($date->format("N")) !== 5) {
|
||||
return $this->prevDate($date->sub(new \DateInterval("P1D")));
|
||||
if ((int) $date->format('N') !== 5) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D')));
|
||||
}
|
||||
|
||||
return $date;
|
||||
|
||||
Reference in New Issue
Block a user