"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PhpTargetLanguage = exports.phpLanguageConfig = exports.phpOptions = void 0;
const index_js_1 = require("../../RendererOptions/index.js");
const Acronyms_js_1 = require("../../support/Acronyms.js");
const TargetLanguage_js_1 = require("../../TargetLanguage.js");
const PhpRenderer_js_1 = require("./PhpRenderer.js");
exports.phpOptions = {
    withGet: new index_js_1.BooleanOption("with-get", "Create Getter", true),
    fastGet: new index_js_1.BooleanOption("fast-get", "getter without validation", false),
    withSet: new index_js_1.BooleanOption("with-set", "Create Setter", false),
    withClosing: new index_js_1.BooleanOption("with-closing", "PHP Closing Tag", false),
    acronymStyle: (0, Acronyms_js_1.acronymOption)(Acronyms_js_1.AcronymStyleOptions.Pascal),
};
exports.phpLanguageConfig = {
    displayName: "PHP",
    names: ["php"],
    extension: "php",
};
class PhpTargetLanguage extends TargetLanguage_js_1.TargetLanguage {
    constructor() {
        super(exports.phpLanguageConfig);
    }
    getOptions() {
        return exports.phpOptions;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = (0, index_js_1.getOptionValues)(exports.phpOptions, untypedOptionValues);
        return new PhpRenderer_js_1.PhpRenderer(this, renderContext, options);
    }
    get stringTypeMapping() {
        const mapping = new Map();
        // "date" and "time" are not implemented in the renderer (it throws
        // on them), so let them fall back to plain strings.
        mapping.set("uuid", "uuid");
        mapping.set("date-time", "date-time");
        return mapping;
    }
}
exports.PhpTargetLanguage = PhpTargetLanguage;
