Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7398430
FunctionLike.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
FunctionLike.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
PhpParser\Builder
;
use
PhpParser\BuilderHelpers
;
use
PhpParser\Node
;
abstract
class
FunctionLike
extends
Declaration
{
protected
$returnByRef
=
false
;
protected
$params
=
[];
/** @var string|Node\Name|Node\NullableType|null */
protected
$returnType
=
null
;
/**
* Make the function return by reference.
*
* @return $this The builder instance (for fluid interface)
*/
public
function
makeReturnByRef
()
{
$this
->
returnByRef
=
true
;
return
$this
;
}
/**
* Adds a parameter.
*
* @param Node\Param|Param $param The parameter to add
*
* @return $this The builder instance (for fluid interface)
*/
public
function
addParam
(
$param
)
{
$param
=
BuilderHelpers
::
normalizeNode
(
$param
);
if
(!
$param
instanceof
Node\Param
)
{
throw
new
\LogicException
(
sprintf
(
'Expected parameter node, got "%s"'
,
$param
->
getType
()));
}
$this
->
params
[]
=
$param
;
return
$this
;
}
/**
* Adds multiple parameters.
*
* @param array $params The parameters to add
*
* @return $this The builder instance (for fluid interface)
*/
public
function
addParams
(
array
$params
)
{
foreach
(
$params
as
$param
)
{
$this
->
addParam
(
$param
);
}
return
$this
;
}
/**
* Sets the return type for PHP 7.
*
* @param string|Node\Name|Node\Identifier|Node\ComplexType $type
*
* @return $this The builder instance (for fluid interface)
*/
public
function
setReturnType
(
$type
)
{
$this
->
returnType
=
BuilderHelpers
::
normalizeType
(
$type
);
return
$this
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 15:17 (2 h, 22 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ed/73/0784deba3ac3944fd45923fd962e
Default Alt Text
FunctionLike.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment