AssetPrefixTokenProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A provideValue() 0 4 1
A configureOptions() 0 3 1
1
<?php
2
namespace NVBooster\PHPCRAssetsBundle\Routing;
3
4
use Symfony\Cmf\Component\RoutingAuto\TokenProviderInterface;
5
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
6
use Symfony\Cmf\Component\RoutingAuto\UriContext;
7
8
/**
9
 * @author nvb
10
 *
11
 */
12
class AssetPrefixTokenProvider implements TokenProviderInterface
13
{
14
    private $prefix;
15
    
16
    /**
17
     * @param string $prefix
18
     */
19
    public function __construct($prefix = '')
20
    {
21
        $this->prefix = preg_replace('@^\/|\/$@', '', $prefix);    
22
    }
23
    
24
    /**
25
     * {@inheritDoc}
26
     */
27
    public function provideValue(UriContext $uriContext, $options)
28
    {
29
        return $this->prefix;
30
    }
31
    
32
    /**
33
     * {@inheritDoc}
34
     */
35
    public function configureOptions(OptionsResolverInterface $optionsResolver)
36
    {
37
    }
38
}