mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-07-24 15:51:32 +02:00
Implicit public should not generate as explicit public
This commit is contained in:
committed by
Nikita Popov
parent
c96636d192
commit
73cace360d
@@ -9,6 +9,7 @@ abstract class A {
|
||||
final function d() {}
|
||||
static function e() {}
|
||||
final static function f() {}
|
||||
function g() {}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
@@ -20,7 +21,7 @@ array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
type: 1
|
||||
type: 0
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: a
|
||||
@@ -29,7 +30,7 @@ array(
|
||||
)
|
||||
)
|
||||
1: Stmt_Property(
|
||||
type: 9
|
||||
type: 8
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: b
|
||||
@@ -38,7 +39,7 @@ array(
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassMethod(
|
||||
type: 17
|
||||
type: 16
|
||||
byRef: false
|
||||
name: c
|
||||
params: array(
|
||||
@@ -46,7 +47,7 @@ array(
|
||||
stmts: null
|
||||
)
|
||||
3: Stmt_ClassMethod(
|
||||
type: 33
|
||||
type: 32
|
||||
byRef: false
|
||||
name: d
|
||||
params: array(
|
||||
@@ -55,7 +56,7 @@ array(
|
||||
)
|
||||
)
|
||||
4: Stmt_ClassMethod(
|
||||
type: 9
|
||||
type: 8
|
||||
byRef: false
|
||||
name: e
|
||||
params: array(
|
||||
@@ -64,7 +65,7 @@ array(
|
||||
)
|
||||
)
|
||||
5: Stmt_ClassMethod(
|
||||
type: 41
|
||||
type: 40
|
||||
byRef: false
|
||||
name: f
|
||||
params: array(
|
||||
@@ -72,6 +73,15 @@ array(
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
6: Stmt_ClassMethod(
|
||||
type: 0
|
||||
byRef: false
|
||||
name: g
|
||||
params: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@@ -5,6 +5,7 @@ PHP 4 style declarations
|
||||
class A {
|
||||
var $foo;
|
||||
function bar() {}
|
||||
static abstract function baz() {}
|
||||
}
|
||||
-----
|
||||
array(
|
||||
@@ -16,7 +17,7 @@ array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
type: 1
|
||||
type: 0
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: foo
|
||||
@@ -25,7 +26,7 @@ array(
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassMethod(
|
||||
type: 1
|
||||
type: 0
|
||||
byRef: false
|
||||
name: bar
|
||||
params: array(
|
||||
@@ -33,6 +34,15 @@ array(
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassMethod(
|
||||
type: 24
|
||||
byRef: false
|
||||
name: baz
|
||||
params: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
40
test/code/prettyPrinter/class.test
Normal file
40
test/code/prettyPrinter/class.test
Normal file
@@ -0,0 +1,40 @@
|
||||
Class
|
||||
-----
|
||||
<?php
|
||||
|
||||
class Foo
|
||||
{
|
||||
var $a = 'foo';
|
||||
private $b = 'bar';
|
||||
static $c = 'baz';
|
||||
function test()
|
||||
{
|
||||
$this->a = 'bar';
|
||||
echo 'test';
|
||||
}
|
||||
|
||||
protected function baz() {}
|
||||
public function foo() {}
|
||||
abstract static function bar() {}
|
||||
}
|
||||
-----
|
||||
class Foo
|
||||
{
|
||||
var $a = 'foo';
|
||||
private $b = 'bar';
|
||||
static $c = 'baz';
|
||||
function test()
|
||||
{
|
||||
$this->a = 'bar';
|
||||
echo 'test';
|
||||
}
|
||||
protected function baz()
|
||||
{
|
||||
}
|
||||
public function foo()
|
||||
{
|
||||
}
|
||||
static abstract function bar()
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user