Skip to content

PHP Client does not handle default values correctly when they are ENUM references #6809

Description

@soundstripe

The default values set in the constructor for PHP Model classes does not correctly reference self::.

I believe the offending code is this line:

$this->container['{{name}}'] = isset($data['{{name}}']) ? $data['{{name}}'] : {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}};

example generated code:

        $this->container['code'] = isset($data['code']) ? $data['code'] : CODE_200;

expected:

        $this->container['code'] = isset($data['code']) ? $data['code'] : self::CODE_200;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions