-
-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathArc.php
More file actions
30 lines (27 loc) · 753 Bytes
/
Arc.php
File metadata and controls
30 lines (27 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow;
/**
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
final class Arc
{
public function __construct(
public readonly string $place,
public readonly int $weight,
) {
if ($weight < 1) {
throw new \InvalidArgumentException(\sprintf('The weight must be greater than 0, %d given.', $weight));
}
if ('' === $place) {
throw new \InvalidArgumentException('The place name cannot be empty.');
}
}
}