Code Duplication    Length = 3-5 lines in 4 locations

src/MySQLReplication/Config/Config.php 4 locations

@@ 143-145 (lines=3) @@
140
     */
141
    public static function validate()
142
    {
143
        if (!empty(self::$user) && !is_string(self::$user)) {
144
            throw new ConfigException(ConfigException::USER_ERROR_MESSAGE, ConfigException::USER_ERROR_CODE);
145
        }
146
        if (!empty(self::$host)) {
147
            $ip = gethostbyname(self::$host);
148
            if (false === filter_var($ip, FILTER_VALIDATE_IP)) {
@@ 161-163 (lines=3) @@
158
        if (!empty(self::$password) && !is_string(self::$password) && !is_numeric(self::$password)) {
159
            throw new ConfigException(ConfigException::PASSWORD_ERROR_MESSAGE, ConfigException::PASSWORD_ERROR_CODE);
160
        }
161
        if (!empty(self::$charset) && !is_string(self::$charset)) {
162
            throw new ConfigException(ConfigException::CHARSET_ERROR_MESSAGE, ConfigException::CHARSET_ERROR_CODE);
163
        }
164
        if (!empty(self::$gtid) && !is_string(self::$gtid)) {
165
            foreach (explode(',', self::$gtid) as $gtid) {
166
                if (!(bool)preg_match(
@@ 178-182 (lines=5) @@
175
        ) {
176
            throw new ConfigException(ConfigException::SLAVE_ID_ERROR_MESSAGE, ConfigException::SLAVE_ID_ERROR_CODE);
177
        }
178
        if (!empty(self::$binLogFileName) && !is_string(self::$binLogFileName)) {
179
            throw new ConfigException(
180
                ConfigException::BIN_LOG_FILE_NAME_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_NAME_ERROR_CODE
181
            );
182
        }
183
        if (false === filter_var(self::$binLogPosition, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]])) {
184
            throw new ConfigException(
185
                ConfigException::BIN_LOG_FILE_POSITION_ERROR_MESSAGE, ConfigException::BIN_LOG_FILE_POSITION_ERROR_CODE
@@ 189-193 (lines=5) @@
186
            );
187
        }
188
189
        if (!empty(self::$mariaDbGtid) && !is_string(self::$mariaDbGtid)) {
190
            throw new ConfigException(
191
                ConfigException::MARIADBGTID_ERROR_MESSAGE, ConfigException::MARIADBGTID_ERROR_CODE
192
            );
193
        }
194
        if (false === filter_var(self::$tableCacheSize, FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]])) {
195
            throw new ConfigException(
196
                ConfigException::TABLE_CACHE_SIZE_ERROR_MESSAGE, ConfigException::TABLE_CACHE_SIZE_ERROR_CODE