phpcq / coding-standard

This repository holds the C-C-A coding standard definitions for phpcs and phpmd.
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Rule check for concrete class parameter typing #2

Open tristanlins opened 10 years ago

tristanlins commented 10 years ago

I often use a concrete class as parameter type, then the interface.

public function method(EventDispatcher $eventDispatcher);

instead of

public function method(EventDispatcherInterface $eventDispatcher);

We could check for such typings, that make testing harder...

discordier commented 10 years ago

Is this not yet checked? I was sure type hints would be checked already...

tristanlins commented 10 years ago

I havn't seen such a message yet...

discordier commented 10 years ago

Ok, could you post a complete minimal code example (complete class) which should be triggering the error? I guess I misunderstood you.