Page MenuHomePhorge

Fix call to non-existing newWorkCommands() in NuanceItemType
ClosedPublic

Authored by aklapper on May 17 2024, 09:09.

Details

Summary

rPe1b8532e2478395bd1f36baecb998adeef5bea3d introduced an implementation of newWorkCommands() in the child class NuanceFormItemType which is called in parent NuanceItemType::buildWorkCommands() without being defined in that parent class.
Thus define newWorkCommands() as an abstract class in parent class NuanceItemType and add an implementation returning null in the other child class NuanceGitHubEventItemType to make static code analyzers happy.

Test Plan

Carefully read the code.

Diff Detail

Repository
rP Phorge
Branch
NEnuanceNewWorkCommands (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1323
Build 1323: arc lint + arc unit

Event Timeline

Thanks. Your edit effectively reflects what already happens, but interestingly, it still may crash 🤔

Giving the mentioned commit, I'm quite sure a safe default should be return array() to avoid further crashes in this foreach():

https://we.phorge.it/source/phorge/browse/master/src/applications/nuance/controller/NuanceQueueWorkController.php;a8af0c6e511943e1e476eed9ea94d7fba8b5e3f6$92

P.S.

I invested 10 minutes in expanding the test plan, but I still completely do not understand what Nuance is and how to test this piece ✨

Yeah right, NuanceFormItemType returns an array so NuanceGitHubEventItemType should also return an empty array. Good point, thanks!

This revision is now accepted and ready to land.Jun 7 2024, 08:11