This commit is contained in:
Marcel Pociot
2020-06-02 16:51:36 +02:00
parent f058ce8c5c
commit 6a47264be9
34 changed files with 661 additions and 9 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Client\Support;
use PhpParser\Node;
use PhpParser\NodeVisitorAbstract;
class TokenNodeVisitor extends NodeVisitorAbstract
{
/** @var string */
protected $token;
public function __construct(string $token)
{
$this->token = $token;
}
public function enterNode(Node $node)
{
if ($node instanceof Node\Expr\ArrayItem && $node->key->value === 'auth_token') {
$node->value->value = $this->token;
return $node;
}
return null;
}
}