Commit graph

34 commits

Author SHA1 Message Date
Máté Kocsis
ceb0951fa5
mysqli_get_client_info() cannot return null
This method is already deprecated
2021-05-26 17:48:35 +02:00
Máté Kocsis
97f7279353
Fix the return type of mysqli_connect() 2021-05-26 12:07:02 +02:00
Máté Kocsis
86ef34fc61
Fix the return type of mysqli::connect() 2021-05-26 11:55:03 +02:00
Máté Kocsis
e8361eb0e3
Fix return type of mysqli::init() 2021-05-07 15:21:41 +02:00
Nikita Popov
39c6aaa9cc Make mysqli_ssl_set() arguments nullable
This function internally converts zero length arguments to NULL
argument -- but we should also accept them in the first place.

Null arguments being accepted was actually documented, before
bug #78399 adjusted the docs to match current behavior.
2021-02-10 15:31:27 +01:00
Dharman
34ef804b04 Make fetch_* OO same as func
Clsoses GH-6580.
2021-01-06 15:02:52 +01:00
Dharman
44a311dbbe Fix/improve mysqli stubs
* mysqli_commit $flags default value is 0, not -1.
* A number of functions cannot actually return null.
* mysqli_poll parameter names were incorrect, as this function
  has a different signature from select.
* fetch functions apart from fetch_all can return false on failure.
2021-01-06 11:28:45 +01:00
Máté Kocsis
d5f92baad0 Fix default value handling of mysqli_fetch_object()
Make [] acceptable both for classes without constructors and
classes with a constructor that takes no arguments.

Closes GH-6336.
2020-10-20 16:48:12 +02:00
Máté Kocsis
d6264b0966
Verify parameter names of function aliases
Closes GH-6335
2020-10-16 10:56:33 +02:00
Nikita Popov
e86a6ced06 Use $statement in mysqli
As we went with $statement rather than $stmts in other places,
let's also use it in mysqli. The discrepancy with mysqli_stmt
is a bit unfortunate, but we can't be consistent with *both*.

Closes GH-6330.
2020-10-13 14:20:00 +02:00
Nikita Popov
8138ed73d7 Make mysqli_warning constructor private
The constructor was already effectively inaccessible (protected
on a final class). This just makes it more obvious and removes
the implementation in favor of directly throwing.

Per the removed test, this was an unfinished feature, and I don't
think it makes a lot of sense to finish it -- the
mysqli_stmt::get_warnings() interface makes more sense than
direct construction.

Closes GH-6208.
2020-09-27 22:08:24 +02:00
Larry Garfield
02dc9ce6e5 Rename mysqli parameters to be more logical
Closes GH-6172.
2020-09-27 21:28:29 +02:00
Nikita Popov
be4553b61a More precise type in mysqli_result constructor
This ctor requires a mysqli object. Possibly there was some
confusion with the mysqli_warning constructor here.
2020-09-24 09:56:48 +02:00
Nikita Popov
e7f98f82ac Add missing mysqlnd checks to stubs 2020-09-17 11:40:14 +02:00
George Peter Banyard
7a95e943d6 Promote warnings to Error in MySQLi extension
Closes GH-5803
2020-09-15 19:12:02 +02:00
Nikita Popov
6570fc2cf8 Remove dummy aliases for mysqli constructors
These are only available as methods. Directly declare them as
such instead of aliasing to functions that don't actually exist.
2020-08-14 11:12:41 +02:00
Máté Kocsis
046cc5e4c2
Add another round of missing parameter types to stubs
Closes GH-5950
2020-08-07 16:48:45 +02:00
Máté Kocsis
0d330e1a02
Add a few missing parameter types in stubs
Related to GH-5627
2020-07-30 14:26:45 +02:00
Nikita Popov
f7f557926e Fix arg/func info
* mysqli_get_server_info() cannot return null. The underlying API
   is infallible.
 * mysqli_select_db() func info is redundant.
 * mb_detect_order() can only return array|true, not array|false.

Also make the func_info.phpt test that is supposed to catch these
kinds of issues actually work.
2020-07-21 15:00:33 +02:00
Nikita Popov
ff19ec2df3 Introduce InternalIterator
Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.

A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.

Closes GH-5216.
2020-06-24 15:31:41 +02:00
Máté Kocsis
596561009c
Fix some UNKNOWN default values
In ext/ffi, ext/intl, ext/mysqli, and ext/pcntl
2020-06-09 09:46:51 +02:00
Máté Kocsis
b3718430de
Annotate internal functions with the mixed type
Closes GH-5618
2020-05-25 17:30:57 +02:00
Máté Kocsis
ed6cf67879
Fix some final classes in stubs 2020-05-19 14:54:37 +02:00
Máté Kocsis
3ebce8e9fc
Fix UNKNOWN default values in various extensions
Closes GH-5514
2020-05-05 19:08:20 +02:00
Nikita Popov
8597ec00d4 Remove support for libmysqlclient 5.0
Closes GH-5391.
2020-04-23 10:38:20 +02:00
Máté Kocsis
928b25cd6e
Generate function entries from stubs for mysqli
Closes GH-5420
2020-04-19 21:56:47 +02:00
Máté Kocsis
ce3b49a8e8
Fix default value of the $class_name parameter of mysqli_fetch_object() 2020-04-10 18:17:18 +02:00
Máté Kocsis
7a72e1cc7a
Fix the default value of the $flags parameter of mysqli_begin_transaction() 2020-04-10 18:17:18 +02:00
Máté Kocsis
481c8c2958
Add missing parameter to the stub of mysqli_real_connect 2020-04-10 18:17:18 +02:00
Nikita Popov
8a5b9cbc9f Fix mysqli_get_client_info() stub
The dummy link argument is not nullable.
2020-04-09 16:54:39 +02:00
Máté Kocsis
a43bc33fb2
Annotate function aliases in stubs 2020-04-04 13:03:16 +02:00
Máté Kocsis
305b17e85f
Do not include the same stub multiple times
Closes GH-5322
2020-04-03 14:23:54 +02:00
Máté Kocsis
3ab75ac019
Update MySQLi function info
Closes GH-5214
2020-02-28 14:36:54 +01:00
Tom Van Looy
fabe6a310c Add ext/mysqli stubs
Closes GH-4913.
2020-02-25 11:06:46 +01:00