Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int

if (!array_key_exists('time', $branch)) {
$messages[$path][] = sprintf('Key "time" is required for branch "%s".', $name);
} elseif (isset($branch['time'])) {
$timestamp = is_int($branch['time']) ? $branch['time'] : strtotime($branch['time']);

if ($timestamp === false) {
$messages[$path][] = sprintf('"time" is invalid for branch "%s", given "%s".', $name, $branch['time']);
} elseif ($timestamp > time()) {
$messages[$path][] = sprintf('"time" cannot be in the future for branch "%s", given "%s".', $name, $branch['time']);
}
}

if (!isset($branch['versions'])) {
Expand Down