Code Duplication    Length = 7-7 lines in 2 locations

src/Client.php 2 locations

@@ 164-170 (lines=7) @@
161
    /**
162
     * Adds an exception that will be thrown.
163
     */
164
    public function addException(\Exception $exception)
165
    {
166
        if (!$exception instanceof Exception) {
167
            @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);
168
        }
169
        $this->exceptions[] = $exception;
170
    }
171
172
    /**
173
     * Sets the default exception to throw when the list of added exceptions and responses is exhausted.
@@ 177-183 (lines=7) @@
174
     *
175
     * If both a default exception and a default response are set, the exception will be thrown.
176
     */
177
    public function setDefaultException(\Exception $defaultException = null)
178
    {
179
        if (!$defaultException instanceof Exception) {
180
            @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);
181
        }
182
        $this->defaultException = $defaultException;
183
    }
184
185
    /**
186
     * Adds a response that will be returned in first in first out order.