Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Standing/StandingGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public static function fromArray(array $data): self
$expires = $data['expires_at'] ?? null;
$expiresAt = \is_string($expires) ? date_create_immutable($expires) : null;
if ($expires !== null && !$expiresAt instanceof \DateTimeImmutable) {
throw new \InvalidArgumentException("{$where} gives «expires_at» as a date and time, e.g. 2026-12-31T00:00:00Z");
throw new \InvalidArgumentException("{$where} gives «expires_at» as a date and time with its offset, in ISO 8601");
}

$supersedes = $data['supersedes'] ?? null;
Expand Down
4 changes: 2 additions & 2 deletions tests/Standing/AStandingGrantNeverCrossesItsFloorsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public static function documentsThatAreRefused(): iterable
['name' => 'c', 'statement' => 't', 'by' => ['operation' => 'lab:build']],
]], 'each under its own name'];
yield 'conditions not given as a list' => [['conditions' => ['c' => ['name' => 'c']]], 'gives «conditions» as a list'];
yield 'an expiry that is not a date' => [['expires_at' => 'next week, maybe'], 'gives «expires_at» as a date and time'];
yield 'an expiry that is not text' => [['expires_at' => 1790000000], 'gives «expires_at» as a date and time'];
yield 'an expiry that is not a date' => [['expires_at' => 'next week, maybe'], 'gives «expires_at» as a date and time with its offset, in ISO 8601'];
yield 'an expiry that is not text' => [['expires_at' => 1790000000], 'gives «expires_at» as a date and time with its offset, in ISO 8601'];
}

public function testTheValuesRefuseTheSameThingsWhenBuiltByHand(): void
Expand Down
Loading