You are here

public function TrailingSlashOutboundPathProcessor::isPathWithTrailingSlash in Trailing Slash 8

Parameters

$path:

array $options:

Request $request:

BubbleableMetadata $bubbleable_metadata:

Return value

bool

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to TrailingSlashOutboundPathProcessor::isPathWithTrailingSlash()
TrailingSlashOutboundPathProcessor::processOutbound in src/PathProcessor/TrailingSlashOutboundPathProcessor.php
@inheritdoc

File

src/PathProcessor/TrailingSlashOutboundPathProcessor.php, line 79

Class

TrailingSlashOutboundPathProcessor
Class TrailingSlashOutboundPathProcessor.

Namespace

Drupal\trailing_slash\PathProcessor

Code

public function isPathWithTrailingSlash($path, array &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
  $is_path_with_trailing_slash = FALSE;
  if (!in_array($path, $this->checkingPaths, TRUE)) {
    $this->checkingPaths[] = $path;
    if (TrailingSlashSettingsHelper::isEnabled() && $path !== '<front>' && !empty($path) && !$this
      ->isAdminPath($path, $options) && ($this
      ->isPathInListWithTrailingSlash($path) || $this
      ->isBundlePathWithTrailingSlash($path))) {
      $is_path_with_trailing_slash = TRUE;
    }
    $this->checkedPaths[$path] = $is_path_with_trailing_slash;
  }
  if (array_key_exists($path, $this->checkedPaths)) {
    return $this->checkedPaths[$path];
  }
  return FALSE;
}