Use ConnectionInterface instead of implementation

This will allow developers to use custom connection implementation.
Merge pull request #6687 from salebab/patch-1

[5.0] Use ConnectionInterface In ConnectionResolver