Skip to content

Commit c5cc08d

Browse files
committed
test: ignore mixed type
1 parent 09087c2 commit c5cc08d

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

Tests/NameNodeHolderFindRuleTest/NameNodeHolderFindRuleTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public function data(): array
3030
[__DIR__ . '/data/name-holder/name-node.php', [['App\DummyFuncCall', 8]]],
3131
[__DIR__ . '/data/name-holder/array-including-name-node.php', [['App\DummyTraitUse', 8]]],
3232
[__DIR__ . '/data/name-holder/union-including-name-node.php', [['App\DummyUnionType', 10]]],
33-
[__DIR__ . '/data/non-name-holder.php', []],
33+
[__DIR__ . '/data/non-name-holder/no-name-node.php', []],
34+
[__DIR__ . '/data/non-name-holder/mixed-type-exists.php', []],
3435
];
3536
}
3637
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace App;
4+
5+
use PhpParser\Node\Expr;
6+
7+
class DummyShellExec extends Expr
8+
{
9+
/** @var array Encapsed string array */
10+
public $parts;
11+
12+
/**
13+
* Constructs a shell exec (backtick) node.
14+
*
15+
* @param array $parts Encapsed string array
16+
* @param array $attributes Additional attributes
17+
*/
18+
public function __construct(array $parts, array $attributes = []) {
19+
$this->attributes = $attributes;
20+
$this->parts = $parts;
21+
}
22+
23+
public function getSubNodeNames() : array {
24+
return ['parts'];
25+
}
26+
27+
public function getType() : string {
28+
return 'Expr_ShellExec';
29+
}
30+
}

0 commit comments

Comments
 (0)