Some (but not all) functions in node.module allows nodes to be passed as arrays as well. This is confusing. It doesn't provide much added flexibility, and it puts an extra burden on modules implementing certain hooks.
The patch adds a type hint here and there. I didn't touch the other two - it seems that we don't type hint $form and $form_state yet.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | node-object-2.patch | 8.95 KB | c960657 |
| node-object-1.patch | 12 KB | c960657 |
Comments
Comment #1
c960657 commentedComment #2
moshe weitzman commentedNice cleanup.
Comment #3
dries commentedWorks for me too, although it looks like the type hinting is only partial -- not all functions have it.
Comment #4
c960657 commentedAdding type hints everywhere is a big and possibly controversial task, so I suggest we handle that in a separate issue. I just filed #595084: Rollback type hinting for $node.
This is an updated patch without the type hints.
Comment #5
dries commentedAlright, sounds good! Committed to CVS HEAD.
Comment #7
drupal_was_my_past commentedMarked #443176: Inconsistent handling of &$node in hook_nodeapi on $op as duplicate.