the whole shebang
This commit is contained in:
91
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/ClassTest.php
vendored
Normal file
91
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/ClassTest.php
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
class PHPParser_Tests_Builder_ClassTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected function createClassBuilder($class) {
|
||||
return new PHPParser_Builder_Class($class);
|
||||
}
|
||||
|
||||
public function testExtendsImplements() {
|
||||
$node = $this->createClassBuilder('SomeLogger')
|
||||
->extend('BaseLogger')
|
||||
->implement('Namespaced\Logger', new PHPParser_Node_Name('SomeInterface'))
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Class('SomeLogger', array(
|
||||
'extends' => new PHPParser_Node_Name('BaseLogger'),
|
||||
'implements' => array(
|
||||
new PHPParser_Node_Name('Namespaced\Logger'),
|
||||
new PHPParser_Node_Name('SomeInterface')
|
||||
),
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testAbstract() {
|
||||
$node = $this->createClassBuilder('Test')
|
||||
->makeAbstract()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Class('Test', array(
|
||||
'type' => PHPParser_Node_Stmt_Class::MODIFIER_ABSTRACT
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testFinal() {
|
||||
$node = $this->createClassBuilder('Test')
|
||||
->makeFinal()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Class('Test', array(
|
||||
'type' => PHPParser_Node_Stmt_Class::MODIFIER_FINAL
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testStatementOrder() {
|
||||
$method = new PHPParser_Node_Stmt_ClassMethod('testMethod');
|
||||
$property = new PHPParser_Node_Stmt_Property(
|
||||
PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC,
|
||||
array(new PHPParser_Node_Stmt_PropertyProperty('testProperty'))
|
||||
);
|
||||
$const = new PHPParser_Node_Stmt_ClassConst(array(
|
||||
new PHPParser_Node_Const('TEST_CONST', new PHPParser_Node_Scalar_String('ABC'))
|
||||
));
|
||||
$use = new PHPParser_Node_Stmt_TraitUse(array(new PHPParser_Node_Name('SomeTrait')));
|
||||
|
||||
$node = $this->createClassBuilder('Test')
|
||||
->addStmt($method)
|
||||
->addStmt($property)
|
||||
->addStmts(array($const, $use))
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Class('Test', array(
|
||||
'stmts' => array($use, $const, $property, $method)
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
* @expectedExceptionMessage Unexpected node of type "Stmt_Echo"
|
||||
*/
|
||||
public function testInvalidStmtError() {
|
||||
$this->createClassBuilder('Test')
|
||||
->addStmt(new PHPParser_Node_Stmt_Echo(array()))
|
||||
;
|
||||
}
|
||||
}
|
70
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/FunctionTest.php
vendored
Normal file
70
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/FunctionTest.php
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
class PHPParser_Tests_Builder_FunctionTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function createFunctionBuilder($name) {
|
||||
return new PHPParser_Builder_Function($name);
|
||||
}
|
||||
|
||||
public function testReturnByRef() {
|
||||
$node = $this->createFunctionBuilder('test')
|
||||
->makeReturnByRef()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Function('test', array(
|
||||
'byRef' => true
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testParams() {
|
||||
$param1 = new PHPParser_Node_Param('test1');
|
||||
$param2 = new PHPParser_Node_Param('test2');
|
||||
$param3 = new PHPParser_Node_Param('test3');
|
||||
|
||||
$node = $this->createFunctionBuilder('test')
|
||||
->addParam($param1)
|
||||
->addParams(array($param2, $param3))
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Function('test', array(
|
||||
'params' => array($param1, $param2, $param3)
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testStmts() {
|
||||
$stmt1 = new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test1'));
|
||||
$stmt2 = new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test2'));
|
||||
$stmt3 = new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test3'));
|
||||
|
||||
$node = $this->createFunctionBuilder('test')
|
||||
->addStmt($stmt1)
|
||||
->addStmts(array($stmt2, $stmt3))
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Function('test', array(
|
||||
'stmts' => array($stmt1, $stmt2, $stmt3)
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
* @expectedExceptionMessage Expected parameter node, got "Name"
|
||||
*/
|
||||
public function testInvalidParamError() {
|
||||
$this->createFunctionBuilder('test')
|
||||
->addParam(new PHPParser_Node_Name('foo'))
|
||||
;
|
||||
}
|
||||
}
|
91
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/InterfaceTest.php
vendored
Normal file
91
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/InterfaceTest.php
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This class unit-tests the interface builder
|
||||
*/
|
||||
class PHPParser_Tests_Builder_InterfaceTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** @var PHPParser_Builder_Interface */
|
||||
protected $builder;
|
||||
|
||||
protected function setUp() {
|
||||
$this->builder = new PHPParser_Builder_Interface('Contract');
|
||||
}
|
||||
|
||||
private function dump($node) {
|
||||
$pp = new PHPParser_PrettyPrinter_Default();
|
||||
return $pp->prettyPrint(array($node));
|
||||
}
|
||||
|
||||
public function testEmpty() {
|
||||
$contract = $this->builder->getNode();
|
||||
$this->assertInstanceOf('PHPParser_Node_Stmt_Interface', $contract);
|
||||
$this->assertEquals('Contract', $contract->name);
|
||||
}
|
||||
|
||||
public function testExtending() {
|
||||
$contract = $this->builder->extend('Space\Root1', 'Root2')->getNode();
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Interface('Contract', array(
|
||||
'extends' => array(
|
||||
new PHPParser_Node_Name('Space\Root1'),
|
||||
new PHPParser_Node_Name('Root2')
|
||||
),
|
||||
)), $contract
|
||||
);
|
||||
}
|
||||
|
||||
public function testAddMethod() {
|
||||
$method = new PHPParser_Node_Stmt_ClassMethod('doSomething');
|
||||
$contract = $this->builder->addStmt($method)->getNode();
|
||||
$this->assertEquals(array($method), $contract->stmts);
|
||||
}
|
||||
|
||||
public function testAddConst() {
|
||||
$const = new PHPParser_Node_Stmt_ClassConst(array(
|
||||
new PHPParser_Node_Const('SPEED_OF_LIGHT', new PHPParser_Node_Scalar_DNumber(299792458))
|
||||
));
|
||||
$contract = $this->builder->addStmt($const)->getNode();
|
||||
$this->assertEquals(299792458, $contract->stmts[0]->consts[0]->value->value);
|
||||
}
|
||||
|
||||
public function testOrder() {
|
||||
$const = new PHPParser_Node_Stmt_ClassConst(array(
|
||||
new PHPParser_Node_Const('SPEED_OF_LIGHT', new PHPParser_Node_Scalar_DNumber(299792458))
|
||||
));
|
||||
$method = new PHPParser_Node_Stmt_ClassMethod('doSomething');
|
||||
$contract = $this->builder
|
||||
->addStmt($method)
|
||||
->addStmt($const)
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertInstanceOf('PHPParser_Node_Stmt_ClassConst', $contract->stmts[0]);
|
||||
$this->assertInstanceOf('PHPParser_Node_Stmt_ClassMethod', $contract->stmts[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
* @expectedExceptionMessage Unexpected node of type "Stmt_PropertyProperty"
|
||||
*/
|
||||
public function testInvalidStmtError() {
|
||||
$this->builder->addStmt(new PHPParser_Node_Stmt_PropertyProperty('invalid'));
|
||||
}
|
||||
|
||||
public function testFullFunctional() {
|
||||
$const = new PHPParser_Node_Stmt_ClassConst(array(
|
||||
new PHPParser_Node_Const('SPEED_OF_LIGHT', new PHPParser_Node_Scalar_DNumber(299792458))
|
||||
));
|
||||
$method = new PHPParser_Node_Stmt_ClassMethod('doSomething');
|
||||
$contract = $this->builder
|
||||
->addStmt($method)
|
||||
->addStmt($const)
|
||||
->getNode()
|
||||
;
|
||||
|
||||
eval($this->dump($contract));
|
||||
|
||||
$this->assertTrue(interface_exists('Contract', false));
|
||||
}
|
||||
}
|
||||
|
137
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/MethodTest.php
vendored
Normal file
137
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/MethodTest.php
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
class PHPParser_Tests_Builder_MethodTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function createMethodBuilder($name) {
|
||||
return new PHPParser_Builder_Method($name);
|
||||
}
|
||||
|
||||
public function testModifiers() {
|
||||
$node = $this->createMethodBuilder('test')
|
||||
->makePublic()
|
||||
->makeAbstract()
|
||||
->makeStatic()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_ClassMethod('test', array(
|
||||
'type' => PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC
|
||||
| PHPParser_Node_Stmt_Class::MODIFIER_ABSTRACT
|
||||
| PHPParser_Node_Stmt_Class::MODIFIER_STATIC,
|
||||
'stmts' => null,
|
||||
)),
|
||||
$node
|
||||
);
|
||||
|
||||
$node = $this->createMethodBuilder('test')
|
||||
->makeProtected()
|
||||
->makeFinal()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_ClassMethod('test', array(
|
||||
'type' => PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED
|
||||
| PHPParser_Node_Stmt_Class::MODIFIER_FINAL
|
||||
)),
|
||||
$node
|
||||
);
|
||||
|
||||
$node = $this->createMethodBuilder('test')
|
||||
->makePrivate()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_ClassMethod('test', array(
|
||||
'type' => PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testReturnByRef() {
|
||||
$node = $this->createMethodBuilder('test')
|
||||
->makeReturnByRef()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_ClassMethod('test', array(
|
||||
'byRef' => true
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testParams() {
|
||||
$param1 = new PHPParser_Node_Param('test1');
|
||||
$param2 = new PHPParser_Node_Param('test2');
|
||||
$param3 = new PHPParser_Node_Param('test3');
|
||||
|
||||
$node = $this->createMethodBuilder('test')
|
||||
->addParam($param1)
|
||||
->addParams(array($param2, $param3))
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_ClassMethod('test', array(
|
||||
'params' => array($param1, $param2, $param3)
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testStmts() {
|
||||
$stmt1 = new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test1'));
|
||||
$stmt2 = new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test2'));
|
||||
$stmt3 = new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test3'));
|
||||
|
||||
$node = $this->createMethodBuilder('test')
|
||||
->addStmt($stmt1)
|
||||
->addStmts(array($stmt2, $stmt3))
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_ClassMethod('test', array(
|
||||
'stmts' => array($stmt1, $stmt2, $stmt3)
|
||||
)),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
* @expectedExceptionMessage Cannot add statements to an abstract method
|
||||
*/
|
||||
public function testAddStmtToAbstractMethodError() {
|
||||
$this->createMethodBuilder('test')
|
||||
->makeAbstract()
|
||||
->addStmt(new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test')))
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
* @expectedExceptionMessage Cannot make method with statements abstract
|
||||
*/
|
||||
public function testMakeMethodWithStmtsAbstractError() {
|
||||
$this->createMethodBuilder('test')
|
||||
->addStmt(new PHPParser_Node_Expr_Print(new PHPParser_Node_Scalar_String('test')))
|
||||
->makeAbstract()
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
* @expectedExceptionMessage Expected parameter node, got "Name"
|
||||
*/
|
||||
public function testInvalidParamError() {
|
||||
$this->createMethodBuilder('test')
|
||||
->addParam(new PHPParser_Node_Name('foo'))
|
||||
;
|
||||
}
|
||||
}
|
118
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/ParamTest.php
vendored
Normal file
118
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/ParamTest.php
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
class PHPParser_Tests_Builder_ParamTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function createParamBuilder($name) {
|
||||
return new PHPParser_Builder_Param($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideTestDefaultValues
|
||||
*/
|
||||
public function testDefaultValues($value, $expectedValueNode) {
|
||||
$node = $this->createParamBuilder('test')
|
||||
->setDefault($value)
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals($expectedValueNode, $node->default);
|
||||
}
|
||||
|
||||
public function provideTestDefaultValues() {
|
||||
return array(
|
||||
array(
|
||||
null,
|
||||
new PHPParser_Node_Expr_ConstFetch(new PHPParser_Node_Name('null'))
|
||||
),
|
||||
array(
|
||||
true,
|
||||
new PHPParser_Node_Expr_ConstFetch(new PHPParser_Node_Name('true'))
|
||||
),
|
||||
array(
|
||||
false,
|
||||
new PHPParser_Node_Expr_ConstFetch(new PHPParser_Node_Name('false'))
|
||||
),
|
||||
array(
|
||||
31415,
|
||||
new PHPParser_Node_Scalar_LNumber(31415)
|
||||
),
|
||||
array(
|
||||
3.1415,
|
||||
new PHPParser_Node_Scalar_DNumber(3.1415)
|
||||
),
|
||||
array(
|
||||
'Hallo World',
|
||||
new PHPParser_Node_Scalar_String('Hallo World')
|
||||
),
|
||||
array(
|
||||
array(1, 2, 3),
|
||||
new PHPParser_Node_Expr_Array(array(
|
||||
new PHPParser_Node_Expr_ArrayItem(new PHPParser_Node_Scalar_LNumber(1)),
|
||||
new PHPParser_Node_Expr_ArrayItem(new PHPParser_Node_Scalar_LNumber(2)),
|
||||
new PHPParser_Node_Expr_ArrayItem(new PHPParser_Node_Scalar_LNumber(3)),
|
||||
))
|
||||
),
|
||||
array(
|
||||
array('foo' => 'bar', 'bar' => 'foo'),
|
||||
new PHPParser_Node_Expr_Array(array(
|
||||
new PHPParser_Node_Expr_ArrayItem(
|
||||
new PHPParser_Node_Scalar_String('bar'),
|
||||
new PHPParser_Node_Scalar_String('foo')
|
||||
),
|
||||
new PHPParser_Node_Expr_ArrayItem(
|
||||
new PHPParser_Node_Scalar_String('foo'),
|
||||
new PHPParser_Node_Scalar_String('bar')
|
||||
),
|
||||
))
|
||||
),
|
||||
array(
|
||||
new PHPParser_Node_Scalar_DirConst,
|
||||
new PHPParser_Node_Scalar_DirConst
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testTypeHints() {
|
||||
$node = $this->createParamBuilder('test')
|
||||
->setTypeHint('array')
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Param('test', null, 'array'),
|
||||
$node
|
||||
);
|
||||
|
||||
$node = $this->createParamBuilder('test')
|
||||
->setTypeHint('callable')
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Param('test', null, 'callable'),
|
||||
$node
|
||||
);
|
||||
|
||||
$node = $this->createParamBuilder('test')
|
||||
->setTypeHint('Some\Class')
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Param('test', null, new PHPParser_Node_Name('Some\Class')),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
public function testByRef() {
|
||||
$node = $this->createParamBuilder('test')
|
||||
->makeByRef()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Param('test', null, null, true),
|
||||
$node
|
||||
);
|
||||
}
|
||||
}
|
123
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/PropertyTest.php
vendored
Normal file
123
vendor/nikic/php-parser/test/PHPParser/Tests/Builder/PropertyTest.php
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
class PHPParser_Tests_Builder_PropertyTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function createPropertyBuilder($name) {
|
||||
return new PHPParser_Builder_Property($name);
|
||||
}
|
||||
|
||||
public function testModifiers() {
|
||||
$node = $this->createPropertyBuilder('test')
|
||||
->makePrivate()
|
||||
->makeStatic()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Property(
|
||||
PHPParser_Node_Stmt_Class::MODIFIER_PRIVATE
|
||||
| PHPParser_Node_Stmt_Class::MODIFIER_STATIC,
|
||||
array(
|
||||
new PHPParser_Node_Stmt_PropertyProperty('test')
|
||||
)
|
||||
),
|
||||
$node
|
||||
);
|
||||
|
||||
$node = $this->createPropertyBuilder('test')
|
||||
->makeProtected()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Property(
|
||||
PHPParser_Node_Stmt_Class::MODIFIER_PROTECTED,
|
||||
array(
|
||||
new PHPParser_Node_Stmt_PropertyProperty('test')
|
||||
)
|
||||
),
|
||||
$node
|
||||
);
|
||||
|
||||
$node = $this->createPropertyBuilder('test')
|
||||
->makePublic()
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals(
|
||||
new PHPParser_Node_Stmt_Property(
|
||||
PHPParser_Node_Stmt_Class::MODIFIER_PUBLIC,
|
||||
array(
|
||||
new PHPParser_Node_Stmt_PropertyProperty('test')
|
||||
)
|
||||
),
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideTestDefaultValues
|
||||
*/
|
||||
public function testDefaultValues($value, $expectedValueNode) {
|
||||
$node = $this->createPropertyBuilder('test')
|
||||
->setDefault($value)
|
||||
->getNode()
|
||||
;
|
||||
|
||||
$this->assertEquals($expectedValueNode, $node->props[0]->default);
|
||||
}
|
||||
|
||||
public function provideTestDefaultValues() {
|
||||
return array(
|
||||
array(
|
||||
null,
|
||||
new PHPParser_Node_Expr_ConstFetch(new PHPParser_Node_Name('null'))
|
||||
),
|
||||
array(
|
||||
true,
|
||||
new PHPParser_Node_Expr_ConstFetch(new PHPParser_Node_Name('true'))
|
||||
),
|
||||
array(
|
||||
false,
|
||||
new PHPParser_Node_Expr_ConstFetch(new PHPParser_Node_Name('false'))
|
||||
),
|
||||
array(
|
||||
31415,
|
||||
new PHPParser_Node_Scalar_LNumber(31415)
|
||||
),
|
||||
array(
|
||||
3.1415,
|
||||
new PHPParser_Node_Scalar_DNumber(3.1415)
|
||||
),
|
||||
array(
|
||||
'Hallo World',
|
||||
new PHPParser_Node_Scalar_String('Hallo World')
|
||||
),
|
||||
array(
|
||||
array(1, 2, 3),
|
||||
new PHPParser_Node_Expr_Array(array(
|
||||
new PHPParser_Node_Expr_ArrayItem(new PHPParser_Node_Scalar_LNumber(1)),
|
||||
new PHPParser_Node_Expr_ArrayItem(new PHPParser_Node_Scalar_LNumber(2)),
|
||||
new PHPParser_Node_Expr_ArrayItem(new PHPParser_Node_Scalar_LNumber(3)),
|
||||
))
|
||||
),
|
||||
array(
|
||||
array('foo' => 'bar', 'bar' => 'foo'),
|
||||
new PHPParser_Node_Expr_Array(array(
|
||||
new PHPParser_Node_Expr_ArrayItem(
|
||||
new PHPParser_Node_Scalar_String('bar'),
|
||||
new PHPParser_Node_Scalar_String('foo')
|
||||
),
|
||||
new PHPParser_Node_Expr_ArrayItem(
|
||||
new PHPParser_Node_Scalar_String('foo'),
|
||||
new PHPParser_Node_Scalar_String('bar')
|
||||
),
|
||||
))
|
||||
),
|
||||
array(
|
||||
new PHPParser_Node_Scalar_DirConst,
|
||||
new PHPParser_Node_Scalar_DirConst
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user