<?php

namespace App\Classes\Modules\PerfexCRM\Processors;

use App\Classes\Modules\PerfexCRM\Services\CreatesPerfexCRMTask;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Modules\PerfexCRM\DataTransferObjects\CreateTaskPerfexCRMObject;

class CreatePerfexCRMTaskProcessor
{
    /** @var CreatesPerfexCRMTask */
    private $createsPerfexCRMTask;

    /**
     * @param CreatesPerfexCRMTask $createsPerfexCRMTask
    */
    public function __construct(CreatesPerfexCRMTask $createsPerfexCRMTask)
    {
        $this->createsPerfexCRMTask = $createsPerfexCRMTask;
    }

   /**
    * @param CreateTaskPerfexCRMObject $createTaskPerfexCRMObject
    * @return true
    * @throws \App\Classes\Exceptions\MalformedRequestException
    */
   public function execute(CreateTaskPerfexCRMObject $createTaskPerfexCRMObject) {
        $this->createsPerfexCRMTask->execute($createTaskPerfexCRMObject);
        return true;
   }

}
