Page MenuHomePhabricator

Fix a compatibility issue with `ArcanistUnsafeDynamicStringXHPASTLinterRule`
ClosedPublic

Authored by joshuaspence on Nov 24 2015, 5:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 3:53 PM
Unknown Object (File)
Fri, Nov 22, 3:55 AM
Unknown Object (File)
Mon, Nov 18, 2:18 AM
Unknown Object (File)
Thu, Nov 14, 12:47 AM
Unknown Object (File)
Sun, Nov 10, 3:31 AM
Unknown Object (File)
Fri, Nov 8, 8:48 PM
Unknown Object (File)
Fri, Nov 8, 8:48 PM
Unknown Object (File)
Fri, Nov 8, 8:48 PM
Subscribers

Details

Summary

A user reported to me that arc lint was failing with an error message along the lines of "argument 1 passed to idx must be of type array, bool given". I suspect that the user is running an older version of PHP, which means that array_combine(array(), array()) is returning false instead of the expected array(). Instead, avoid calling array_combine on an empty array.

Test Plan

I don't have PHP 5.3 easily accessible to test this.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Use `array_fuse` instead of `array_combine`.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
This revision now requires changes to proceed.Nov 24 2015, 1:49 PM
joshuaspence retitled this revision from Use `array_fuse` instead of `array_combine` to Fix a compatibility issue with `ArcanistUnsafeDynamicStringXHPASTLinterRule`.Nov 24 2015, 7:57 PM
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence edited edge metadata.
joshuaspence edited edge metadata.
joshuaspence retitled this revision from Fix a compatibility issue with `ArcanistUnsafeDynamicStringXHPASTLinterRule` to Use `array_fuse` instead of `array_combine`.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)

Use a conditional

joshuaspence retitled this revision from Use `array_fuse` instead of `array_combine` to Fix a compatibility issue with `ArcanistUnsafeDynamicStringXHPASTLinterRule`.Nov 24 2015, 7:58 PM
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence edited edge metadata.
joshuaspence removed rARC Arcanist as the repository for this revision.
joshuaspence removed a subscriber: Korvin.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Nov 25 2015, 2:57 PM
This revision was automatically updated to reflect the committed changes.