This commit is contained in:
Marcel Pociot
2021-06-17 13:17:32 +02:00
parent 7742658527
commit 19606a78af
16 changed files with 470 additions and 10 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Client\Support;
use PhpParser\Node;
use PhpParser\Node\Scalar\String_;
use PhpParser\NodeVisitorAbstract;
class TokenNodeVisitor extends NodeVisitorAbstract
@@ -18,7 +19,7 @@ class TokenNodeVisitor extends NodeVisitorAbstract
public function enterNode(Node $node)
{
if ($node instanceof Node\Expr\ArrayItem && $node->key && $node->key->value === 'auth_token') {
$node->value->value = $this->token;
$node->value = new String_($this->token);
return $node;
}