Skip to content

Boolean param with default value problem #8

@vmalkov

Description

@vmalkov

Good day!

If some method has a default Boolean parameter, the error "syntax error, unexpected ','" is thrown.

Example:

public function getMargin(int $stockId, bool $discountless=false, float $cost=0): float {....}

var_export() in buildParameterDefaultValue can fix problem:

$defaultValue .= var_export($parameter->getDefaultValue() ?? 'null',true);

return $defaultValue;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions