Open Grafikart opened 7 years ago
@fabfuel Could you please take a look
With this change, it wouldn't be a decorator anymore.
I see how this would make things easier, but this class wouldn't make too much sense, if you extend PDO
but still have to inject a PDO instance. Sorry, I can't merge it like this.
The real problem is, that PHP has not provided an PDOInterface. A real decorator does implement the interface for being compatible with existing implementations. This is not possible here.
Therefore I would recomment creating an interface "PDOInterface". Then one can is able to create real decorators.
class ProfilingPDO implements PDOInterface
{
...
}
class MyPDO extends PDO implements PDOInterface
{
...
}
This would allow the decorator to be injected to replace the original PDO object without breaking typehinting.