Failed Conditions
Push — master ( a3a59c...3397e5 )
by Florent
07:08 queued 04:51
created

JWKSetLoader::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * The MIT License (MIT)
4
 *
5
 * Copyright (c) 2014-2016 Spomky-Labs
6
 *
7
 * This software may be modified and distributed under the terms
8
 * of the MIT license.  See the LICENSE file for details.
9
*/
10
11
namespace SpomkyLabs\JoseBundle\Routing;
12
13
use Symfony\Component\Config\Loader\LoaderInterface;
14
use Symfony\Component\Config\Loader\LoaderResolver;
15
use Symfony\Component\Routing\Route;
16
use Symfony\Component\Routing\RouteCollection;
17
18
final class JWKSetLoader implements LoaderInterface
19
{
20
    /**
21
     * @var bool
22
     */
23
    private $loaded = false;
0 ignored issues
show
Unused Code introduced by
The property $loaded is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
24
25
    /**
26
     * @var \Symfony\Component\Routing\RouteCollection
27
     */
28
    private $routes;
29
30
    /**
31
     * JWKSetLoader Constructor
32
     */
33
    public function __construct()
34
    {
35
        $this->routes = new RouteCollection();
36
    }
37
38
    /**
39
     * @param string $pattern
40
     * @param string $service
41
     */
42
    public function addJWKSetRoute($pattern, $service)
43
    {
44
        $defaults =['_controller' => $service.':handleAction'];
45
        $route = new Route($pattern, $defaults);
46
        $this->routes->add('extraRoute', $route);
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function load($resource, $type = null)
53
    {
54
        return $this->routes;
55
    }
56
57
    /**
58
     * {@inheritdoc}
59
     */
60
    public function supports($resource, $type = null)
61
    {
62
        return 'jwkset' === $type;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function getResolver() {}
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function setResolver(LoaderResolver $resolver) {}
74
}
75