for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
<?php
require "vendor/autoload.php";
// Note --> Secret key must be stored at server side. Is not a good idea has to fixed on the code
// There are 2 places here where it is called
$easyJwt = new \ByJG\Util\JwtWrapper('api.test.com', '5pbZNksFl4yhr6qUNnv/FyfPP3vbYkO8arGtuEX+EIU=');
'5pbZNksFl4yhr6qUNnv/FyfPP3vbYkO8arGtuEX+EIU='
string
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);
try {
$tokenDecomposed = $easyJwt->extractData();
} catch (\Exception $ex) {
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
die($ex->getMessage());
}
echo "{ 'data': 'value' }";
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: