1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* Command Class |
6
|
|
|
* @category Ticaje |
7
|
|
|
* @package Ticaje_Dummy |
8
|
|
|
* @author Hector Luis Barrientos <[email protected]> |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Ticaje\Dummy\Console\Command; |
12
|
|
|
|
13
|
|
|
use Symfony\Component\Console\Command\Command; |
14
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
15
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
16
|
|
|
|
17
|
|
|
use Ticaje\Connector\Gateway\Client\Rest as RestClient; |
|
|
|
|
18
|
|
|
use Ticaje\Connector\Interfaces\ClientInterface; |
|
|
|
|
19
|
|
|
use Ticaje\Connector\Interfaces\Provider\Token\TokenProviderInterface; |
|
|
|
|
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class Instantiate |
23
|
|
|
* @package Ticaje\Connector\Command |
24
|
|
|
*/ |
25
|
|
|
class Connector extends Command |
26
|
|
|
{ |
27
|
|
|
protected $client; |
28
|
|
|
|
29
|
|
|
protected $tokenProvider; |
30
|
|
|
|
31
|
|
|
public function __construct( |
32
|
|
|
RestClient $client, |
33
|
|
|
TokenProviderInterface $tokenProvider, |
34
|
|
|
string $name = null |
35
|
|
|
) { |
36
|
|
|
$this->client = $client; |
37
|
|
|
$this->tokenProvider = $tokenProvider; |
38
|
|
|
parent::__construct($name); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
protected function configure() |
42
|
|
|
{ |
43
|
|
|
$this->setName("ticaje:test:connector"); |
44
|
|
|
$this->setDescription("Test Connector Extension."); |
45
|
|
|
parent::configure(); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
49
|
|
|
{ |
50
|
|
|
$credentials = [ |
51
|
|
|
ClientInterface::BASE_URI_KEY => 'https://apiuat.evobanco.com:8443/' |
52
|
|
|
]; |
53
|
|
|
$params = [ |
54
|
|
|
'grant_type' => 'onboarding', |
55
|
|
|
'scope' => 'otp', |
56
|
|
|
'client_id' => '5cd3375d-f845-4375-ab86-7d59b2363d9a', |
57
|
|
|
'client_secret' => 'dcad6955-dccb-4127-b964-b7a69f8a4e97', |
58
|
|
|
'username' => 'new_client' |
59
|
|
|
]; |
60
|
|
|
$token = $this->tokenProvider |
61
|
|
|
->initialize($credentials) |
62
|
|
|
->setParams($params) |
63
|
|
|
->getAccessToken(); |
64
|
|
|
$output->writeln($token); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths