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

No files matched your search

+27
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;
}
}