Code Duplication    Length = 7-7 lines in 2 locations

src/Client.php 2 locations

@@ 156-162 (lines=7) @@
153
    /**
154
     * Adds an exception that will be thrown.
155
     */
156
    public function addException(\Exception $exception)
157
    {
158
        if (!$exception instanceof Exception) {
159
            @trigger_error('Clients may only throw exceptions of type '.Exception::class.'. Setting an exception of class '.get_class($exception).' will not be possible anymore in the future', E_USER_DEPRECATED);
160
        }
161
        $this->exceptions[] = $exception;
162
    }
163
164
    /**
165
     * Sets the default exception to throw when the list of added exceptions and responses is exhausted.
@@ 169-175 (lines=7) @@
166
     *
167
     * If both a default exception and a default response are set, the exception will be thrown.
168
     */
169
    public function setDefaultException(\Exception $defaultException = null)
170
    {
171
        if (!$defaultException instanceof Exception) {
172
            @trigger_error('Clients may only throw exceptions of type '.Exception::class.'. Setting an exception of class '.get_class($defaultException).' will not be possible anymore in the future', E_USER_DEPRECATED);
173
        }
174
        $this->defaultException = $defaultException;
175
    }
176
177
    /**
178
     * Adds a response that will be returned in first in first out order.