<?php

namespace App\Service;

final class DomainAuthorityChecker implements StatCheckerInterface
{
    private $service;
    private $symbol = 'DA';

    public function __construct(ExecutableInterface $service)
    {
        $this->service = $service;
    }

    public function check($domain)
    {
        $response = $this->service->execute($domain);

        return new StatResponse($domain, $this->getSymbol(), $response->getBody()['pda']);
    }

    /**
     * @return string
     */
    public function getSymbol(): string
    {
        return $this->symbol;
    }
}
