Code Duplication    Length = 15-15 lines in 2 locations

src/Version.php 2 locations

@@ 89-103 (lines=15) @@
86
            throw new InvalidArgumentException($msg);
87
        }
88
89
        if ($major < 0) {
90
            $args = [
91
                'name'     => 'major',
92
                'pos'      => 0,
93
                'actual'   => $major,
94
            ];
95
96
            $msg = msg('Invalid argument value.');
97
            $msg .= msg(
98
                ' "{name}" (position {pos}) must to be a positive number; "{actual}" given.',
99
                $args
100
            );
101
102
            throw new InvalidArgumentException($msg);
103
        }
104
105
        if ($minor < 0) {
106
            $args = [
@@ 105-119 (lines=15) @@
102
            throw new InvalidArgumentException($msg);
103
        }
104
105
        if ($minor < 0) {
106
            $args = [
107
                'name'     => 'minor',
108
                'pos'      => 1,
109
                'actual'   => $minor,
110
            ];
111
112
            $msg = msg('Invalid argument value.');
113
            $msg .= msg(
114
                ' "{name}" (position {pos}) must to be a positive number; "{actual}" given.',
115
                $args
116
            );
117
118
            throw new InvalidArgumentException($msg);
119
        }
120
121
        $this->major = $major;
122
        $this->minor = $minor;