diff options
| author | George Peter Banyard <girgias@php.net> | 2020-09-12 23:24:30 +0200 |
|---|---|---|
| committer | George Peter Banyard <girgias@php.net> | 2020-09-14 13:41:10 +0200 |
| commit | 48368a6bf31300bcd5a1cbc03b89314be7bf6df8 (patch) | |
| tree | 8e7bd0e245ce08eaef91724d6124bb155a0f72da /ext | |
| parent | 31ef94cd4223718dafb2334c8b46db54b7f24a82 (diff) | |
| download | php-git-48368a6bf31300bcd5a1cbc03b89314be7bf6df8.tar.gz | |
Promote Warnings to Error in PostgreSQL PDO driver
Closes GH-6119
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/pdo_pgsql/pgsql_driver.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 38ea304a30..2666ae66e1 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -566,8 +566,8 @@ PHP_METHOD(PDO_PGSql_Ext, pgsqlCopyFromArray) } if (!zend_hash_num_elements(Z_ARRVAL_P(pg_rows))) { - php_error_docref(NULL, E_WARNING, "Cannot copy from an empty array"); - RETURN_FALSE; + zend_argument_value_error(2, "cannot be empty"); + RETURN_THROWS(); } dbh = Z_PDO_DBH_P(ZEND_THIS); @@ -1061,13 +1061,13 @@ PHP_METHOD(PDO_PGSql_Ext, pgsqlGetNotify) } if (result_type != PDO_FETCH_BOTH && result_type != PDO_FETCH_ASSOC && result_type != PDO_FETCH_NUM) { - php_error_docref(NULL, E_WARNING, "Invalid result type"); - RETURN_FALSE; + zend_argument_value_error(1, "must be one of PDO::FETCH_BOTH, PDO::FETCH_ASSOC, or PDO::FETCH_NUM"); + RETURN_THROWS(); } if (ms_timeout < 0) { - php_error_docref(NULL, E_WARNING, "Invalid timeout"); - RETURN_FALSE; + zend_argument_value_error(2, "must be greater than or equal to 0"); + RETURN_THROWS(); #ifdef ZEND_ENABLE_ZVAL_LONG64 } else if (ms_timeout > INT_MAX) { php_error_docref(NULL, E_WARNING, "Timeout was shrunk to %d", INT_MAX); |
