Skip to content

Proposal of adapter constructor changes #60

Description

@prolic

Currently we pass an array of options to any adapter constructor.
What would you think of passing a configuration object? You can still have an array of options, but you would pass them to the config object, instead of the adapter directly.

Something like this:

$config = new Config($someArray);
$adapter = new SomeAdapter();
$config->configureAdapter($adapter);

This is the same approach zf2 takes for the service manager, see: https://github.com/zendframework/zend-servicemanager/blob/master/src/Config.php

Downsides: We have to add public getters and setters to any adapter. For security reasons, we could disallow setting them twice (throwing an exception).

If accepted I could take this job over the weekend.

Thoughts?

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