Code Duplication    Length = 7-7 lines in 2 locations

src/Client.php 2 locations

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