Page MenuHomePhabricator

The `Futures()` function violates naming conventions
Closed, ResolvedPublic

Description

The Futures() function violates the "functions should be named using lowercase_with_underscores" convention.

>>> Lint for src/future/functions.php:


   Warning  (XHP9) Naming Conventions
    Follow naming conventions: functions should be named using
    lowercase_with_underscores.

               6  * @param list              List of @{class:Future}s.
               7  * @return FutureIterator   New @{class:FutureIterator} over those futures.
               8  */
    >>>        9 function Futures($futures) {
              10   return new FutureIterator($futures);
              11 }

Maybe this should be renamed to futures()?

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

joshuaspence renamed this task from The `Futures()` function violates naming conventions` to The `Futures()` function violates naming conventions.
joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added projects: libphutil, Lint.
joshuaspence added a subscriber: joshuaspence.

I'm inclined to maybe do away with it and just use new FutureIterator() explicitly everywhere? We don't really have that many callsites.

IIRC, there were a few other things which followed this function-as-a-class-constructor-for-convenience pattern in the original codebase at Facebook, but none of them survived the export and Futures() doesn't really seem see enough use to justify keeping this unusual pattern around.

joshuaspence added a revision: Restricted Differential Revision.Dec 30 2014, 12:05 PM
joshuaspence added a revision: Restricted Differential Revision.Dec 30 2014, 12:07 PM
joshuaspence added a revision: Restricted Differential Revision.Dec 30 2014, 12:10 PM
joshuaspence added a commit: Restricted Diffusion Commit.Dec 30 2014, 12:18 PM
joshuaspence added a revision: Restricted Differential Revision.Dec 30 2014, 12:21 PM
joshuaspence added a commit: Restricted Diffusion Commit.Dec 30 2014, 12:22 PM
joshuaspence added a commit: Restricted Diffusion Commit.
joshuaspence added a commit: Restricted Diffusion Commit.

Closed by commit rPHU9319f6d50d52.