puli / issues

The Puli issue tracker.
90 stars 5 forks source link

BindingType issues #194

Open Nyholm opened 8 years ago

Nyholm commented 8 years ago

The BindingType class changed it constructor in https://github.com/puli/discovery/pull/33. We have about 500 places in our code where we use that constructor. The all have to be changed.

The new BindingType requires you to have a $bindingClass is that really necessary at construct time? Most of the calls to that constructor does not have that info.

webmozart commented 8 years ago

The BindingType constructor changed in this way in order to enforce a type to be used with one single binding class. That is, if you declare a binding type My\\Interface for classes, then only classes should be bound to this type, not resources.

There is a pending PR to adapt the Manager component here: puli/manager#56

The final goal is to declare binding types and bindings like this:

{
    "provide": {
        "Some\\Plugin": "My\\PluginInterface",
        "Some\\Other\\Plugin": {
            "binding-type": "My\\PluginInterface",
            "parameters": { "alias": "phpdoc" }
        }
    },
    "binding-types": {
        "My\\PluginInterface": {
            "accept": "class",
            "parameters": {}
        },
        "my/translations": "resource"
    }
}

Would you like to work on this?

Nyholm commented 8 years ago

I've made some PR for this issue now. Please review

webmozart commented 8 years ago

related to #201