private function appendResponses(Operation $operation, array $newResponses)
    {
        foreach ($newResponses as $newResponse) {
            if (!$operation->responses) {
                $operation->responses = [];
            }

            $hasResponse = false;

            /** @var Response $response */
            foreach ($operation->responses as $response) {
                // check if one has already been set. If so, skip it.
                if ($response->response == $newResponse->response) {
                    $hasResponse = true;
                }
            }

            if (!$hasResponse) {
                $operation->responses[] = $newResponse;
            }
        }
    }
private function appendResponses(Operation $operation, array $newResponses)
    {
        foreach ($newResponses as $newResponse) {
            if (!$operation->responses) {
                $operation->responses = [];
            }

            $hasResponse = false;

            /** @var Response $response */
            foreach ($operation->responses as $response) {
                // check if one has already been set. If so, skip it.
                if ($response->response == $newResponse->response) {
                    $hasResponse = true;
                }
            }

            if (!$hasResponse) {
                $operation->responses[] = $newResponse;
            }
        }
    }
private function appendResponses ( Operation $ operation , array $ newResponses ) { foreach ( $ newResponses as $ newResponse ) { if ( ! $ operation -> responses ) { $ operation -> responses = [ ] ; } $ hasResponse = false ; /** @var Response $response */ foreach ( $ operation -> responses as $ response ) { // check if one has already been set. If so, skip it. if ( $ response -> response == $ newResponse -> response ) { $ hasResponse = true ; } } if ( ! $ hasResponse ) { $ operation -> responses [ ] = $ newResponse ; } } }
Append responses onto an operation, checking first if they are already configured.

@param Operation $operation
@param array     $newResponses
Append responses onto an operation checking first if they are already configured .