<?php
namespace App\Services;

use App\Repositories\WebhookRepository;

class WebhookService
{
    protected $webhookRepository;

    public function __construct(WebhookRepository $webhookRepository) {
        $this->webhookRepository = $webhookRepository;
    }

    public function __call($method, $arguments)
    {
        if (method_exists($this->webhookRepository, $method)) {
            return call_user_func_array([$this->webhookRepository, $method], $arguments);
        }

        throw new \BadMethodCallException("Method {$method} does not exist.");
    }
}
