<?php

declare(strict_types=1);

namespace PpPhp\Core\Diagnostics\Metadata;

final class AssetMetadata extends AbstractMetadata
{
    public function css(): array
    {
        return is_array($this->assets['head']['css'] ?? null) ? $this->assets['head']['css'] : [];
    }

    public function js(): array
    {
        $head = is_array($this->assets['head']['js'] ?? null) ? $this->assets['head']['js'] : [];
        $footer = is_array($this->assets['footer']['js'] ?? null) ? $this->assets['footer']['js'] : [];
        return array_values(array_merge($head, $footer));
    }

}
