PHP中的这个名称是什么? [重复]

This question already has an answer here:

I've come across the following method signature:

public function register(ServiceProviderInterface $provider, array $values = []){}

I don't understand the part that reads ServiceProviderInterface $provider. Can someone please explain what it does?

</div>

The text before $provider specifies what should the argument be. In this case it should be an instance of ServiceProviderInterface. Read more about type declaration here:

http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration