Code Duplication    Length = 11-11 lines in 2 locations

src/Urn.php 2 locations

@@ 125-135 (lines=11) @@
122
    /**
123
     * {@inheritdoc}
124
     */
125
    public function withNamespaceIdentifier($nid)
126
    {
127
        if (1 !== preg_match(static::NID_PATTERN, $nid)) {
128
            throw new \InvalidArgumentException('The string does not contain a valid namespace identifier');
129
        }
130
131
        $urn = clone $this;
132
        $urn->namespaceIdentifier = (string)$nid;
133
134
        return $urn;
135
    }
136
137
    /**
138
     * {@inheritdoc}
@@ 140-150 (lines=11) @@
137
    /**
138
     * {@inheritdoc}
139
     */
140
    public function withNamespaceSpecificString($nss)
141
    {
142
        if (1 !== preg_match(static::NSS_PATTERN, $nss)) {
143
            throw new \InvalidArgumentException('The string does not contain a valid namespace specific string');
144
        }
145
146
        $urn = clone $this;
147
        $urn->namespaceSpecificString = (string)$nss;
148
149
        return $urn;
150
    }
151
152
    /**
153
     * {@inheritdoc}