Failed Conditions
Push — ng ( 06d981...bf1375 )
by Florent
11:23
created

OAuth2FrameworkBundle::getCompilerPasses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 49
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 49
rs 9.2258
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2018 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\Bundle;
15
16
use OAuth2Framework\Bundle\DependencyInjection\Compiler;
17
use OAuth2Framework\Bundle\DependencyInjection\OAuth2FrameworkServerExtension;
18
use OAuth2Framework\Bundle\Security\Factory\OAuth2SecurityFactory;
19
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
20
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
21
use Symfony\Component\DependencyInjection\ContainerBuilder;
22
use Symfony\Component\HttpKernel\Bundle\Bundle;
23
24
final class OAuth2FrameworkBundle extends Bundle
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function boot()
30
    {
31
        parent::boot();
32
        //$this->container->get('twig.loader')->addPath(__DIR__.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'views', 'OAuth2FrameworkBundle');
0 ignored issues
show
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getContainerExtension($alias = 'oauth2_server')
39
    {
40
        return new OAuth2FrameworkServerExtension($alias);
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function build(ContainerBuilder $container)
47
    {
48
        foreach ($this->getCompilerPasses() as $pass) {
49
            $container->addCompilerPass($pass);
50
        }
51
52
        /* @var SecurityExtension $extension */
53
        //$extension = $container->getExtension('security');
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
54
        //$extension->addSecurityListenerFactory(new OAuth2SecurityFactory());
0 ignored issues
show
Unused Code Comprehensibility introduced by
73% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
55
    }
56
57
    /**
58
     * @return CompilerPassInterface[]
59
     */
60
    private function getCompilerPasses(): array
61
    {
62
        return [/*
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
63
            new Compiler\ClientRuleCompilerPass(),
64
            new Compiler\ScopePolicyCompilerPass(),
65
            new Compiler\ResponseFactoryCompilerPass(),
66
            new Compiler\TokenEndpointAuthMethodCompilerPass(),
67
            new Compiler\TokenIntrospectionEndpointAuthMethodCompilerPass(),
68
            new Compiler\GrantTypeCompilerPass(),
69
            new Compiler\TokenRouteCompilerPass(),
70
            new Compiler\TokenTypeCompilerPass(),
71
            new Compiler\PKCEMethodCompilerPass(),
72
            new Compiler\TokenIntrospectionRouteCompilerPass(),
73
            new Compiler\TokenRevocationRouteCompilerPass(),
74
            new Compiler\TokenTypeHintCompilerPass(),
75
            new Compiler\IssuerDiscoveryCompilerPass(),
76
            new Compiler\ResponseModeCompilerPass(),
77
            new Compiler\AccessTokenHandlerCompilerPass(),
78
            new Compiler\TokenEndpointExtensionCompilerPass(),
79
            new Compiler\AuthorizationEndpointRouteCompilerPass(),
80
            new Compiler\UserInfoScopeSupportCompilerPass(),
81
            new Compiler\UserinfoRouteCompilerPass(),
82
            new Compiler\UserinfoEndpointSignatureCompilerPass(),
83
            new Compiler\UserinfoEndpointEncryptionCompilerPass(),
84
            new Compiler\UserInfoPairwiseSubjectCompilerPass(),
85
            new Compiler\ClaimSourceCompilerPass(),
86
            new Compiler\UserAccountDiscoveryCompilerPass(),
87
            new Compiler\ParameterCheckerCompilerPass(),
88
            new Compiler\ResponseTypeCompilerPass(),
89
            new Compiler\BeforeConsentScreenCompilerPass(),
90
            new Compiler\AfterConsentScreenCompilerPass(),
91
            new Compiler\InitialAccessTokenCompilerPass(),
92
            new Compiler\ClientAssertionJWTEncryptionSupportConfigurationCompilerPass(),
93
            new Compiler\SessionManagementRouteCompilerPass(),
94
            new Compiler\ClientConfigurationEndpointRouteCompilerPass(),
95
            new Compiler\ClientRegistrationEndpointRouteCompilerPass(),
96
            new Compiler\MetadataRouteCompilerPass(),
97
            new Compiler\SignedMetadataCompilerPass(),
98
            new Compiler\IdTokenMetadataCompilerPass(),
99
            new Compiler\ClientJwtAssertionMetadataCompilerPass(),
100
            new Compiler\JwksUriEndpointRouteCompilerPass(),
101
            new Compiler\CommonMetadataCompilerPass(),
102
            new Compiler\CustomMetadataCompilerPass(),
103
            new Compiler\ScopeMetadataCompilerPass(),
104
            new Compiler\AuthorizationRequestMetadataCompilerPass(),
105
            new Compiler\RequestObjectCompilerPass(),
106
            new Compiler\SecurityAnnotationCheckerCompilerPass(),
107
        */];
108
    }
109
}
110