Some return type of function are missing.
Details
Diff Detail
- Repository
- rNOTIF Notifications center
- Lint
Lint Warnings Severity Location Code Message Warning app/Providers/RouteServiceProvider.php:22 PHPCS.W.Generic.CodeAnalysis.UselessOverridingMethod.Found Generic.CodeAnalysis.UselessOverridingMethod.Found Warning tests/Phabricator/ProjectsMapTest.php:180 PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed Warning tests/Phabricator/ProjectsMapTest.php:180 PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed - Unit
Tests Passed - Branch
- useRtnType
Event Timeline
Build is green
See https://ci.nasqueron.org/job/test-notifications-phab/266/ for more details.
app/Analyzers/DockerHub/BuildFailureEvent.php | ||
---|---|---|
20โ21 | When the only goal of @return is to give the type, we can remove them. The old phpdoc is now useless as we say the same thing directly in PHP code. | |
app/Analyzers/GitHub/Events/IssueCommentEvent.php | ||
16 | Here we can keep it because it gives extra info than just @return bool | |
app/Phabricator/PhabricatorStory.php | ||
282 | The documentation states @return string[], that's a hint we'll always return an array. if $this->projects is null we call the attachProjects method. That method will assign a value [] at the first step, so we've an array to return. | |
app/Phabricator/ProjectsMap.php | ||
66โ67 | According PHP documentation:
So an instance of the class ArrayIterator is a Traversable. By documenting only Traversable, we only allow code calling this method to use foreach, and we keep the right to implement our iterator as we want. | |
68 | + use Traversable; | |
268 | We can express the idea of array of arrays like this (in doc, not in PHP code). |
Build is green
See https://ci.nasqueron.org/job/test-notifications-phab/269/ for more details.
Return types are correct
phpdoc can be improved
app/Config/Reporting/ConfigReport.php | ||
---|---|---|
48 | This is used by static analysers (like phan) and IDEs to provide more information than just an array. Hunt [] removal and restore them. | |
app/Console/Commands/ConfigShow.php | ||
52 | For example, that one could be good to remove, as we don't know what's in this array. But we can also correctly document it, could be better to replace it by return foo[] where foo is the return value of $feature->toFancyArray() | |
app/Console/Commands/NotificationsPayload.php | ||
220 | https://www.php.net/manual/en/class.reflectionparameter.php public getName(): string So the return value will be string[] | |
app/Http/Controllers/Gate/GateController.php | ||
108 | Keep it |