3 namespace Drupal\Core\Path;
6 * Provides an interface for url path validators.
8 interface PathValidatorInterface {
11 * Returns a URL object, if the path is valid and accessible.
16 * @return \Drupal\Core\Url|false
17 * The url object, or FALSE if the path is not valid.
19 public function getUrlIfValid($path);
22 * Returns a URL object, if the path is valid.
24 * Unlike getUrlIfValid(), access check is not performed. Do not use this
25 * method if the $path is about to be presented to a user.
30 * @return \Drupal\Core\Url|false
31 * The url object, or FALSE if the path is not valid.
33 public function getUrlIfValidWithoutAccessCheck($path);
36 * Checks if the URL path is valid and accessible by the current user.
42 * TRUE if the path is valid.
44 public function isValid($path);