# \Thelia\RoutingTheliaMatcherCollection

Collection of Matcher.

Matcher resolve request into controller::method exemple of Matcher : UrlMatcher of HttpKernel component (but it implements UrlMatcherInterface and not RequestMatcherInterface.

## Summary

Methods
Properties
Constants
__construct()
add()
getSortedMatchers()
sortMatchers()
matchRequest()
setContext()
getContext()
No public properties found
No constants found
No protected methods found
$context
$matchers
$defaultMatcher
$sortedMatchers
N/A
No private methods found
No private properties found
N/A

File
  Routing/TheliaMatcherCollection.php
Package
  \Default
Class hierarchy
  \Thelia\Routing\TheliaMatcherCollection

## Tags

author | Manuel Raynaud mraynaud@openstudio.fr

## Properties

### $context

    $context

#

## Tags

None found

### $matchers

    $matchers

#

## Tags

None found

### $defaultMatcher

    $defaultMatcher

#

## Tags

None found

### $sortedMatchers

    $sortedMatchers

#

## Tags

None found

## Methods

### __construct()

    __construct()

Constructor

Check if this constructor is needed (is RequestContext needed ? )

#

## Tags

None found

### add()

    add(\Symfony\Component\Routing\Matcher\RequestMatcherInterface $matcher, int $priority)

allow to add a matcher routing class to the matchers collection matcher must implement RequestMatcherInterface

priority can be fixed with $priority parameter

#### Parameters

\Symfony\Component\Routing\Matcher\RequestMatcherInterface | $matcher |
int | $priority | set the priority of the added matcher

#

## Tags

None found

### getSortedMatchers()

    getSortedMatchers() : array

Sort Matchers by priority

#### Returns

array —

Array of matchers sorted by priority.

#

## Tags

None found

### sortMatchers()

    sortMatchers() : array

Sort the matcher by priority

#### Returns

array —

Array of matchers sorted by priority.

#

## Tags

None found

### matchRequest()

    matchRequest(\Symfony\Component\HttpFoundation\Request $request) : array

Tries to match a request with a set of routes.

If the matcher can not find information, it must throw one of the exceptions documented below.

#### Parameters

\Symfony\Component\HttpFoundation\Request | $request | The request to match

#### Throws

\Symfony\Component\Routing\Exception\ResourceNotFoundException

  If no matching resource could be found

\Symfony\Component\Routing\Exception\MethodNotAllowedException

  If a matching resource was found but the request method is not allowed

#### Returns

array —

An array of parameters

#

## Tags

None found

### setContext()

    setContext(\Symfony\Component\Routing\RequestContext $context)

Sets the request context.

#### Parameters

\Symfony\Component\Routing\RequestContext | $context | The context

#

## Tags

None found

### getContext()

    getContext() : \Symfony\Component\Routing\RequestContext

Gets the request context.

#### Returns

\Symfony\Component\Routing\RequestContext —

The context

#

## Tags

None found

### TheliaMatcherCollection.php