<?php

namespace Formatrica\Capability;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Free capability provider.
 *
 * Returns every known capability as unavailable. This provider ships in
 * every package (selfhost, wporg, pro) and is always registered first.
 */
final class Free_Capability_Provider implements Capability_Provider_Interface
{
    /**
     * Capability keys granted to Free regardless of licence. Multi-column layout
     * authoring is baseline builder ergonomics, so it ships in Free; add further
     * keys here to release more capabilities to Free builds. Existing configured
     * forms stay protected by the Premium_Save_Guard grandfather rules either way.
     *
     * @var list<string>
     */
    private const RELEASE_N_GRANTS = [
        Capabilities::LAYOUT_TWO_COLUMN,
    ];

    public function get_capabilities(): array
    {
        $map = [];

        foreach (Capabilities::all() as $key) {
            $map[$key] = in_array($key, self::RELEASE_N_GRANTS, true);
        }

        return $map;
    }
}
