Skip to content

Commit 2b87dd8

Browse files
authoredJan 14, 2025
Merge pull request #9 from laravel/handle-string-concat-parsing
Handle string concatenation parsing
2 parents b1a1f8c + c290043 commit 2b87dd8

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
 

Diff for: ‎app/Contexts/Binary.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace App\Contexts;
4+
5+
class Binary extends AbstractContext
6+
{
7+
public function type(): string
8+
{
9+
return 'binary';
10+
}
11+
}

Diff for: ‎app/Parsers/BinaryExpressionParser.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace App\Parsers;
4+
5+
use App\Contexts\AbstractContext;
6+
use App\Contexts\Binary;
7+
use Microsoft\PhpParser\Node\Expression\BinaryExpression;
8+
9+
class BinaryExpressionParser extends AbstractParser
10+
{
11+
/**
12+
* @var Binary
13+
*/
14+
protected AbstractContext $context;
15+
16+
public function parse(BinaryExpression $node)
17+
{
18+
return $this->context;
19+
}
20+
21+
public function initNewContext(): ?AbstractContext
22+
{
23+
return new Binary;
24+
}
25+
}

0 commit comments

Comments
 (0)
Please sign in to comment.