Skip to content

Remove unused Generator injection from GenerateAltTextAction #60

@robocopklaus

Description

@robocopklaus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmediumMedium severity finding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions