chore: code cleanup
This commit is contained in:
1 parent
1a3640b15c
commit
5a01054b0e
65 files changed
+1046
-795
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Exception;
|
||||
|
||||
use App\Entity\Booking;
|
||||
|
||||
/**
|
||||
* One person may not hold two resources of the same kind at overlapping times. A desk in the
|
||||
* morning and a different one in the afternoon is fine -- only the overlap is refused.
|
||||
*/
|
||||
final class AlreadyHoldingResourceException extends \RuntimeException
|
||||
{
|
||||
public function __construct(public readonly Booking $existing)
|
||||
{
|
||||
$time = $existing->getTimeRange();
|
||||
|
||||
parent::__construct(\sprintf(
|
||||
'Du hast am %s bereits %s gebucht (%s).',
|
||||
$existing->getDate()->format('d.m.Y'),
|
||||
$existing->getResource()->getLabel(),
|
||||
$time,
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user