<?php

declare(strict_types=1);

namespace PpPhp\Core\Platform\Foundation;

final class PlatformValidator
{
    /** @return string[] */
    public function validateObject(PlatformObject $object): array
    {
        $errors = [];

        if ($object->id() === '') {
            $errors[] = 'Platform object id is required.';
        }

        if ($object->type() === '') {
            $errors[] = 'Platform object type is required.';
        }

        if ($object->label() === '') {
            $errors[] = 'Platform object label is required.';
        }

        if ($object->version()->version() === '') {
            $errors[] = 'Platform object version is required.';
        }

        return $errors;
    }
}
