Global constants should not be used, move it to a class or interface

Created on 21 June 2023, almost 2 years ago
Updated 22 February 2024, about 1 year ago

Proposed resolution

1. Create the 'ChosenInterface.php' file and put it into the 'src' folter.
/mymodule/src/ChosenInterface.php
2. Insert into the 'ChosenInterface.php' add the code like this:
<?php

namespace Drupal\chosen;

/**
* Provides an interface for chosen constants.
*/
interface ChosenInterface {

/**
* Define chosen library url.
*/
const CHOSEN_WEBSITE_URL = 'https://github.com/JJJ/chosen';
const CHOSEN_INCLUDE_ADMIN = 0;
const CHOSEN_INCLUDE_NO_ADMIN = 1;
const CHOSEN_INCLUDE_EVERYWHERE = 2;

}

📌 Task
Status

Needs review

Version

4.0

Component

Code

Created by

🇮🇳India arti_parmar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024