diff --git a/src/Models/Area.php b/src/Models/Area.php index 3cdff1d..d80747d 100644 --- a/src/Models/Area.php +++ b/src/Models/Area.php @@ -8,16 +8,10 @@ class Area { - public int $id; - - public AreaType $type; - - public string $name; - - public function __construct(int $id, AreaType $type, string $name) - { - $this->id = $id; - $this->type = $type; - $this->name = $name; + public function __construct( + public int $id, + public AreaType $type, + public string $name + ) { } } diff --git a/src/Models/Attachment.php b/src/Models/Attachment.php index eaa116d..b3080fc 100644 --- a/src/Models/Attachment.php +++ b/src/Models/Attachment.php @@ -6,13 +6,9 @@ class Attachment { - public string $name; - - public string $url; - - public function __construct(string $name, string $url) - { - $this->name = $name; - $this->url = $url; + public function __construct( + public string $name, + public string $url + ) { } } diff --git a/src/Models/Detour.php b/src/Models/Detour.php index e8ad785..6d03eb7 100644 --- a/src/Models/Detour.php +++ b/src/Models/Detour.php @@ -10,45 +10,21 @@ class Detour { - public string $id; - - public bool $external; - - public Geometry $geometry; - - public string $name; - - public Direction $direction; - - public ?TransportMode $transportMode; - - /** - * @var \Swis\Melvin\Enums\VehicleType[] - */ - public array $vehicleTypes; - - /** - * @var \Swis\Melvin\Enums\BoatType[] - */ - public array $boatTypes; - public function __construct( - string $id, - bool $external, - Geometry $geometry, - string $name, - Direction $direction, - ?TransportMode $transportMode, - array $vehicleTypes, - array $boatTypes + public string $id, + public bool $external, + public Geometry $geometry, + public string $name, + public Direction $direction, + public ?TransportMode $transportMode, + /** + * @var \Swis\Melvin\Enums\VehicleType[] + */ + public array $vehicleTypes, + /** + * @var \Swis\Melvin\Enums\BoatType[] + */ + public array $boatTypes ) { - $this->id = $id; - $this->external = $external; - $this->geometry = $geometry; - $this->name = $name; - $this->direction = $direction; - $this->transportMode = $transportMode; - $this->vehicleTypes = $vehicleTypes; - $this->boatTypes = $boatTypes; } } diff --git a/src/Models/LaneInformation.php b/src/Models/LaneInformation.php index 053d5bb..c0d82c6 100644 --- a/src/Models/LaneInformation.php +++ b/src/Models/LaneInformation.php @@ -6,16 +6,10 @@ class LaneInformation { - public int $numberOfLanesRestricted; - - public int $numberOfOperationalLanes; - - public int $originalNumberOfLanes; - - public function __construct(int $numberOfLanesRestricted, int $numberOfOperationalLanes, int $originalNumberOfLanes) - { - $this->numberOfLanesRestricted = $numberOfLanesRestricted; - $this->numberOfOperationalLanes = $numberOfOperationalLanes; - $this->originalNumberOfLanes = $originalNumberOfLanes; + public function __construct( + public int $numberOfLanesRestricted, + public int $numberOfOperationalLanes, + public int $originalNumberOfLanes + ) { } } diff --git a/src/Models/Location.php b/src/Models/Location.php index d2b9d96..ab12462 100644 --- a/src/Models/Location.php +++ b/src/Models/Location.php @@ -6,19 +6,11 @@ class Location { - public string $city; - - public string $road; - - public string $district; - - public string $comment; - - public function __construct(string $city, string $road, string $district, string $comment) - { - $this->city = $city; - $this->road = $road; - $this->district = $district; - $this->comment = $comment; + public function __construct( + public string $city, + public string $road, + public string $district, + public string $comment + ) { } } diff --git a/src/Models/Period.php b/src/Models/Period.php index aec8bd4..5468a80 100644 --- a/src/Models/Period.php +++ b/src/Models/Period.php @@ -8,47 +8,17 @@ class Period { - public int $id; - - public string $name; - - public \DateTime $startDate; - - public ?\DateTime $endDate; - - public bool $repeating; - - public ?Week $repeatingAt; - - public ?PeriodStatus $status; - - public ?bool $overrunning; - - public int $order; - - public ?int $parentId; - public function __construct( - int $id, - string $name, - \DateTime $startDate, - ?\DateTime $endDate, - bool $repeating, - ?Week $repeatingAt, - ?PeriodStatus $status, - ?bool $overrunning, - int $order, - ?int $parentId + public int $id, + public string $name, + public \DateTime $startDate, + public ?\DateTime $endDate, + public bool $repeating, + public ?Week $repeatingAt, + public ?PeriodStatus $status, + public ?bool $overrunning, + public int $order, + public ?int $parentId ) { - $this->id = $id; - $this->name = $name; - $this->startDate = $startDate; - $this->endDate = $endDate; - $this->repeating = $repeating; - $this->repeatingAt = $repeatingAt; - $this->status = $status; - $this->overrunning = $overrunning; - $this->order = $order; - $this->parentId = $parentId; } } diff --git a/src/Models/Person.php b/src/Models/Person.php index d7ef53b..4c0b574 100644 --- a/src/Models/Person.php +++ b/src/Models/Person.php @@ -8,19 +8,11 @@ class Person { - public string $firstName; - - public string $prefix; - - public string $lastName; - - public PersonType $type; - - public function __construct(string $firstName, string $prefix, string $lastName, PersonType $type) - { - $this->firstName = $firstName; - $this->prefix = $prefix; - $this->lastName = $lastName; - $this->type = $type; + public function __construct( + public string $firstName, + public string $prefix, + public string $lastName, + public PersonType $type + ) { } } diff --git a/src/Models/Restriction.php b/src/Models/Restriction.php index 2dd579d..314dd35 100644 --- a/src/Models/Restriction.php +++ b/src/Models/Restriction.php @@ -12,73 +12,28 @@ class Restriction { - public string $id; - - public bool $external; - - public ?Geometry $geometry; - - public string $name; - - public Direction $direction; - - public ?TransportMode $transportMode; - - public RestrictionType $restrictionType; - - /** - * @var \Swis\Melvin\Enums\VehicleType[] - */ - public array $vehicleTypes; - - public ?RestrictionExtraInfo $emergencyServices; - - public ?RestrictionExtraInfo $publicTransport; - - public ?int $maximumSpeed; - - public ?LaneInformation $laneInformation; - - public ?VehicleInformation $vehicleInformation; - - /** - * @var \Swis\Melvin\Enums\RoadManagementType[] - */ - public ?array $roadManagementTypes; - - public ?RoadManagementType $roadManagementType; - public function __construct( - string $id, - bool $external, - ?Geometry $geometry, - string $name, - Direction $direction, - ?TransportMode $transportMode, - RestrictionType $restrictionType, - array $vehicleTypes, - ?RestrictionExtraInfo $emergencyServices, - ?RestrictionExtraInfo $publicTransport, - ?int $maximumSpeed, - ?LaneInformation $laneInformation, - ?VehicleInformation $vehicleInformation, - ?array $roadManagementTypes, - ?RoadManagementType $roadManagementType + public string $id, + public bool $external, + public ?Geometry $geometry, + public string $name, + public Direction $direction, + public ?TransportMode $transportMode, + public RestrictionType $restrictionType, + /** + * @var \Swis\Melvin\Enums\VehicleType[] + */ + public array $vehicleTypes, + public ?RestrictionExtraInfo $emergencyServices, + public ?RestrictionExtraInfo $publicTransport, + public ?int $maximumSpeed, + public ?LaneInformation $laneInformation, + public ?VehicleInformation $vehicleInformation, + /** + * @var \Swis\Melvin\Enums\RoadManagementType[] + */ + public ?array $roadManagementTypes, + public ?RoadManagementType $roadManagementType ) { - $this->id = $id; - $this->external = $external; - $this->geometry = $geometry; - $this->name = $name; - $this->direction = $direction; - $this->transportMode = $transportMode; - $this->restrictionType = $restrictionType; - $this->vehicleTypes = $vehicleTypes; - $this->emergencyServices = $emergencyServices; - $this->publicTransport = $publicTransport; - $this->maximumSpeed = $maximumSpeed; - $this->laneInformation = $laneInformation; - $this->vehicleInformation = $vehicleInformation; - $this->roadManagementTypes = $roadManagementTypes; - $this->roadManagementType = $roadManagementType; } } diff --git a/src/Models/RestrictionExtraInfo.php b/src/Models/RestrictionExtraInfo.php index 905d6a2..a665806 100644 --- a/src/Models/RestrictionExtraInfo.php +++ b/src/Models/RestrictionExtraInfo.php @@ -6,13 +6,9 @@ class RestrictionExtraInfo { - public ?bool $passageAllowed; - - public string $description; - - public function __construct(?bool $passageAllowed, string $description) - { - $this->passageAllowed = $passageAllowed; - $this->description = $description; + public function __construct( + public ?bool $passageAllowed, + public string $description + ) { } } diff --git a/src/Models/RoadAuthority.php b/src/Models/RoadAuthority.php index 9730ab2..2c5b5f7 100644 --- a/src/Models/RoadAuthority.php +++ b/src/Models/RoadAuthority.php @@ -8,16 +8,10 @@ class RoadAuthority { - public int $id; - - public ?RoadAuthorityType $type; - - public string $name; - - public function __construct(int $id, ?RoadAuthorityType $type, string $name) - { - $this->id = $id; - $this->type = $type; - $this->name = $name; + public function __construct( + public int $id, + public ?RoadAuthorityType $type, + public string $name + ) { } } diff --git a/src/Models/Situation.php b/src/Models/Situation.php index 93cc05c..0917d73 100644 --- a/src/Models/Situation.php +++ b/src/Models/Situation.php @@ -16,135 +16,48 @@ class Situation { - public string $id; - - public bool $external; - - public Geometry $geometry; - - public string $name; - - public ?ActivityType $activityType; - - public ?WorkObject $workObject; - - public ?Impact $impact; - - public ?string $impactDescription; - - public bool $project; - - public Source $source; - - public bool $published; - - public ?string $url; - - public ?string $urlDescription; - - public Delay $delay; - - public ?WorkType $workType; - - public ?EventType $eventType; - - public ?string $eventName; - - public ?string $addition; - - public SituationStatus $status; - - public ?RoadAuthority $roadAuthority; - - public Location $location; - - /** - * @var \Swis\Melvin\Models\Period[] - */ - public array $periods; - - public ?\DateTime $createdAt; - - public ?Person $createdBy; - - public ?\DateTime $lastChangedAt; - - public ?Person $lastChangedBy; - - /** - * @var \Swis\Melvin\Models\Attachment[] - */ - public array $attachments; - - /** - * @var \Swis\Melvin\Models\Restriction[] - */ - public array $restrictions; - - /** - * @var \Swis\Melvin\Models\Detour[] - */ - public array $detours; - public function __construct( - string $id, - bool $external, - Geometry $geometry, - string $name, - ?ActivityType $activityType, - ?WorkObject $workObject, - ?Impact $impact, - ?string $impactDescription, - bool $project, - Source $source, - bool $published, - ?string $url, - ?string $urlDescription, - Delay $delay, - ?WorkType $workType, - ?EventType $eventType, - ?string $eventName, - ?string $addition, - SituationStatus $status, - ?RoadAuthority $roadAuthority, - Location $location, - array $periods, - ?\DateTime $createdAt, - ?Person $createdBy, - ?\DateTime $lastChangedAt, - ?Person $lastChangedBy, - array $attachments, - array $restrictions, - array $detours + public string $id, + public bool $external, + public Geometry $geometry, + public string $name, + public ?ActivityType $activityType, + public ?WorkObject $workObject, + public ?Impact $impact, + public ?string $impactDescription, + public bool $project, + public Source $source, + public bool $published, + public ?string $url, + public ?string $urlDescription, + public Delay $delay, + public ?WorkType $workType, + public ?EventType $eventType, + public ?string $eventName, + public ?string $addition, + public SituationStatus $status, + public ?RoadAuthority $roadAuthority, + public Location $location, + /** + * @var \Swis\Melvin\Models\Period[] + */ + public array $periods, + public ?\DateTime $createdAt, + public ?Person $createdBy, + public ?\DateTime $lastChangedAt, + public ?Person $lastChangedBy, + /** + * @var \Swis\Melvin\Models\Attachment[] + */ + public array $attachments, + /** + * @var \Swis\Melvin\Models\Restriction[] + */ + public array $restrictions, + /** + * @var \Swis\Melvin\Models\Detour[] + */ + public array $detours ) { - $this->id = $id; - $this->external = $external; - $this->geometry = $geometry; - $this->name = $name; - $this->activityType = $activityType; - $this->workObject = $workObject; - $this->impact = $impact; - $this->impactDescription = $impactDescription; - $this->project = $project; - $this->source = $source; - $this->published = $published; - $this->url = $url; - $this->urlDescription = $urlDescription; - $this->delay = $delay; - $this->workType = $workType; - $this->eventType = $eventType; - $this->eventName = $eventName; - $this->addition = $addition; - $this->status = $status; - $this->roadAuthority = $roadAuthority; - $this->location = $location; - $this->periods = $periods; - $this->createdAt = $createdAt; - $this->createdBy = $createdBy; - $this->lastChangedAt = $lastChangedAt; - $this->lastChangedBy = $lastChangedBy; - $this->attachments = $attachments; - $this->restrictions = $restrictions; - $this->detours = $detours; } } diff --git a/src/Models/VehicleInformation.php b/src/Models/VehicleInformation.php index 14a819b..a6e58bd 100644 --- a/src/Models/VehicleInformation.php +++ b/src/Models/VehicleInformation.php @@ -6,13 +6,9 @@ class VehicleInformation { - public ?float $heightCharacteristic; - - public ?float $lengthCharacteristic; - - public function __construct(?float $heightCharacteristic, ?float $lengthCharacteristic) - { - $this->heightCharacteristic = $heightCharacteristic; - $this->lengthCharacteristic = $lengthCharacteristic; + public function __construct( + public ?float $heightCharacteristic, + public ?float $lengthCharacteristic + ) { } } diff --git a/src/Models/Week.php b/src/Models/Week.php index 80c1cb4..9d2ac06 100644 --- a/src/Models/Week.php +++ b/src/Models/Week.php @@ -6,35 +6,14 @@ class Week { - public bool $monday; - - public bool $tuesday; - - public bool $wednesday; - - public bool $thursday; - - public bool $friday; - - public bool $saturday; - - public bool $sunday; - public function __construct( - bool $monday, - bool $tuesday, - bool $wednesday, - bool $thursday, - bool $friday, - bool $saturday, - bool $sunday + public bool $monday, + public bool $tuesday, + public bool $wednesday, + public bool $thursday, + public bool $friday, + public bool $saturday, + public bool $sunday ) { - $this->monday = $monday; - $this->tuesday = $tuesday; - $this->wednesday = $wednesday; - $this->thursday = $thursday; - $this->friday = $friday; - $this->saturday = $saturday; - $this->sunday = $sunday; } }