src/Call/CallData.php
public function setEndEvent(EndEvent $endEvent): void
    {
        if ($this->endEvent) {
            throw new InvalidArgumentException('Call already completed.');
        }

        $endEvent->setCall($this);

        if (!$this->responseEvent) {
            $this->responseEvent = $endEvent;
        }

        $this->endEvent = $endEvent;
    }
public function setEndEvent(EndEvent $endEvent): void
    {
        if ($this->endEvent) {
            throw new InvalidArgumentException('Call already completed.');
        }

        $endEvent->setCall($this);

        if (!$this->responseEvent) {
            $this->responseEvent = $endEvent;
        }

        $this->endEvent = $endEvent;
    }
public function setEndEvent ( EndEvent $ endEvent ) : void { if ( $ this -> endEvent ) { throw new InvalidArgumentException ( 'Call already completed.' ) ; } $ endEvent -> setCall ( $ this ) ; if ( ! $ this -> responseEvent ) { $ this -> responseEvent = $ endEvent ; } $ this -> endEvent = $ endEvent ; }
Set the end event.

@param EndEvent $endEvent The end event.

@throws InvalidArgumentException If the call has already completed.
Set the end event .