Lines Matching refs:stmts
168 $stmts = $this->parseAndResolve($code);
172 $prettyPrinter->prettyPrint($stmts)
347 $stmts = $this->parseAndResolve($code);
351 $prettyPrinter->prettyPrint($stmts)
356 $stmts = [new Node\Expr\New_(new Name('self'))];
361 $this->assertEquals($stmts, $traverser->traverse($stmts));
380 $stmts = $traverser->traverse([new Stmt\Namespace_(new Name('NS'), $nsStmts)]);
381 $this->assertSame('NS\\A', (string) $stmts[0]->stmts[0]->namespacedName);
382 $this->assertSame('NS\\B', (string) $stmts[0]->stmts[1]->namespacedName);
383 $this->assertSame('NS\\C', (string) $stmts[0]->stmts[2]->namespacedName);
384 $this->assertSame('NS\\D', (string) $stmts[0]->stmts[3]->consts[0]->namespacedName);
385 $this->assertSame('NS\\E', (string) $stmts[0]->stmts[4]->namespacedName);
386 $this->assertNull($stmts[0]->stmts[5]->class->namespacedName);
387 $this->assertSame('NS\\F', (string) $stmts[0]->stmts[6]->namespacedName);
389 $stmts = $traverser->traverse([new Stmt\Namespace_(null, $nsStmts)]);
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);
393 $this->assertSame('D', (string) $stmts[0]->stmts[3]->consts[0]->namespacedName);
394 $this->assertSame('E', (string) $stmts[0]->stmts[4]->namespacedName);
395 $this->assertNull($stmts[0]->stmts[5]->class->namespacedName);
396 $this->assertSame('F', (string) $stmts[0]->stmts[6]->namespacedName);
400 $stmts = [
413 $stmts = $traverser->traverse($stmts);
415 … $this->assertSame('NS\\foo', (string) $stmts[0]->stmts[0]->name->getAttribute('namespacedName'));
416 … $this->assertSame('NS\\FOO', (string) $stmts[0]->stmts[1]->name->getAttribute('namespacedName'));
418 $this->assertFalse($stmts[1]->stmts[0]->name->hasAttribute('namespacedName'));
419 $this->assertFalse($stmts[1]->stmts[1]->name->hasAttribute('namespacedName'));
485 $stmts = $parser->parse($source);
490 $stmts = $traverser->traverse($stmts);
491 $stmt = $stmts[0];
493 $assign = $stmt->stmts[1]->expr;
514 $stmts = $parser->parse($source);
519 $stmts = $traverser->traverse($stmts);
520 $classStmt = $stmts[0];
521 $methodStmt = $classStmt->stmts[0]->stmts[0];
523 $this->assertSame('SELF', (string) $methodStmt->stmts[0]->expr->class);
524 $this->assertSame('PARENT', (string) $methodStmt->stmts[1]->expr->class);
525 $this->assertSame('STATIC', (string) $methodStmt->stmts[2]->expr->class);
541 $stmts = $traverser->traverse($origStmts);
543 $this->assertSame($n1, $stmts[0]->stmts[0]->class->getAttribute('originalName'));
544 $this->assertSame($n2, $stmts[0]->stmts[1]->name->getAttribute('originalName'));
574 $stmts = $parser->parse($code);
575 return $traverser->traverse($stmts);