Home
last modified time | relevance | path

Searched refs:stmts (Results 1 – 25 of 182) sorted by relevance

12345678

/PHP-Parser/test/PhpParser/NodeVisitor/
H A DNameResolverTest.php361 $this->assertEquals($stmts, $traverser->traverse($stmts));
386 $this->assertNull($stmts[0]->stmts[5]->class->namespacedName);
390 $this->assertSame('A', (string) $stmts[0]->stmts[0]->namespacedName);
391 $this->assertSame('B', (string) $stmts[0]->stmts[1]->namespacedName);
392 $this->assertSame('C', (string) $stmts[0]->stmts[2]->namespacedName);
395 $this->assertNull($stmts[0]->stmts[5]->class->namespacedName);
400 $stmts = [
413 $stmts = $traverser->traverse($stmts);
490 $stmts = $traverser->traverse($stmts);
519 $stmts = $traverser->traverse($stmts);
[all …]
/PHP-Parser/test/code/formatPreservation/
H A DremovalViaNull.test101 $stmts[2]->extends = null;
102 $stmts[2]->stmts[0]->returnType = null;
103 $stmts[2]->stmts[1]->props[0]->default = null;
104 $stmts[2]->stmts[2]->adaptations[0]->newName = null;
105 $stmts[2]->stmts[3]->type = null;
112 $stmts[9]->num = null;
113 $stmts[10]->num = null;
114 $stmts[11]->keyVar = null;
115 $stmts[12]->else = null;
116 $stmts[13]->expr = null;
[all …]
H A Dattributes.test35 $stmts[0]->attrGroups[] = $attrGroup;
36 $stmts[0]->stmts[0]->attrGroups[] = $attrGroup;
37 $stmts[0]->stmts[0]->params[0]->attrGroups[] = $attrGroup;
38 $stmts[0]->stmts[1]->attrGroups[] = $attrGroup;
39 $stmts[0]->stmts[2]->attrGroups[] = $attrGroup;
40 $stmts[1]->attrGroups[] = $attrGroup;
41 $stmts[2]->attrGroups[] = $attrGroup;
113 $stmts[0]->stmts[0]->attrGroups[] = $attrGroup;
114 $stmts[0]->stmts[0]->attrGroups[] = $attrGroup2;
115 $stmts[0]->stmts[1]->attrGroups[] = $attrGroup;
[all …]
H A DlistRemoval.test5 array_splice($stmts, 1, 1, []);
16 array_pop($stmts[0]->params);
31 array_pop($stmts[0]->params);
88 array_pop($stmts);
97 array_pop($stmts);
127 unset($stmts[0]->catches[2]);
128 $stmts[0]->catches = array_values($stmts[0]->catches);
160 $stmts[0]->catches = array_values($stmts[0]->catches);
189 $stmts[0]->stmts[2] = new Node\Stmt\ClassMethod('getBar');
190 $stmts[0]->stmts[3] = new Node\Stmt\ClassMethod('getBaz');
[all …]
H A Dindent.test6 $stmts[0] = new Stmt\If_(new Expr\Variable('a'), ['stmts' => $stmts]);
17 $stmts[0] = new Stmt\If_(new Expr\Variable('a'), ['stmts' => $stmts]);
30 $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('y'));
47 $call = $stmts[0]->expr;
48 $stmts[0]->expr = new Expr\StaticCall(new Node\Name\FullyQualified('Compat'), $call->name, $call->a…
63 $stmts[0] = new Stmt\While_($stmts[0]->cond, $stmts[0]->stmts);
H A Dbasic.test40 $stmts[0]->byRef = true;
58 $stmts[0]->byRef = true;
77 $tmp = $stmts[0]->stmts[0];
78 $stmts[0]->stmts[0] = $stmts[1];
79 $stmts[1] = $tmp;
102 $tmp = $stmts[1]->stmts[0];
103 $stmts[1]->stmts[0] = $stmts[2];
104 $stmts[2] = $tmp;
148 $tmp = $stmts[0];
149 $stmts[0] = $stmts[1];
[all …]
H A DinlineHtml.test9 $stmts[0]->setAttribute('origNode', null);
27 $stmts[0]->stmts[2] = $stmts[0]->stmts[1];
46 $stmts[0]->stmts[1] = $stmts[0]->stmts[2];
66 unset($stmts[0]->stmts[2]);
85 array_splice($stmts[0]->stmts, 0, 1, []);
104 array_splice($stmts[0]->stmts, 1, 1, []);
H A DemptyListInsertion.test10 $stmts[0]->implements[] = new Node\Name('Iface');
11 $stmts[0]->implements[] = new Node\Name('Iface2');
12 $stmts[1]->extends[] = new Node\Name('Iface');
13 $stmts[1]->extends[] = new Node\Name('Iface2');
40 $stmts[1]->stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('a'));
41 $stmts[1]->stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('b'));
44 $stmts[2]->expr->uses[] = new Node\Expr\Variable('c');
45 $stmts[2]->expr->uses[] = new Node\Expr\Variable('d');
83 $stmts[0]->expr->args[] = new Node\Expr\Variable('a');
84 $stmts[0]->expr->args[] = new Node\Expr\Variable('b');
[all …]
H A DinsertionOfNullable.test77 $stmts[0]->returnType = new Node\Name('Foo');
84 $stmts[4]->expr->if = new Expr\Variable('z');
87 $stmts[7]->num = new Scalar\LNumber(2);
88 $stmts[8]->num = new Scalar\LNumber(2);
89 $stmts[9]->expr = new Expr\Variable('x');
91 $stmts[10]->stmts[0]->returnType = new Node\Name('Y');
92 $stmts[10]->stmts[1]->props[0]->default = new Scalar\DNumber(42.0);
93 $stmts[10]->stmts[2]->type = new Node\Identifier('int');
94 $stmts[11]->keyVar = new Expr\Variable('z');
97 $stmts[14]->else = new Stmt\Else_([]);
[all …]
H A DmodifierChange.test16 $stmts[0]->flags = Stmt\Class_::MODIFIER_ABSTRACT;
17 $stmts[1]->flags = 0;
18 $stmts[1]->stmts[0]->flags = Stmt\Class_::MODIFIER_PRIVATE;
19 $stmts[1]->stmts[1]->flags = Stmt\Class_::MODIFIER_PROTECTED;
20 $stmts[1]->stmts[2]->flags |= Stmt\Class_::MODIFIER_FINAL;
45 $stmts[0]->params[0]->flags = Stmt\Class_::MODIFIER_PRIVATE;
46 $stmts[0]->params[1]->flags = 0;
47 $stmts[0]->params[2]->flags = Stmt\Class_::MODIFIER_PUBLIC;
63 $stmts[0]->expr->class->flags = Modifiers::READONLY;
64 $stmts[1]->expr->class->flags = 0;
H A DlistInsertion.test24 $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('baz'));
130 $stmts[0]->stmts[] = $node;
156 array_unshift($stmts[0]->stmts, $node);
171 array_unshift($stmts[0]->stmts, $node);
189 array_unshift($stmts[0]->stmts, $node);
209 array_unshift($stmts[0]->stmts, $node);
230 array_unshift($stmts[0]->stmts, $node);
231 $stmts[0]->stmts[1]->setAttribute('comments', []);
249 $stmts[0]->stmts,
266 $stmts[0]->stmts = [
[all …]
H A DclassMethodNop.test11 $stmts[0]->stmts[0]->stmts[] = new Stmt\Expression(new Node\Expr\Variable('foo'));
30 $stmts[0]->stmts[0]->stmts[] = new Stmt\Expression(new Node\Expr\Variable('foo'));
49 $stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment("/* I'm a new comment */")]);
68 $stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment("// I'm a new comment")]);
H A Denum.test7 $stmts[0]->scalarType = null;
19 $stmts[0]->stmts[0]->expr = null;
31 $stmts[0]->scalarType = new Node\Identifier('int');
42 $stmts[0]->scalarType = new Node\Identifier('int');
55 $stmts[0]->stmts[0]->expr = new Scalar\LNumber(1);
70 $stmts[0]->stmts[] = new Node\Stmt\EnumCase('C');
85 $stmts[0]->implements[] = new Node\Name('Z');
96 $stmts[0]->implements[] = new Node\Name('Y');
H A Dproperty_hooks.test11 $stmts[0]->stmts[0]->hooks[] = new Node\PropertyHook('set', new Scalar\Int_(123));
30 $stmts[0]->stmts[0]->params[0]->hooks[] = new Node\PropertyHook('set', new Scalar\Int_(123));
51 $stmts[0]->stmts[0]->hooks[0]->body[] = new Stmt\Expression(new Expr\Variable('b'));
72 $stmts[0]->stmts[0]->hooks[0]->flags = Modifiers::FINAL;
91 $stmts[0]->stmts[0]->hooks[0]->body = [new Stmt\Return_(new Scalar\Int_(24))];
114 $stmts[0]->stmts[0]->hooks[0]->body = new Scalar\Int_(24);
115 $stmts[0]->stmts[1]->hooks[0]->body = [new Stmt\Return_(new Scalar\Int_(24))];
H A Dfixup.test52 $stmts[0]->expr->name = new Expr\Variable('a');
54 $stmts[2]->expr->var = new Expr\Variable('bar');
56 $stmts[4]->expr->name = new Node\Identifier('foo');
59 $stmts[5]->expr->name = new Expr\Variable('bar');
61 $stmts[7]->expr->name = new Node\VarLikeIdentifier('bar');
63 $stmts[9]->expr->class = new Scalar\String_('Foo');
64 $stmts[10]->expr->class = new Scalar\String_('Foo');
65 $stmts[11]->expr->class = new Expr\ConstFetch(new Node\Name('FOO'));
66 $stmts[12]->expr->class = new Expr\ConstFetch(new Node\Name('FOO'));
67 $stmts[13]->expr->class = new Expr\ConstFetch(new Node\Name('FOO'));
[all …]
H A Darrow_function.test8 $stmts[0]->expr->expr = new Expr\Variable('b');
20 $stmts[0]->expr->params[] = new Node\Param(new Expr\Variable('b'));
35 $stmts[0]->expr->params = [];
45 $stmts[0]->expr->returnType = new Node\Identifier('bool');
57 $stmts[0]->expr->returnType = null;
72 $stmts[0]->expr->static = true;
73 $stmts[1]->expr->static = false;
94 $stmts[0]->expr->byRef = true;
95 $stmts[1]->expr->byRef = false;
H A Dcomments.test7 $stmts[0]->setAttribute('comments', []);
19 $comments = $stmts[1]->getComments();
21 $stmts[1]->setAttribute('comments', $comments);
41 $method = $stmts[0]->stmts[0];
58 $stmts[0]->setDocComment(new Comment\Doc("/** foo */"));
/PHP-Parser/test/PhpParser/
H A DNodeFinderTest.php12 $stmts = [new Node\Stmt\Expression($assign)];
14 return [$stmts, $vars];
19 list($stmts, $vars) = $this->getStmtsAndVars();
23 $this->assertSame($vars, $finder->find($stmts, $varFilter));
24 $this->assertSame($vars, $finder->find($stmts[0], $varFilter));
29 $this->assertSame([], $finder->find($stmts, $noneFilter));
34 list($stmts, $vars) = $this->getStmtsAndVars();
42 list($stmts, $vars) = $this->getStmtsAndVars();
46 $this->assertSame($vars[0], $finder->findFirst($stmts, $varFilter));
52 $this->assertNull($finder->findFirst($stmts, $noneFilter));
[all …]
H A DNodeTraverserTest.php16 $stmts = [$echoNode];
22 $this->assertEquals($stmts, $traverser->traverse($stmts));
177 $this->assertEquals($stmts, $traverser->traverse($stmts));
210 $this->assertEquals($stmts, $traverser->traverse($stmts));
271 $this->assertEquals($stmts, $traverser->traverse($stmts));
284 $this->assertEquals($stmts, $traverser->traverse($stmts));
298 $this->assertEquals($stmts, $traverser->traverse($stmts));
313 $this->assertEquals($stmts, $traverser->traverse($stmts));
352 $stmts = [$if1, $if2];
412 $this->assertSame($stmts, $traverser->traverse($stmts));
[all …]
/PHP-Parser/lib/PhpParser/
H A DPrettyPrinter.php11 * @param Node[] $stmts Array of statements
15 public function prettyPrint(array $stmts): string; argument
29 * @param Node[] $stmts Array of statements
33 public function prettyPrintFile(array $stmts): string; argument
46 * @param Node[] $stmts Modified AST with links to original AST
50 … public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens): string; argument
/PHP-Parser/lib/PhpParser/Node/Stmt/
H A DBlock.php9 public array $stmts; variable in PhpParser\\Node\\Stmt\\Block
14 * @param Stmt[] $stmts Statements
17 public function __construct(array $stmts, array $attributes = []) { argument
19 $this->stmts = $stmts;
H A DElse_.php9 public array $stmts; variable in PhpParser\\Node\\Stmt\\Else_
17 public function __construct(array $stmts = [], array $attributes = []) { argument
19 $this->stmts = $stmts;
H A DFinally_.php9 public array $stmts; variable in PhpParser\\Node\\Stmt\\Finally_
17 public function __construct(array $stmts = [], array $attributes = []) { argument
19 $this->stmts = $stmts;
H A DClassLike.php12 public array $stmts; variable in PhpParser\\Node\\Stmt\\ClassLike
24 foreach ($this->stmts as $stmt) {
37 foreach ($this->stmts as $stmt) {
50 foreach ($this->stmts as $stmt) {
66 foreach ($this->stmts as $stmt) {
85 foreach ($this->stmts as $stmt) {
102 foreach ($this->stmts as $stmt) {
/PHP-Parser/test/code/parser/stmt/
H A Dif.test25 stmts: array(
32 stmts: array(
39 stmts: array(
44 stmts: array(
52 stmts: array(
62 stmts: array(
69 stmts: array(
76 stmts: array(
81 stmts: array(
92 stmts: array(

Completed in 23 milliseconds

12345678