Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 7 |
Ratio | 46.67 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | public function metadataAction() |
||
27 | { |
||
28 | View Code Duplication | if (!$this->get('service_container')->getParameter('second_factor_only')) { |
|
|
|||
29 | $this->get('logger')->notice(sprintf( |
||
30 | 'Access to %s denied, second_factor_only parameter set to false.', |
||
31 | __METHOD__ |
||
32 | )); |
||
33 | throw $this->createAccessDeniedException('Second Factor Only feature disabled'); |
||
34 | } |
||
35 | |||
36 | /** @var \Surfnet\SamlBundle\Metadata\MetadataFactory $metadataFactory */ |
||
37 | $metadataFactory = $this->get('second_factor_only.metadata_factory'); |
||
38 | |||
39 | return new XMLResponse($metadataFactory->generate()); |
||
40 | } |
||
41 | } |
||
42 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.