Code Duplication    Length = 7-7 lines in 2 locations

src/Client.php 2 locations

@@ 149-155 (lines=7) @@
146
    /**
147
     * Adds an exception that will be thrown.
148
     */
149
    public function addException(\Exception $exception)
150
    {
151
        if (!$exception instanceof Exception) {
152
            @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);
153
        }
154
        $this->exceptions[] = $exception;
155
    }
156
157
    /**
158
     * Sets the default exception to throw when the list of added exceptions and responses is exhausted.
@@ 162-168 (lines=7) @@
159
     *
160
     * If both a default exception and a default response are set, the exception will be thrown.
161
     */
162
    public function setDefaultException(\Exception $defaultException = null)
163
    {
164
        if (!$defaultException instanceof Exception) {
165
            @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);
166
        }
167
        $this->defaultException = $defaultException;
168
    }
169
170
    /**
171
     * Adds a response that will be returned in first in first out order.