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()?

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.