Page MenuHomePhabricator

Allow Javelin initBehavior to source alternative library behaviors

Authored by ChristopherHJohnson on Nov 4 2014, 12:35 PM.



Ref T6467. Opens up initBehavior for non-phabricator sourced behaviors.

Test Plan

Confirmed no impact on unset (default 'phabricator' source name) calls to initBehavior

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable

Event Timeline

ChristopherHJohnson retitled this revision from to Allow Javelin initBehavior to source alternative library behaviors.
ChristopherHJohnson updated this object.
ChristopherHJohnson edited the test plan for this revision. (Show Details)
ChristopherHJohnson added a reviewer: epriestley.
epriestley edited edge metadata.
epriestley added inline comments.

By convention, indent two spaces.


In this codebase, prefer $source_name = 'phabricator' to establish a default scalar parameter value (i.e., an explicit default). This:

  • is clearer for humans when browsing the method signature;
  • is accessible to documentation generators and static analysis;
  • does not generate errors like this one:
[2014-11-04 05:54:04] ERROR 2: Missing argument 3 for Javelin::initBehavior(), called in /INSECURE/devtools/phabricator/src/view/page/menu/PhabricatorMainMenuSearchView.php on line 49 and defined at [/INSECURE/devtools/phabricator/src/infrastructure/javelin/Javelin.php:8]"
This revision now requires changes to proceed.Nov 4 2014, 1:56 PM
ChristopherHJohnson edited edge metadata.

establishs a default scalar parameter value for source_name

ChristopherHJohnson edited edge metadata.

corrects indentation to two spaces lines 6-8

epriestley edited edge metadata.
This revision is now accepted and ready to land.Nov 4 2014, 2:46 PM
This revision was automatically updated to reflect the committed changes.