Code Duplication    Length = 7-8 lines in 4 locations

src/Mouf/Utils/Patcher/PatchService.php 4 locations

@@ 279-286 (lines=8) @@
276
	 * Applies the patch whose unique name is passed in parameter.
277
	 * @param string $uniqueName
278
	 */
279
	public function apply($uniqueName): void {
280
		$patch = $this->get($uniqueName);
281
		if ($patch instanceof DumpableInterface && $this->dumper !== null) {
282
		    $patch->setDumper($this->dumper);
283
        }
284
        // TODO: in next major version, get rid of the DumpableInterface and pass the dumper right in the apply method.
285
		$patch->apply();
286
	}
287
	
288
	/**
289
	 * Skips the patch whose unique name is passed in parameter.
@@ 292-298 (lines=7) @@
289
	 * Skips the patch whose unique name is passed in parameter.
290
	 * @param string $uniqueName
291
	 */
292
	public function skip($uniqueName): void {
293
		$patch = $this->get($uniqueName);
294
        if ($patch instanceof DumpableInterface && $this->dumper !== null) {
295
            $patch->setDumper($this->dumper);
296
        }
297
		$patch->skip();
298
	}
299
	
300
	
301
	/**
@@ 305-311 (lines=7) @@
302
	 * Reverts the patch whose unique name is passed in parameter.
303
	 * @param string $uniqueName
304
	 */
305
	public function revert($uniqueName): void {
306
		$patch = $this->get($uniqueName);
307
        if ($patch instanceof DumpableInterface && $this->dumper !== null) {
308
            $patch->setDumper($this->dumper);
309
        }
310
		$patch->revert();
311
	}
312
313
    /**
314
     * Apply all remaining patches (patches in state "awaiting" or in "error").
@@ 356-363 (lines=8) @@
353
     *
354
     * Note: this does NOT run the "revert" method on each patch but DOES trigger a "reset" event.
355
     */
356
	public function reset(): void {
357
        foreach ($this->listeners as $listener) {
358
            if ($listener instanceof DumpableInterface && $this->dumper !== null) {
359
                $listener->setDumper($this->dumper);
360
            }
361
            $listener->onReset();
362
        }
363
    }
364
365
    public function setDumper(DumperInterface $dumper)
366
    {