1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
<?php
namespace Scene7\Commands;
trait ResponseType
{
protected function setResponseType($responseType)
{
if (!in_array($responseType, $this->getAllowedResponseTypes())) {
throw new \InvalidArgumentException('Invalid response type');
}
$this->addCommand(['req' => $this->getRequestType() . ',' . $responseType]);
return $this;
}
}