Page MenuHomePhorge

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

Authored by aklapper on Jul 3 2024, 06:39.
Tags
None
Referenced Files
F2991914: D25721.1740198728.diff
Fri, Feb 21, 04:32
F2991913: D25721.1740198728.diff
Fri, Feb 21, 04:32
F2990366: D25721.1740177346.diff
Thu, Feb 20, 22:35
F2981956: D25721.1739943116.diff
Tue, Feb 18, 05:31
F2977165: D25721.1739615676.diff
Fri, Feb 14, 10:34
F2940358: D25721.1738058188.diff
Mon, Jan 27, 09:56
F2904846: D25721.1737334831.diff
Jan 19 2025, 01:00
F2885100: D25721.1737165928.diff
Jan 17 2025, 02:05

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
Branch
aphrontTypeaheadTemplateViewRenderToken
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1421
Build 1421: arc lint + arc unit

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