[Xapian-tickets] [Xapian] #577: Use type hinting in PHP bindings
Xapian
nobody at xapian.org
Sun Nov 13 22:46:36 GMT 2011
#577: Use type hinting in PHP bindings
-----------------------------------+----------------------------------------
Reporter: olly | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 1.3.0
Component: Xapian-bindings (PHP) | Version:
Severity: normal | Blockedby:
Platform: All | Blocking:
-----------------------------------+----------------------------------------
PHP 5 supports "type hinting", which we could use in a number of places in
the PHP bindings:
http://php.net/manual/en/language.oop5.typehinting.php
This would allow us to annotate the PHP method definitions to specify the
type of object parameters (since 5.0) or that a parameter must be an array
(since 5.1). There aren't many places where we accept arrays, so the
latter isn't so useful, though for Xapian 1.3 we're only supporting PHP
5.2 and later anyway.
5.4 will add a "callable" type hint, which isn't so useful to us either.
Cases which are overloaded to take different object types would probably
only get an {{{Object}}} hint, as it looks like only a single class can be
specified. I'm not sure we have many of those.
If the argument has a default value of NULL, then NULL can be passed too.
This would be needed in a few places, though I think most if not all
already have a default value of NULL.
--
Ticket URL: <http://trac.xapian.org/ticket/577>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list