Code Duplication    Length = 4-4 lines in 3 locations

src/Register.php 3 locations

@@ 107-110 (lines=4) @@
104
        $query = "INSERT INTO register VALUES(
105
            null, '$email', '$username', '$password'
106
        )";
107
        if (!$this->connect->query($query)) {
108
            return json_encode(
109
                [
110
                "Error" => "You are not registered, ".$this->connect->error
111
                ]
112
            );
113
        }
@@ 122-125 (lines=4) @@
119
                '$userId', '$name', '$email', '$username', '$mob', 0
120
            )";
121
122
            if (!$this->connect->query($query)) {
123
                return json_encode(
124
                    [
125
                    "Error" => "You are not registered, ".$this->connect->error
126
                    ]
127
                );
128
            }
@@ 133-136 (lines=4) @@
130
            $query = "INSERT INTO profile VALUES(
131
                '$userId', 'Joined OpenChat', 'Joined OpenChat', ''
132
            )";
133
            if (!$this->connect->query($query)) {
134
                return json_encode(
135
                    [
136
                    "Error" => "You are not registered, ".$this->connect->error
137
                    ]
138
                );
139
            }