Page MenuHomePhabricator

Fix a compatibility issue with `ArcanistUnsafeDynamicStringXHPASTLinterRule`
ClosedPublic

Authored by joshuaspence on Nov 24 2015, 5:11 AM.
Tags
None
Referenced Files
F13197622: D14567.diff
Mon, May 13, 12:21 AM
F13176945: D14567.id35232.diff
Wed, May 8, 6:13 PM
Unknown Object (File)
Fri, May 3, 10:02 AM
Unknown Object (File)
Thu, Apr 25, 3:26 AM
Unknown Object (File)
Mar 7 2024, 4:42 AM
Unknown Object (File)
Mar 7 2024, 3:57 AM
Unknown Object (File)
Mar 7 2024, 3:57 AM
Unknown Object (File)
Mar 7 2024, 3:57 AM
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.