Passed
Push — master ( 6e23a2...fd1239 )
by Luiz Kim
08:17 queued 30s
created

MercadoLivreReturnController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 10 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
10
11
class MercadoLivreReturnController
12
{
13
    public function __construct(
14
        protected EntityManagerInterface $manager,
15
        protected UserService $userService
16
    ) {}
17
18
    public function __invoke(Request $request): Response
19
    {
20
        echo $request->get('code');
21
        echo $request->get('state');
22
23
        $html = '<html><body>';
24
        $html .= '<h1>Seu Conteúdo HTML</h1>';
25
        //$html .= '<script>window.close();</script>';
26
        $html .= '</body></html>';
27
        return new Response($html, Response::HTTP_OK, ['Content-Type' => 'text/html']);
28
    }
29
}
30