Same name in other branches
  1. 5.0.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm
  2. 6.0.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm
  3. 8.x-2.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm
  4. 8.x-3.x advagg_validator/src/Form/JsHintForm.php \Drupal\advagg_validator\Form\JsHintForm

Configure form for JsHint validation of JavaScript files.

Hierarchy

  • class \Drupal\advagg\Form\AdvaggFormBase extends \Drupal\Core\Form\ConfigFormBase
    • class \Drupal\advagg_validator\Form\BaseValidatorForm extends \Drupal\advagg\Form\AdvaggFormBase
      • class \Drupal\advagg_validator\Form\JsHintForm extends \Drupal\advagg_validator\Form\BaseValidatorForm

Expanded class hierarchy of JsHintForm

1 file declares its use of JsHintForm
JsHintFormTest.php dans advagg_validator/tests/src/Kernel/Form/JsHintFormTest.php
1 string reference to 'JsHintForm'
advagg_validator.routing.yml dans advagg_validator/advagg_validator.routing.yml
advagg_validator/advagg_validator.routing.yml

Fichier

advagg_validator/src/Form/JsHintForm.php, line 10

Namespace

Drupal\advagg_validator\Form
View source
class JsHintForm extends BaseValidatorForm {
    
    /**
     * {@inheritdoc}
     */
    public function getFormId() {
        return 'advagg_validator_jshint';
    }
    
    /**
     * {@inheritdoc}
     */
    public function buildForm(array $form, FormStateInterface $form_state) {
        $form = parent::generateForm('js');
        $form['#attached']['library'][] = 'advagg_validator/jshint';
        $ignore_list = $this->config('advagg_validator.settings')
            ->get('jshint_ignore');
        if (is_array($ignore_list)) {
            $ignore_list = implode(',', $ignore_list);
        }
        $form['#attached']['drupalSettings']['jshint'] = [
            'browser' => TRUE,
            'curly' => TRUE,
            'eqeqeq' => TRUE,
            'forin' => TRUE,
            'latedef' => TRUE,
            'newcap' => TRUE,
            'noarg' => TRUE,
            'strict' => TRUE,
            'trailing' => TRUE,
            'undef' => TRUE,
            'unused' => TRUE,
            'predef' => [
                'Drupal' => FALSE,
                'drupalSettings' => FALSE,
                'domready' => FALSE,
                'jQuery' => FALSE,
                '_' => FALSE,
                'matchMedia' => FALSE,
                'Backbone' => FALSE,
                'Modernizr' => FALSE,
                'VIE' => FALSE,
                'CKEDITOR' => FALSE,
            ],
            'ignore' => $ignore_list,
        ];
        $form = parent::buildForm($form, $form_state);
        unset($form['actions']);
        return $form;
    }

}

Members

Titre Trier par ordre décroissant Modifiers Object type Résumé Overriden Title Overrides
AdvaggFormBase::isAjax protected function Checks if the form was submitted by AJAX.
BaseValidatorForm::$streamWrapperManager protected property The StreamWrapper manage.
BaseValidatorForm::create public static function Overrides AdvaggFormBase::create 1
BaseValidatorForm::domExtractor protected function Extract info from the DOMNode Object.
BaseValidatorForm::generateForm public function Generate a hierarchical form sorted by path from asset files.
BaseValidatorForm::getEditableConfigNames protected function
BaseValidatorForm::getElement protected function Get array element that corresponds to directory.
BaseValidatorForm::hideGoodFiles protected function Do not display info on a file if it is valid.
BaseValidatorForm::scanAllDirs protected function Recursively scan the drupal webroot for files matching the given extension.
BaseValidatorForm::scanDirectory protected function Finds all files that match a given mask in a given directory.
BaseValidatorForm::testFiles protected function Perform server side test(s) on all given files. 1
JsHintForm::buildForm public function
JsHintForm::getFormId public function