Skip to content

ConnectionSettings setter methods modify copy of object #144

@heyrex

Description

@heyrex

Each setter method inside ConnectionSettings returns a clone of $this with the new setting applied, but the original object remains unmodified. This is makes certain normal programming practices very syntactically awkward.
Eg: Conditionally changing a single setting using a one line if statement becomes if($foo) $settings = $settings->setSomeSetting(true);

Is there some technical reason why ConnectionSettings should clone itself then modify the clone? If this is an oversight, I would be happy to submit a pull request to fix this peculiar behaviour.

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