Differential D21024 Diff 50086 src/lint/linter/xhpast/rules/__tests__/implode-argument-order/implode.lint-test
Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/xhpast/rules/__tests__/implode-argument-order/implode.lint-test
<?php | <?php | ||||
// This is the correct argument order. | // This is the correct argument order. | ||||
implode(' ', $x); | implode(' ', $x); | ||||
// This is the legacy argument order which warns in PHP 7.4+. | // This is the legacy argument order which warns in PHP 7.4+. | ||||
implode($x, ' '); | implode($x, ' '); | ||||
// No warning: we can't statically tell which one is the glue. | // No warning: we can't statically tell which one is the glue. | ||||
implode($x, $y); | implode($x, $y); | ||||
// No warning: these are likely wrong, but not a glue order problem. | // No warning: these are likely wrong, but not a glue order problem. | ||||
implode(); | implode(); | ||||
implode($x); | implode($x); | ||||
implode($x, $y, $z); | implode($x, $y, $z); | ||||
// This should raise a warning by guessing that "DIRECTORY_SEPARATOR" is | |||||
// glue. | |||||
implode($path_list, DIRECTORY_SEPARATOR); | |||||
~~~~~~~~~~ | ~~~~~~~~~~ | ||||
error:7:1:XHP129:Implode With Glue First | error:7:1:XHP129:Implode With Glue First | ||||
error:19:1:XHP129:Implode With Glue First |