Skip to content

Remove variables from src/DB.php or remove static. #3

@rjd22

Description

@rjd22

In src/DB.php it is using static classes. This is not really wrong since they are returning classes instances so they are still injectable.

What should be changed is that they become true factories by removing the parameters from the static function unless it has something to do with the factory.

A different solution would be removing the statics so that you can just inject the DB class directly into a class. That way it will act a some kind of facade.

Since PHP 5.4 statics are not really useful anymore for their "nice" syntax. You can now do something like this: $select = (new Database)->select($params);

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