Code Duplication    Length = 3-3 lines in 2 locations

Jid.php 2 locations

@@ 48-50 (lines=3) @@
45
46
    public function __construct(string $address, string $local = null, string $resource = null)
47
    {
48
        if ($local === null && $resource === null) {
49
            list($address, $local, $resource) = self::_split($address);
50
        }
51
52
        self::validate($address, $local, $resource);
53
@@ 76-78 (lines=3) @@
73
     */
74
    public static function validate(string $address, string $local = null, string $resource = null)
75
    {
76
        if ($local === null && $resource === null) {
77
            list($address, $local, $resource) = self::_split($address);
78
        }
79
80
        if (empty($address)) {
81
            throw new InvalidArgumentException("Domain-part of JID is REQUIRED");