Page MenuHomePhabricator

Document WebIDL binding for PHP
Closed, ResolvedPublic


Part of the DoDo porting work (see T217867) should be to write a (hopefully brief!) document giving a WebIDL binding for PHP. See:

This would document how types are mapped, how methods are (re)named, etc. The ECMAScript binding is the canonical standard binding, but we will *not* go into as much detail & corner cases as that does! See and to set more reasonable expectations. See also -- back when that was part of the standard. Somewhere there was a list of other 'community' IDL bindings, which in my memory included Python (at least).

Basically this document would provide the information necessary to know that (for example):

interface Element : Node {
  DOMString? getAttribute(DOMString qualifiedName);

from corresponds to:

public \Wikimedia\Dodo\Element::getAttribute( string $qualifiedName ) : ?string

Note that documenting this allows us to see that (for example) is incorrect (!) since the type signature given in the PHP \DOMElement::getAttribute() docs doesn't allow for the null return type which is present in the WebIDL spec.