Completed
Push — master ( 0fcf39...66a180 )
by Joao
02:00
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
require "vendor/autoload.php";
4
5
// Note --> Secret key must be stored at server side. Is not a good idea has to fixed on the code
6
// There are 2 places here where it is called
7
$easyJwt = new \ByJG\Util\JwtWrapper('api.test.com', '5pbZNksFl4yhr6qUNnv/FyfPP3vbYkO8arGtuEX+EIU=');
0 ignored issues
show
'5pbZNksFl4yhr6qUNnv/FyfPP3vbYkO8arGtuEX+EIU=' is of type string, but the function expects a object<ByJG\Util\JwtKeyInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
8
9
try {
10
    $tokenDecomposed = $easyJwt->extractData();
11
} catch (\Exception $ex) {
12
    header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
13
    die($ex->getMessage());
14
}
15
16
echo "{ 'data': 'value' }";
17