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)
Fri, Jun 6, 1:10 AM
Unknown Object (File)
May 10 2025, 1:01 PM
Unknown Object (File)
May 10 2025, 12:47 PM
Unknown Object (File)
May 6 2025, 9:34 PM
Unknown Object (File)
Apr 27 2025, 8:03 AM
Unknown Object (File)
Apr 12 2025, 5:38 AM
Unknown Object (File)
Mar 24 2025, 12:18 AM
Unknown Object (File)
Mar 23 2025, 3:08 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.