You are here

class PathComponent in Drupal 7 to 8/9 Module Upgrader 8

Same name in this branch
  1. 8 src/Utility/Path/Drupal7/PathComponent.php \Drupal\drupalmoduleupgrader\Utility\Path\Drupal7\PathComponent
  2. 8 src/Utility/Path/Drupal8/PathComponent.php \Drupal\drupalmoduleupgrader\Utility\Path\Drupal8\PathComponent

Represents a single component in a Drupal 7 route path.

Hierarchy

Expanded class hierarchy of PathComponent

4 files declare their use of PathComponent
ParameterBinding.php in src/Routing/ParameterBinding.php
ParameterMap.php in src/Routing/ParameterMap.php
PathComponentTest.php in tests/src/Unit/Utility/Path/Drupal7/PathComponentTest.php
PathUtilityTest.php in tests/src/Unit/Utility/Path/Drupal7/PathUtilityTest.php

File

src/Utility/Path/Drupal7/PathComponent.php, line 10

Namespace

Drupal\drupalmoduleupgrader\Utility\Path\Drupal7
View source
class PathComponent extends PathComponentBase {

  /**
   * Returns if this component is a generic placeholder (%).
   *
   * @return bool
   */
  public function isPlaceholder() {
    return $this->value == '%';
  }

  /**
   * {@inheritdoc}
   */
  public function isWildcard() {
    return (bool) preg_match('/%[a-zA-Z0-9_]+/', $this->value);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PathComponent::isPlaceholder public function Returns if this component is a generic placeholder (%).
PathComponent::isWildcard public function Returns if this component is considered a wildcard. Overrides PathComponentInterface::isWildcard
PathComponentBase::$value protected property
PathComponentBase::__construct public function Constructs the path component. Overrides PathComponentInterface::__construct
PathComponentBase::__toString public function Overrides PathComponentInterface::__toString