Passed
Push — master ( 973f06...99949d )
by Luiz Kim
02:19
created

MercadoLivreReturnController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A returnAction() 0 11 1
A __construct() 0 4 1
1
<?php
2
3
namespace ControleOnline\Controller\Oauth\MercadoLivre;
4
5
use ControleOnline\Service\UserService;
6
use Doctrine\ORM\EntityManagerInterface;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\EntityManagerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Symfony\Component\HttpFoundation\Request;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\HttpFoundation\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Component\HttpFoundation\Response;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\HttpFoundation\Response was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Symfony\Component\Routing\Attribute\Route;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Routing\Attribute\Route was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
12
class MercadoLivreReturnController
13
{
14
    public function __construct(
15
        protected EntityManagerInterface $manager,
16
        protected UserService $userService
17
    ) {}
18
19
20
21
    #[Route('/oauth/mercadolivre/return', name: 'mercadolivre_connect', methods: ['GET'])]
22
    public function returnAction(Request $request): Response
23
    {
24
        echo $request->get('code');
25
        echo $request->get('state');
26
27
        $html = '<html><body>';
28
        $html .= '<h1>Seu Conteúdo HTML</h1>';
29
        //$html .= '<script>window.close();</script>';
30
        $html .= '</body></html>';
31
        return new Response($html, Response::HTTP_OK, ['Content-Type' => 'text/html']);
32
    }
33
}
34