mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/ftp: Remove unreachable break (#21481)
This commit is contained in:
@@ -1264,7 +1264,6 @@ PHP_FUNCTION(ftp_set_option)
|
||||
}
|
||||
ftp->timeout_sec = Z_LVAL_P(z_value);
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
case PHP_FTP_OPT_AUTOSEEK:
|
||||
if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) {
|
||||
zend_argument_type_error(3, "must be of type bool for the FTP_AUTOSEEK option, %s given", zend_zval_value_name(z_value));
|
||||
@@ -1272,7 +1271,6 @@ PHP_FUNCTION(ftp_set_option)
|
||||
}
|
||||
ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0;
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
case PHP_FTP_OPT_USEPASVADDRESS:
|
||||
if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) {
|
||||
zend_argument_type_error(3, "must be of type bool for the FTP_USEPASVADDRESS option, %s given", zend_zval_value_name(z_value));
|
||||
@@ -1280,11 +1278,9 @@ PHP_FUNCTION(ftp_set_option)
|
||||
}
|
||||
ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0;
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
default:
|
||||
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
|
||||
RETURN_THROWS();
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1304,13 +1300,10 @@ PHP_FUNCTION(ftp_get_option)
|
||||
switch (option) {
|
||||
case PHP_FTP_OPT_TIMEOUT_SEC:
|
||||
RETURN_LONG(ftp->timeout_sec);
|
||||
break;
|
||||
case PHP_FTP_OPT_AUTOSEEK:
|
||||
RETURN_BOOL(ftp->autoseek);
|
||||
break;
|
||||
case PHP_FTP_OPT_USEPASVADDRESS:
|
||||
RETURN_BOOL(ftp->usepasvaddress);
|
||||
break;
|
||||
default:
|
||||
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
|
||||
RETURN_THROWS();
|
||||
|
||||
Reference in New Issue
Block a user