LarsNieuwenhuizen/ClubhouseConnector

View on GitHub
src/Component/Response/SingleComponentResponseTrait.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
declare(strict_types = 1);

namespace LarsNieuwenhuizen\ClubhouseConnector\Component\Response;

trait SingleComponentResponseTrait
{

    protected string $componentClass;

    protected function formatJsonResult(string $json): void
    {
        $data = \json_decode($json, true);
        $component = $this->componentClass::createFromResponseData($data);
        $this->body = $component;
    }
}