Commit f5736837 authored by Thalles Ferreira's avatar Thalles Ferreira Committed by Alexander Hass
Browse files

Issue #3011973 by thalles: Coding standards in google_analytics.module

parent 857db0f4
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -22,11 +22,6 @@ use Drupal\node\NodeInterface;
use GuzzleHttp\Exception\RequestException;
use Drupal\google_analytics\Component\Render\GoogleAnalyticsJavaScriptSnippet;

/**
 * Define the default file extension list that should be tracked as download.
 */
define('GOOGLE_ANALYTICS_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip');

/**
 * Advertise the supported google analytics api details.
 */
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\google_analytics\GoogleAnalitycsInterface;

/**
 * Configure Google_Analytics settings for this site.
@@ -274,7 +275,7 @@ class GoogleAnalyticsAdminSettingsForm extends ConfigFormBase {
      '#title_display' => 'invisible',
      '#type' => 'textfield',
      '#default_value' => $config->get('track.files_extensions'),
      '#description' => $this->t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: @extensions', ['@extensions' => GOOGLE_ANALYTICS_TRACKFILES_EXTENSIONS]),
      '#description' => $this->t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: @extensions', ['@extensions' => GoogleAnalitycsInterface::GOOGLE_ANALYTICS_TRACKFILES_EXTENSIONS]),
      '#maxlength' => 500,
      '#states' => [
        'enabled' => [
+15 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\google_analytics;

/**
 * Provides an interface.
 */
interface GoogleAnalitycsInterface {

  /**
   * Define the default file extension list that should be tracked as download.
   */
  const GOOGLE_ANALYTICS_TRACKFILES_EXTENSIONS = '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip';

}