5 * Contains \Drupal\drupalmoduleupgrader\Utility\Path\Drupal7\PathUtility.
8 namespace Drupal\drupalmoduleupgrader\Utility\Path\Drupal7;
10 use Drupal\drupalmoduleupgrader\Utility\Path\PathUtilityBase;
13 * Represents a Drupal 7 route path.
15 class PathUtility extends PathUtilityBase {
20 public static function getComponent($value) {
21 return new PathComponent($value);
25 * Returns if the path has %wildcards or placeholders (%) in it.
29 public function isDynamic() {
30 return ($this->hasWildcards() || $this->hasPlaceholders());
34 * Returns if there are placeholders in the path.
38 public function hasPlaceholders() {
39 return ($this->getPlaceholders()->count() > 0);
43 * Returns every placeholder in the path, keyed by position.
47 public function getPlaceholders() {
48 return $this->filter(function(PathComponent $component) {
49 return $component->isPlaceholder();
54 * Returns a copy of the collection with all placeholders removed.
58 public function deletePlaceholders() {
59 return $this->filter(function(PathComponent $component) {
60 return (! $component->isPlaceholder());