Documentation fixes.

8.0.x
Larry Garfield 2012-09-12 22:21:07 -05:00 committed by effulgentsia
parent ce54838752
commit fa58bbefad
2 changed files with 28 additions and 9 deletions

View File

@ -1,5 +1,10 @@
<?php
/**
* @file
* Definition of Drupal\Core\Routing\PathMatcher.
*/
namespace Drupal\Core\Routing;
use Symfony\Component\HttpFoundation\Request;
@ -9,9 +14,7 @@ use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Drupal\Core\Database\Connection;
/**
* Description of PathMatcher
*
* @author crell
* Initial matcher to match a route against a built database, by path.
*/
class PathMatcher implements InitialMatcherInterface {
/**
@ -28,6 +31,14 @@ class PathMatcher implements InitialMatcherInterface {
*/
protected $tableName;
/**
* Constructs a new PathMatcher.
*
* @param \Drupal\Core\Database\Connection $connection
* A database connection object.
* @param string $table
* The table in the database to use for matching.
*/
public function __construct(Connection $connection, $table = 'router') {
$this->connection = $connection;
$this->tableName = $table;
@ -36,10 +47,10 @@ class PathMatcher implements InitialMatcherInterface {
/**
* Matches a request against multiple routes.
*
* @param Request $request
* @param \Symfony\Component\HttpFoundation\Request $request
* A Request object against which to match.
*
* @return RouteCollection
* @return \Symfony\Component\Routing\RouteCollection
* A RouteCollection of matched routes.
*/
public function matchRequestPartial(Request $request) {

View File

@ -1,12 +1,17 @@
<?php
/**
* @file
* Definition of Drupal\Core\Routing\RouteCompiler.
*/
namespace Drupal\Core\Routing;
use Symfony\Component\Routing\RouteCompilerInterface;
use Symfony\Component\Routing\Route;
/**
* Description of RouteCompiler
* Compiler to generate derived information from a Route necessary for matching.
*/
class RouteCompiler implements RouteCompilerInterface {
@ -15,12 +20,15 @@ class RouteCompiler implements RouteCompilerInterface {
*/
const MAX_PARTS = 9;
/**
* Utility constant to use for regular expressions against the path.
*/
const REGEX_DELIMITER = '#';
/**
* Compiles the current route instance.
*
* @param Route $route
* @param \Symfony\Component\Routing\Route $route
* A Route instance
*
* @return CompiledRoute
@ -50,7 +58,7 @@ class RouteCompiler implements RouteCompilerInterface {
* It is not factored out nicely there, so we cannot simply subclass it.
* @todo Refactor Symfony's RouteCompiler so that it's useful to subclass.
*
* @param Route $route
* @param \Symfony\Component\Routing\Route $route
* The route object.
* @param string $pattern
* The pattern for which we want a matching regex.
@ -208,7 +216,7 @@ class RouteCompiler implements RouteCompilerInterface {
* with default values don't make sense anyway, so that should not be a
* problem.
*
* @param Route $route
* @param \Symfony\Component\Routing\Route $route
*
* @return string
* The path string, stripped of placeholders that have default values.