Skip to content
Snippets Groups Projects

Issue #3472717: Fix the issues reported by PHP_CodeSniffer

Open Issue #3472717: Fix the issues reported by PHP_CodeSniffer
3 unresolved threads
3 unresolved threads

Closes #3472717

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
6 6 use Drupal\Core\Form\FormStateInterface;
7 7 use Symfony\Component\DependencyInjection\ContainerInterface;
8 8
9 /**
10 * Provides a form to bulk generate alt text for images using AI.
11 *
12 * This form identifies image fields across various entity types with missing
13 * alt text and allows users to bulk generate or manually add alt text.
  • 74 74 *
    75 * @param \Drupal\file\Entity\File $file
    76 * File entity.
    75 * It generates an alt text for an image file using a configured AI provider.
    76 *
    77 * @param \Drupal\file\Entity\File|null $file
    78 * The file entity representing the image.
    79 * @param string $lang_code
    80 * The language code to be used for generating the alt text (default: 'en').
    77 81 *
    78 82 * @return \Symfony\Component\HttpFoundation\JsonResponse
    79 * JSON response.
    83 * A JSON response containing the generated alt text or an error message.
    80 84 */
    81 public function generate(File $file = NULL, $lang_code = 'en') {
    85 public function generate(?File $file = NULL, $lang_code = 'en') {
  • 5 5 use Drupal\ai\AiProviderPluginManager;
    6 6 use Drupal\Core\Config\ConfigFactoryInterface;
    7 7
    8 /**
    9 * Provides helper methods to manage AI providers for image alt text generation.
    10 *
    11 * This class encapsulates logic to retrieve and manage AI providers and models
    12 * for the 'ai_image_alt_text' module. It interacts with the configuration
    13 * system and AI provider plugin manager to determine the appropriate provider
    14 * and model to use for generating alt text.
  • Alberto Paderno requested changes

    requested changes

  • Akul Saxena added 1 commit

    added 1 commit

    • 33595d70 - Issue-3472717: Made requested changes.

    Compare with previous version

  • Akul Saxena added 1 commit

    added 1 commit

    • de83b9fe - Issue-3472717: Made nullable.

    Compare with previous version

  • added 1 commit

    • 0c1f630d - Improved some code/documentation comments

    Compare with previous version

  • Marcus Johansson approved this merge request

    approved this merge request

  • Marcus Johansson enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • Please register or sign in to reply
    Loading