src/NotifyStatusPoller/Command/Handler/UpdateDocumentStatusHandler.php
/**
     * @param UpdateDocumentStatus $command
     * @return null
     * @throws GuzzleException
     */
@param UpdateDocumentStatus $command
@return null
@throws GuzzleException
@param UpdateDocumentStatus $command @return null @throws GuzzleException
public function handle(UpdateDocumentStatus $command)
    {
        $payload = [
            'documentId' => $command->getDocumentId(),
            'notifySendId' => $command->getNotifyId(),
            'notifyStatus' => $this->notifyStatusMapper->toSirius($command->getNotifyStatus()),
        ];
        $guzzleResponse = $this->guzzleClient->put(
            $this->updateEndpointUrl,
            ['headers' => $this->jwtAuthenticator->createToken(), 'json' => $payload ]
        );
        if ($guzzleResponse->getStatusCode() !== 204) {
            throw new UnexpectedValueException(
                sprintf('Expected status "%s" but received "%s"', 204, $guzzleResponse->getStatusCode())
            );
        }
        return null;
    }
public function handle ( UpdateDocumentStatus $ command ) { $ payload = [ 'documentId' => $ command -> getDocumentId ( ) , 'notifySendId' => $ command -> getNotifyId ( ) , 'notifyStatus' => $ this -> notifyStatusMapper -> toSirius ( $ command -> getNotifyStatus ( ) ) , ] ; $ guzzleResponse = $ this -> guzzleClient -> put ( $ this -> updateEndpointUrl , [ 'headers' => $ this -> jwtAuthenticator -> createToken ( ) , 'json' => $ payload ] ) ; if ( $ guzzleResponse -> getStatusCode ( ) !== 204 ) { throw new UnexpectedValueException ( sprintf ( 'Expected status "%s" but received "%s"' , 204 , $ guzzleResponse -> getStatusCode ( ) ) ) ; } return null ; }
@param UpdateDocumentStatus $command
 @return null
 @throws GuzzleException
@param UpdateDocumentStatus $command @return null @throws GuzzleException
// See https://github.com/sebastianbergmann/phpunit/issues/4297 // PHPUnit is deprecating self::at and we need a way to trigger an exception. // Replace with `void` if/when they implement a better replacement for `at`.