PHP 클래스 Equip\Responder\FormattedResponder

상속: extends Equip\Structure\SortedDictionary, implements Equip\Adr\ResponderInterface, use trait Equip\Resolver\ResolverTrait
파일 보기 프로젝트 열기: equip/framework

공개 메소드들

메소드 설명
__construct ( Negotiator $negotiator, Relay\ResolverInterface $resolver, array $formatters = [JsonFormatter::class => 1] )
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, Equip\Adr\PayloadInterface $payload )

보호된 메소드들

메소드 설명
assertValid ( array $classes )
format ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, Equip\Adr\PayloadInterface $payload ) : Psr\Http\Message\ResponseInterface Update the response by formatting the payload.
formatter ( Psr\Http\Message\ServerRequestInterface $request ) : Equip\Formatter\FormatterInterface Retrieve the formatter to use for the current request.
hasOutput ( Equip\Adr\PayloadInterface $payload ) : boolean Determine if the payload has usable output
priorities ( ) : array Retrieve a map of accepted priorities with the responsible formatter.
sortValues ( )

메소드 상세

__construct() 공개 메소드

public __construct ( Negotiator $negotiator, Relay\ResolverInterface $resolver, array $formatters = [JsonFormatter::class => 1] )
$negotiator Negotiation\Negotiator
$resolver Relay\ResolverInterface
$formatters array

__invoke() 공개 메소드

public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, Equip\Adr\PayloadInterface $payload )
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$payload Equip\Adr\PayloadInterface

assertValid() 보호된 메소드

protected assertValid ( array $classes )
$classes array

format() 보호된 메소드

Update the response by formatting the payload.
protected format ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, Equip\Adr\PayloadInterface $payload ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$payload Equip\Adr\PayloadInterface
리턴 Psr\Http\Message\ResponseInterface

formatter() 보호된 메소드

Uses content negotiation to find the best available output format for the requested content type.
protected formatter ( Psr\Http\Message\ServerRequestInterface $request ) : Equip\Formatter\FormatterInterface
$request Psr\Http\Message\ServerRequestInterface
리턴 Equip\Formatter\FormatterInterface

hasOutput() 보호된 메소드

Determine if the payload has usable output
protected hasOutput ( Equip\Adr\PayloadInterface $payload ) : boolean
$payload Equip\Adr\PayloadInterface
리턴 boolean

priorities() 보호된 메소드

Retrieve a map of accepted priorities with the responsible formatter.
protected priorities ( ) : array
리턴 array

sortValues() 보호된 메소드

protected sortValues ( )