*/ final class IndexResponse implements ApiResponse { /** * @var string[] */ private $items; /** * @var int */ private $totalCount = 0; private function __construct() { } public static function create(array $data) { $model = new self(); $model->items = $data['items']; $model->totalCount = $data['total_count']; return $model; } /** * @return string[] */ public function getItems() { return $this->items; } /** * @return int */ public function getTotalCount() { return $this->totalCount; } }