Completed
Pull Request — master (#165)
by Paul
03:21
created

SymfonyRouterWrapper::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the PPI Framework.
4
 *
5
 * @copyright  Copyright (c) 2011-2016 Paul Dragoonis <[email protected]>
6
 * @license    http://opensource.org/licenses/mit-license.php MIT
7
 *
8
 * @link       http://www.ppi.io
9
 */
10
11
namespace PPI\Framework\Router\Wrapper;
12
13
use Symfony\Component\Routing\RequestContext;
14
use Symfony\Component\Routing\RouterInterface;
15
16
/**
17
 * @author Paul Dragoonis <[email protected]>
18
 */
19
class SymfonyRouterWrapper implements RouterInterface
20
{
21
    /**
22
     * @var RouterInterface
23
     */
24
    protected $router;
25
26
    /**
27
     * @param RouterInterface $router
28
     */
29
    public function __construct(RouterInterface $router)
30
    {
31
        $this->setRouter($router);
32
    }
33
34
    /**
35
     * @param RouterInterface $router
36
     */
37
    public function setRouter(RouterInterface $router)
38
    {
39
        $this->router = $router;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function setContext(RequestContext $context)
46
    {
47
        $this->router->setContext($context);
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function getContext()
54
    {
55
        return $this->router->getContext();
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function getRouteCollection()
62
    {
63
        return $this->router->getRouteCollection();
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
70
    {
71
        return $this->router->generate($name, $parameters, $referenceType);
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function match($pathinfo)
78
    {
79
        return $this->router->match($pathinfo);
80
    }
81
}
82