<?php
use Vendor\Package\ClassName;
$object = new ClassName();
接口通过遵循预期的契约简化了项目之间的代码共享。.
<?php
namespace Psr\Log;
/**
* Describes a logger instance
*/
interface LoggerInterface
{
可互操作的标准和接口, 在客户端和服务器端采用agnostic approach来处理 HTTP 请求和响应.
<?php
namespace Psr\Http\Message;
/**
* Representation of an outgoing, client-side request.
*/
interface RequestInterface extends MessageInterface
{
<?php
namespace Vendor\Package;
class ClassName
{
public function fooBarBaz($arg1, &$arg2, $arg3 = [])
{
// method body
}
}