Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Core / Path / PathValidatorInterface.php
1 <?php
2
3 namespace Drupal\Core\Path;
4
5 /**
6  * Provides an interface for url path validators.
7  */
8 interface PathValidatorInterface {
9
10   /**
11    * Returns a URL object, if the path is valid and accessible.
12    *
13    * @param string $path
14    *   The path to check.
15    *
16    * @return \Drupal\Core\Url|false
17    *   The url object, or FALSE if the path is not valid.
18    */
19   public function getUrlIfValid($path);
20
21   /**
22    * Returns a URL object, if the path is valid.
23    *
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.
26    *
27    * @param string $path
28    *   The path to check.
29    *
30    * @return \Drupal\Core\Url|false
31    *   The url object, or FALSE if the path is not valid.
32    */
33   public function getUrlIfValidWithoutAccessCheck($path);
34
35   /**
36    * Checks if the URL path is valid and accessible by the current user.
37    *
38    * @param string $path
39    *   The path to check.
40    *
41    * @return bool
42    *   TRUE if the path is valid.
43    */
44   public function isValid($path);
45
46 }