如果我在PHP中有一个接口,比如说:
在实例化新的AuthenticationInterface时,如何确定使用这些类中的哪一个?
interface AuthenticationInterface {
}
还有两个实现该接口的类,例如
class ApiKey implements AuthenticationInterface {
}
class AuthToken implements AuthenticationInterface {
}
在实例化新的AuthenticationInterface时,如何确定使用这些类中的哪一个?