Page MenuHomePhorge

Remove call to non-existing AphrontTypeaheadTemplateView::renderToken()
ClosedPublic

Authored by aklapper on Jul 3 2024, 06:39.
Tags
None
Referenced Files
F3604772: D25721.1745228505.diff
Sun, Apr 20, 09:41
F3577046: D25721.1745077631.diff
Fri, Apr 18, 15:47
F3506112: D25721.1744800156.diff
Tue, Apr 15, 10:42
F3377252: D25721.1744337750.diff
Thu, Apr 10, 02:15
F3370063: D25721.1744217524.diff
Tue, Apr 8, 16:52
F3368854: D25721.1744211784.diff
Tue, Apr 8, 15:16
F3368408: D25721.1744208781.diff
Tue, Apr 8, 14:26
F3363335: D25721.1744122977.diff
Mon, Apr 7, 14:36

Details

Summary

AphrontTypeaheadTemplateView::renderToken() is an undefined method,
and its result is stored in an orphan variable, and no child class
extends AphrontTypeaheadTemplateView defining a renderToken().
Thus remove its call from AphrontTypeaheadTemplateView::render().

Test Plan

Read/grep the code in this class.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

aklapper requested review of this revision.Jul 3 2024, 06:39

lgtm

Additional consideration under control: an external class may have extended AphrontTypeaheadTemplateView and defining a renderToken() there, and making this snippet operative (I'm not saying that it's a good practice, I'm saying that it would work). But this extreme corner case is not the case.

grep -FR 'renderToken(' .
./src/applications/search/compiler/PhutilSearchQueryCompiler.php:      $result[] = $this->renderToken($token);
./src/applications/search/compiler/PhutilSearchQueryCompiler.php:      $result[] = $this->renderToken($token);
./src/applications/search/compiler/PhutilSearchQueryCompiler.php:      $result[] = $this->renderToken($token, $this->getStemmer());
./src/applications/search/compiler/PhutilSearchQueryCompiler.php:  private function renderToken(
./src/view/control/AphrontTypeaheadTemplateView.php:      $tokens[] = $this->renderToken($key, $value);

The PhutilSearchQueryCompiler is completely unrelated 👍

Moreover the result is stored in an orphan variable. It may happen that this method could have desired rendering side-effects, but this is just not the case, per above. Thanks

This revision is now accepted and ready to land.Jul 20 2024, 08:40