"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/lib/Drupal/Core/Path/PathValidatorInterface.php" (26 Nov 2020, 1054 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "PathValidatorInterface.php" see the Fossies "Dox" file reference documentation.

    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 }