for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\Controllers\Response\ResponsePayload;
/**
* Trait HasFormatTrait
* @package Nip\Controllers\Response\ResponsePayload
*/
trait HasFormatTrait
{
* @var string
protected $defaultFormat = null;
protected $format = null;
public function withDefaultFormat(string $format): self
$this->defaultFormat = $format;
return $this;
}
* @return string
public function getFormat()
return $this->format ?? $this->defaultFormat;