Skip to content

Internal Exception in Drupal.NamingConventions.ValidVariableName #219

@mbomb007

Description

@mbomb007
  1 | ERROR | [ ] An error occurred during processing; checking has been aborted. The error message was: $stackPtr is not a class member var
    |       |     The error originated in the Drupal.NamingConventions.ValidVariableName sniff on line 41. (Internal.Exception)

Run coding standards checks for this file, which has xfunction instead of function:

<?php

namespace Drupal\my_module\Services;

use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected xfunction alterRoutes(RouteCollection $collection) {
    // Edit user.
    if ($route = $collection->get('entity.user.edit_form')) {
      $route->setRequirement('_permission', 'administer users');
    }

    // View user. Not currently restricted.
    if (FALSE && $route = $collection->get('entity.user.canonical')) {
      $route->setRequirement('_permission', 'administer users');
    }
  }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions