You are here

public function PathUtilityBase::find in Drupal 7 to 8/9 Module Upgrader 8

Filters the path by a string. The filtered path will only contain components whose string representation is identical to $element.

Parameters

string $element: The string to search for.

Return value

static

File

src/Utility/Path/PathUtilityBase.php, line 60

Class

PathUtilityBase
Base class for PathUtilityInterface implementations.

Namespace

Drupal\drupalmoduleupgrader\Utility\Path

Code

public function find($element) {
  return $this
    ->filter(function (PathComponentInterface $component) use ($element) {
    return $element === $component
      ->__toString();
  });
}