Home
last modified time | relevance | path

Searched refs:Stmt (Results 1 – 25 of 138) sorted by relevance

123456

/PHP-Parser/test/PhpParser/Builder/
H A DUseTest.php7 use PhpParser\Node\Stmt; alias
10 protected function createUseBuilder($name, $type = Stmt\Use_::TYPE_NORMAL) {
16 $this->assertEquals(new Stmt\Use_([
21 $this->assertEquals(new Stmt\Use_([
25 $node = $this->createUseBuilder('foo\bar', Stmt\Use_::TYPE_FUNCTION)->as('foo')->getNode();
26 $this->assertEquals(new Stmt\Use_([
28 ], Stmt\Use_::TYPE_FUNCTION), $node);
30 $node = $this->createUseBuilder('foo\BAR', Stmt\Use_::TYPE_CONSTANT)->as('FOO')->getNode();
31 $this->assertEquals(new Stmt\Use_([
33 ], Stmt\Use_::TYPE_CONSTANT), $node);
H A DTraitTest.php14 use PhpParser\Node\Stmt; alias
15 use PhpParser\Node\Stmt\ClassConst;
16 use PhpParser\Node\Stmt\ClassMethod;
17 use PhpParser\Node\Stmt\Property;
19 use PhpParser\Node\Stmt\TraitUse;
27 $method1 = new Stmt\ClassMethod('test1');
28 $method2 = new Stmt\ClassMethod('test2');
56 ->addStmt(new Stmt\Echo_([]))
66 $trait = new Stmt\Trait_('Foo', [
85 $trait = new Stmt\Trait_('Foo', [
[all …]
H A DTraitUseTest.php6 use PhpParser\Node\Stmt; alias
20 new Stmt\TraitUse([
30 ->with(new Stmt\TraitUseAdaptation\Alias(null, 'foo', null, 'bar'))
36 new Stmt\TraitUse([new Name('SomeTrait')], [
37 new Stmt\TraitUseAdaptation\Alias(null, 'foo', null, 'bar'),
38 new Stmt\TraitUseAdaptation\Alias(null, 'test', null, 'baz')
48 ->with(new Stmt\Echo_([]))
H A DInterfaceTest.php14 use PhpParser\Node\Stmt; alias
28 $this->assertInstanceOf(Stmt\Interface_::class, $contract);
36 new Stmt\Interface_('Contract', [
46 $method = new Stmt\ClassMethod('doSomething');
52 $const = new Stmt\ClassConst([
60 $const = new Stmt\ClassConst([
63 $method = new Stmt\ClassMethod('doSomething');
79 $this->assertEquals(new Stmt\Interface_('Contract', [], [
95 $this->assertEquals(new Stmt\Interface_('Contract', [
107 $const = new Stmt\ClassConst([
[all …]
H A DClassTest.php14 use PhpParser\Node\Stmt; alias
30 new Stmt\Class_('SomeLogger', [
50 new Stmt\Class_('Test', [
64 new Stmt\Class_('Test', [
78 new Stmt\Class_('Test', [
87 $property = new Stmt\Property(
91 $const = new Stmt\ClassConst([
104 new Stmt\Class_('Test', [
122 new Stmt\Class_('Test', [], [
135 new Stmt\Class_('Test', [], [
[all …]
H A DEnumTest.php13 use PhpParser\Node\Stmt; alias
27 new Stmt\Enum_('SomeEnum', [
44 new Stmt\Enum_('Test', [
52 $method = new Stmt\ClassMethod('testMethod');
53 $enumCase = new Stmt\EnumCase(
56 $const = new Stmt\ClassConst([
59 $use = new Stmt\TraitUse([new Name('SomeTrait')]);
69 new Stmt\Enum_('Test', [
87 new Stmt\Enum_('Test', [], [
100 new Stmt\Enum_('Test', [], [
[all …]
H A DMethodTest.php17 use PhpParser\Node\Stmt; alias
33 new Stmt\ClassMethod('test', [
47 new Stmt\ClassMethod('test', [
59 new Stmt\ClassMethod('test', [
73 new Stmt\ClassMethod('test', [
92 new Stmt\ClassMethod('test', [
111 new Stmt\ClassMethod('test', [
113 new Stmt\Expression($stmt1),
114 new Stmt\Expression($stmt2),
115 new Stmt\Expression($stmt3),
[all …]
H A DFunctionTest.php16 use PhpParser\Node\Stmt; alias
30 new Stmt\Function_('test', [
49 new Stmt\Function_('test', [
68 new Stmt\Function_('test', [
70 new Stmt\Expression($stmt1),
71 new Stmt\Expression($stmt2),
72 new Stmt\Expression($stmt3),
84 $this->assertEquals(new Stmt\Function_('test', [], [
100 $this->assertEquals(new Stmt\Function_('attrGroup', [
110 $this->assertEquals(new Stmt\Function_('test', [
H A DNamespaceTest.php7 use PhpParser\Node\Stmt; alias
15 $stmt1 = new Stmt\Class_('SomeClass');
16 $stmt2 = new Stmt\Interface_('SomeInterface');
17 $stmt3 = new Stmt\Function_('someFunction');
19 $expected = new Stmt\Namespace_(
/PHP-Parser/lib/PhpParser/Node/Stmt/
H A DBlock.php3 namespace PhpParser\Node\Stmt;
5 use PhpParser\Node\Stmt; alias
7 class Block extends Stmt {
8 /** @var Stmt[] Statements */
14 * @param Stmt[] $stmts Statements
H A DUse_.php3 namespace PhpParser\Node\Stmt;
5 use PhpParser\Node\Stmt; alias
8 class Use_ extends Stmt {
31 * @param Stmt\Use_::TYPE_* $type Type of alias
H A DHaltCompiler.php3 namespace PhpParser\Node\Stmt;
5 use PhpParser\Node\Stmt; alias
7 class HaltCompiler extends Stmt {
H A DInlineHTML.php3 namespace PhpParser\Node\Stmt;
5 use PhpParser\Node\Stmt; alias
7 class InlineHTML extends Stmt {
H A DStatic_.php3 namespace PhpParser\Node\Stmt;
6 use PhpParser\Node\Stmt; alias
8 class Static_ extends Stmt {
/PHP-Parser/lib/PhpParser/Builder/
H A DTrait_.php8 use PhpParser\Node\Stmt; alias
35 * @param Stmt|PhpParser\Builder $stmt The statement to add
42 if ($stmt instanceof Stmt\Property) {
44 } elseif ($stmt instanceof Stmt\ClassMethod) {
46 } elseif ($stmt instanceof Stmt\TraitUse) {
48 } elseif ($stmt instanceof Stmt\ClassConst) {
73 * @return Stmt\Trait_ The built interface node
76 return new Stmt\Trait_(
H A DTraitUse.php8 use PhpParser\Node\Stmt; alias
13 /** @var Stmt\TraitUseAdaptation[] */
42 * @param Stmt\TraitUseAdaptation|Builder\TraitUseAdaptation $adaptation Trait adaptation
49 if (!$adaptation instanceof Stmt\TraitUseAdaptation) {
63 return new Stmt\TraitUse($this->traits, $this->adaptations);
H A DUse_.php8 use PhpParser\Node\Stmt; alias
12 /** @var Stmt\Use_::TYPE_* */
20 * @param Stmt\Use_::TYPE_* $type One of the Stmt\Use_::TYPE_* constants
42 * @return Stmt\Use_ The built node
45 return new Stmt\Use_([
H A DEnum_.php10 use PhpParser\Node\Stmt; alias
68 * @param Stmt|PhpParser\Builder $stmt The statement to add
75 if ($stmt instanceof Stmt\EnumCase) {
77 } elseif ($stmt instanceof Stmt\ClassMethod) {
79 } elseif ($stmt instanceof Stmt\TraitUse) {
81 } elseif ($stmt instanceof Stmt\ClassConst) {
106 * @return Stmt\Enum_ The built enum node
109 return new Stmt\Enum_($this->name, [
H A DInterface_.php9 use PhpParser\Node\Stmt; alias
49 * @param Stmt|PhpParser\Builder $stmt The statement to add
56 if ($stmt instanceof Stmt\ClassConst) {
58 } elseif ($stmt instanceof Stmt\ClassMethod) {
85 * @return Stmt\Interface_ The built interface node
88 return new Stmt\Interface_($this->name, [
H A DClass_.php10 use PhpParser\Node\Stmt; alias
102 * @param Stmt|PhpParser\Builder $stmt The statement to add
109 if ($stmt instanceof Stmt\Property) {
111 } elseif ($stmt instanceof Stmt\ClassMethod) {
113 } elseif ($stmt instanceof Stmt\TraitUse) {
115 } elseif ($stmt instanceof Stmt\ClassConst) {
140 * @return Stmt\Class_ The built class node
143 return new Stmt\Class_($this->name, [
H A DNamespace_.php8 use PhpParser\Node\Stmt; alias
12 /** @var Stmt[] */
40 * @return Stmt\Namespace_ The built node
43 return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes);
/PHP-Parser/lib/PhpParser/
H A DNameContext.php7 use PhpParser\Node\Stmt; alias
41 Stmt\Use_::TYPE_NORMAL => [],
42 Stmt\Use_::TYPE_FUNCTION => [],
43 Stmt\Use_::TYPE_CONSTANT => [],
57 if ($type === Stmt\Use_::TYPE_CONSTANT) {
65 Stmt\Use_::TYPE_NORMAL => '',
66 Stmt\Use_::TYPE_FUNCTION => 'function ',
67 Stmt\Use_::TYPE_CONSTANT => 'const ',
159 if ($type === Stmt\Use_::TYPE_NORMAL) {
187 if ($type === Stmt\Use_::TYPE_CONSTANT) {
[all …]
/PHP-Parser/lib/PhpParser/NodeVisitor/
H A DNameResolver.php11 use PhpParser\Node\Stmt; alias
56 if ($node instanceof Stmt\Namespace_) {
58 } elseif ($node instanceof Stmt\Use_) {
62 } elseif ($node instanceof Stmt\GroupUse) {
66 } elseif ($node instanceof Stmt\Class_) {
88 } elseif ($node instanceof Stmt\Enum_) {
95 } elseif ($node instanceof Stmt\Trait_) {
102 } elseif ($node instanceof Stmt\ClassMethod
119 } elseif ($node instanceof Stmt\Const_) {
139 } elseif ($node instanceof Stmt\Catch_) {
[all …]
/PHP-Parser/test/PhpParser/NodeVisitor/
H A DNameResolverTest.php9 use PhpParser\Node\Stmt; alias
366 new Stmt\Class_('A'),
367 new Stmt\Interface_('B'),
368 new Stmt\Function_('C'),
369 new Stmt\Const_([
372 new Stmt\Trait_('E'),
374 new Stmt\Enum_('F'),
405 new Stmt\Namespace_(null, [
437 new Stmt\Use_([
444 new Stmt\Use_([
[all …]
/PHP-Parser/test/code/formatPreservation/
H A DmodifierChange.test16 $stmts[0]->flags = Stmt\Class_::MODIFIER_ABSTRACT;
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;
47 $stmts[0]->params[2]->flags = Stmt\Class_::MODIFIER_PUBLIC;

Completed in 36 milliseconds

123456