Code Duplication    Length = 9-9 lines in 2 locations

src/Envelopes/Builder.php 1 location

@@ 1676-1684 (lines=9) @@
1673
            throw new \InvalidArgumentException('Envelope type must be string');
1674
        }
1675
1676
        if ($envelopeType == self::EVENT_PROFILE_UPDATE) {
1677
            if (!is_null($sequenceId) && !is_string($sequenceId)) {
1678
                throw new \InvalidArgumentException('Sequence ID must be string or null');
1679
            }
1680
        } else {
1681
            if (!is_string($sequenceId)) {
1682
                throw new \InvalidArgumentException('Sequence ID must be string');
1683
            }
1684
        }
1685
1686
        $this->type = $envelopeType;
1687
        $this->sequenceId = $sequenceId;

src/Envelopes/Envelope.php 1 location

@@ 40-48 (lines=9) @@
37
            throw new \InvalidArgumentException('Envelope type must be string');
38
        }
39
40
        if ($type == Builder::EVENT_PROFILE_UPDATE) {
41
            if (!is_null($sequenceId) && !is_string($sequenceId)) {
42
                throw new \InvalidArgumentException('Sequence ID must be string or null');
43
            }
44
        } else {
45
            if (!is_string($sequenceId)) {
46
                throw new \InvalidArgumentException('Sequence ID must be string');
47
            }
48
        }
49
        foreach ($inodes as $node) {
50
            if (!$node instanceof IdentityNodeInterface) {
51
                throw new \InvalidArgumentException('Array of IdentityNode expected');