DEV Community

Discussion on: Interfaces in PHP

Collapse
 
hackergaucho profile image
Hacker Gaucho • Edited

good article. interfaces are cool when using an IDE like PHPStorm that automatically recognizes them. from what I remember I never used interfaces in a separate file like you did in this example.

since I switched from PHPStorm to Atom I stopped using interfaces because I was too lazy to write them but I recognize that they are very important and necessary.

your article left me with two doubts:

  1. is there a PSR standard for naming the interfaces?
  2. is there any advantage in placing the interface in a separate file instead of in the same file as your class?
Collapse
 
naveenkolambage profile image
Naveen Dinushka

is there a PSR standard for naming interfaces? This is one php-fig.org/bylaws/psr-naming-conv...

is there any advantage in placing the interface in a separate file instead of in the same file as your class? stackoverflow.com/questions/171563...