我对指南以及如何命名文件有点困惑。
1.) 是什么Vendor
意思\<Vendor Name>\(<Namespace>\)*<Class Name>
2.)如果我命名命名空间AnimalsApp
并有一个abstract class Dog
,我是否将具体的类GermanShepherd
放在他们自己的文件夹中?
IE。AnimalsApp\Dog\GermanShepherd\GermanShepherd.php
还是AnimalsApp\Dog\GermanShepherd.php
?
此外,我是否将其包含Dog.php
在GermanShepherd.php
文件中,还是由自动加载器为我加载所有内容?
3.) 命名空间的所有子类都需要在每个文件的顶部都有命名空间吗?
4.) 是这里<Class Name>
的同义词<Interface>
吗?当你有类似的东西时怎么办class MyClass extends MyAbstract implements MyInterface
。你把文件放在哪里?