Class PhpGenerator

Abstract generator which must be implemented by each language

Hierarchy

Constructors

  • Parameters

    • Optional options: {
          constraints?: { enumKey?: EnumKeyConstraint<PhpOptions> | undefined; enumValue?: EnumValueConstraint<PhpOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, PhpOptions, PhpDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional constraints?: { enumKey?: EnumKeyConstraint<PhpOptions> | undefined; enumValue?: EnumValueConstraint<PhpOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, PhpOptions, PhpDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns PhpGenerator

Properties

languageName: string
options: PhpOptions
defaultCompleteModelOptions: PhpRenderCompleteModelOptions = ...
defaultOptions: PhpOptions = ...

Methods

  • Parameters

    • model: MetaModel
    • options: {
          constraints?: { enumKey?: EnumKeyConstraint<PhpOptions> | undefined; enumValue?: EnumValueConstraint<PhpOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, PhpOptions, PhpDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional constraints?: { enumKey?: EnumKeyConstraint<PhpOptions> | undefined; enumValue?: EnumValueConstraint<PhpOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, PhpOptions, PhpDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns ConstrainedMetaModel

  • Returns the Php options by merging custom options with default ones.

    Parameters

    • Optional options: {
          constraints?: { enumKey?: EnumKeyConstraint<PhpOptions> | undefined; enumValue?: EnumValueConstraint<PhpOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, PhpOptions, PhpDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional constraints?: { enumKey?: EnumKeyConstraint<PhpOptions> | undefined; enumValue?: EnumValueConstraint<PhpOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, PhpOptions, PhpDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns PhpOptions

Generated using TypeDoc