Needs review
Project:
AI Image Alt Text
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Feb 2026 at 11:58 UTC
Updated:
16 Apr 2026 at 15:39 UTC
Jump to comment: Most recent
Comments
Comment #4
gavinrfitzgerald commentedhttps://git.drupalcode.org/issue/ai_image_alt_text-3574780/-/merge_reque... Added a merge request that fixes the PHPCS code sniffs.
Comment #7
anybodyComment #8
anybodyAll the other fixes should please also get integrated. Much of that can be fixed by using tools. Thanks for your help @gavinrfitzgerald
Comment #9
anybodyComment #11
rohit rana commentedHi,
I have also addressed a few additional coding standard issues that were identified after running the PHPCS command. The updates have been pushed to the merge request.
Thanks.
Comment #12
mehak22 commentedI would like to help move this forward by working on the remaining code quality issues and possibly adding test coverage for key functionalities.
Please let me know if there is any preferred area to start with, otherwise I can begin by addressing ESLint/PHPStan issues and then proceed towards tests.
Happy to collaborate on getting this ready for review.
Comment #13
anybody@mehak22 exactly as you described! Thanks! Please don't let us review AI code ;)
Comment #15
vinodhini.e commentedHi,
Tested this on Drupal 11.2.5 and ran coding standards using PHPCS, PHPStan, ESLint, and Stylelint.
After applying MR !28 and re-running the reports:
PHPCS, ESLint, and Stylelint issues are fixed.
PHPStan is still reporting some errors, listed below.
Line src/Controller/GenerateAltText.php
41 Property Drupal\ai_image_alt_text\Controller\GenerateAltText::$aiProviderManager has unknown class Drupal\ai\AiProviderPluginManager as its type.
83 Parameter $file of method Drupal\ai_image_alt_text\Controller\GenerateAltText::generate() has invalid type Drupal\file\Entity\File.
111 Instantiated class Drupal\ai\OperationType\GenericType\ImageFile not found.
136 Instantiated class Drupal\ai\OperationType\Chat\ChatInput not found.
137 Instantiated class Drupal\ai\OperationType\Chat\ChatMessage not found.
Line src/Form/AiImageAltTextSettingsForm.php
103 Access to constant ChatWithImageVision on an unknown class Drupal\ai\Enum\AiModelCapability.
Line src/ProviderHelper.php
35 Parameter $aiProviderManager of method Drupal\ai_image_alt_text\ProviderHelper::__construct() has invalid type Drupal\ai\AiProviderPluginManager.
[ERROR] Found 7 errors
Comment #16
anybodyComment #17
jerech commentedThank you for testing the MR!
Regarding the PHPStan errors you reported, these appear to be related to the local environment execution rather than the code itself. Most of the errors (Drupal\ai\...) are occurring because PHPStan is unable to locate the ai module classes during your local static analysis run.
The Drupal.org GitLab CI pipeline is passing completely green (including PHPStan). The CI automatically resolves and downloads the drupal/ai dependency defined in the composer.json and .info.yml, which allows PHPStan to successfully map all the AI plugin managers and entities.
If you ensure the ai module is present in your local codebase and your phpstan.neon is configured to scan dependencies (usually handled by mglaman/phpstan-drupal), those false positives should disappear.
Changing the status back to Needs Review since the code complies with standards and pipelines are green. Thanks again for your time!