Code Duplication    Length = 11-14 lines in 2 locations

src/Pool.php 1 location

@@ 52-65 (lines=14) @@
49
     * @param callable|null            $onProgress function (Process $process, float $duration, string $last) : void
50
     * @param int                      $maxSimultaneous
51
     */
52
    public function __construct(
53
        array $items = [],
54
        callable $onSuccess = null,
55
        callable $onFailure = null,
56
        callable $onProgress = null,
57
        $maxSimultaneous = self::NO_MAX
58
    ) {
59
        parent::__construct($items);
60
61
        $this->onSuccess = $onSuccess;
62
        $this->onFailure = $onFailure;
63
        $this->onProgress = $onProgress;
64
        $this->maxSimultaneous = $maxSimultaneous;
65
    }
66
67
    /**
68
     * @param callable|null $onSuccess function (Process $process, float $duration, string $last) : void

src/Run.php 1 location

@@ 38-48 (lines=11) @@
35
     * @param callable|null $onFailure  function (Process $process, float $duration, string $last) : void
36
     * @param callable|null $onProgress function (Process $process, float $duration, string $last) : void
37
     */
38
    public function __construct(
39
        Process $process,
40
        callable $onSuccess = null,
41
        callable $onFailure = null,
42
        callable $onProgress = null
43
    ) {
44
        $this->process = $process;
45
        $this->onSuccess = $onSuccess;
46
        $this->onFailure = $onFailure;
47
        $this->onProgress = $onProgress;
48
    }
49
50
    /**
51
     * Start the process