Summary
GenerateAltTextAction injects a Generator instance via constructor, but it is never used. The actual generation is handled by new GenerateAltText() which dispatches a job. The unnecessary constructor override also risks breaking compatibility if Statamic's base Action class adds a constructor.
Problem
// GenerateAltTextAction.php:18-23
public function __construct(
protected Generator $generator,
) {
//
}
The $generator property is never referenced in run() or any other method.
Suggested Fix
Remove the $generator property and constructor entirely.
References
- File:
src/Actions/GenerateAltTextAction.php:18-23
- Consolidated review finding: V9
Summary
GenerateAltTextActioninjects aGeneratorinstance via constructor, but it is never used. The actual generation is handled bynew GenerateAltText()which dispatches a job. The unnecessary constructor override also risks breaking compatibility if Statamic's baseActionclass adds a constructor.Problem
The
$generatorproperty is never referenced inrun()or any other method.Suggested Fix
Remove the
$generatorproperty and constructor entirely.References
src/Actions/GenerateAltTextAction.php:18-23