Laravel Hetzner Cloud

PHP MIT

Production-ready Laravel SDK for the Hetzner Cloud API with support for servers, volumes, networks, firewalls, load balancers, SSH keys, floating IPs, and more.

Stars
19
Forks
0
Downloads
2,275
Open Issues
0
Files main

Repository Files

Loading file structure...
src/DTOs/Iso.php
<?php

namespace Vendor\HetznerCloud\DTOs;

class Iso
{
    public int $id;

    public string $name;

    public string $description;

    public string $type;

    public ?string $deprecated = null;

    /**
     * Create a new DTO instance from array data.
     */
    public static function fromArray(array $data): self
    {
        $iso = new self;
        $iso->id = (int) ($data['id'] ?? 0);
        $iso->name = (string) ($data['name'] ?? '');
        $iso->description = (string) ($data['description'] ?? '');
        $iso->type = (string) ($data['type'] ?? '');
        $iso->deprecated = isset($data['deprecated']) ? (string) $data['deprecated'] : null;

        return $iso;
    }
}