mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-26 20:14:46 +01:00
Add useFunction() and useConst() builder methods
This commit is contained in:
parent
bd088dc940
commit
53c732a96d
@ -104,7 +104,7 @@ class BuilderFactory
|
||||
/**
|
||||
* Creates a namespace/class use builder.
|
||||
*
|
||||
* @param string|Node\Name $name Name to alias
|
||||
* @param Node\Name|string $name Name of the entity (namespace or class) to alias
|
||||
*
|
||||
* @return Builder\Use_ The create use builder
|
||||
*/
|
||||
@ -112,6 +112,28 @@ class BuilderFactory
|
||||
return new Builder\Use_($name, Use_::TYPE_NORMAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function use builder.
|
||||
*
|
||||
* @param Node\Name|string $name Name of the function to alias
|
||||
*
|
||||
* @return Builder\Use_ The create use builder
|
||||
*/
|
||||
public function useFunction($name) : Builder\Use_ {
|
||||
return new Builder\Use_($name, Use_::TYPE_FUNCTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a constant use builder.
|
||||
*
|
||||
* @param Node\Name|string $name Name of the const to alias
|
||||
*
|
||||
* @return Builder\Use_ The create use builder
|
||||
*/
|
||||
public function useConst($name) : Builder\Use_ {
|
||||
return new Builder\Use_($name, Use_::TYPE_CONSTANT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates node a for a literal value.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user