Code Duplication    Length = 10-10 lines in 3 locations

src/Breaker.php 3 locations

@@ 160-169 (lines=10) @@
157
     *
158
     * @return bool
159
     */
160
    protected function isClosed($circuit)
161
    {
162
        if ($this->handler->isClosed($circuit)) {
163
            $this->dispatcher->dispatch(CircuitEvents::CLOSED, (new CircuitEvent($circuit)));
164
165
            return true;
166
        }
167
168
        return;
169
    }
170
171
    /**
172
     * isOpen.
@@ 178-187 (lines=10) @@
175
     *
176
     * @return bool
177
     */
178
    protected function isOpen($circuit)
179
    {
180
        if ($this->handler->isOpen($circuit)) {
181
            $this->dispatcher->dispatch(CircuitEvents::OPEN, (new CircuitEvent($circuit)));
182
183
            return true;
184
        }
185
186
        return;
187
    }
188
189
    /**
190
     * isHalfOpen.
@@ 196-205 (lines=10) @@
193
     *
194
     * @return bool
195
     */
196
    protected function isHalfOpen($circuit)
197
    {
198
        if ($this->handler->isHalfOpen($circuit)) {
199
            $this->dispatcher->dispatch(CircuitEvents::HALF_OPEN, (new CircuitEvent($circuit)));
200
201
            return true;
202
        }
203
204
        return;
205
    }
206
207
    /**
208
     * success.