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.

CommentFileSizeAuthor
#4 node-object-2.patch8.95 KBc960657
node-object-1.patch12 KBc960657

Comments

c960657’s picture

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Nice cleanup.

dries’s picture

Works for me too, although it looks like the type hinting is only partial -- not all functions have it.

c960657’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new8.95 KB

Adding 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.

dries’s picture

Status: Needs review » Fixed

Alright, sounds good! Committed to CVS HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drupal_was_my_past’s picture