Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7433540
UnaryExpression.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
UnaryExpression.php
View Options
<?php
/**
* This file is part of the Peast package
*
* (c) Marco Marchiò <marco.mm89@gmail.com>
*
* For the full copyright and license information refer to the LICENSE file
* distributed with this source code
*/
namespace
Peast\Syntax\Node
;
/**
* A node that represents a unary expression.
* For example: !a
*
* @author Marco Marchiò <marco.mm89@gmail.com>
*/
class
UnaryExpression
extends
Node
implements
Expression
{
/**
* Map of node properties
*
* @var array
*/
protected
$propertiesMap
=
array
(
"argument"
=>
true
,
"operator"
=>
false
,
"prefix"
=>
false
);
/**
* Expression's operator
*
* @var string
*/
protected
$operator
;
/**
* Prefix flag that is always true since the operator precedes the argument
*
* @var bool
*/
protected
$prefix
=
true
;
/**
* Expression's argument
*
* @var Expression
*/
protected
$argument
;
/**
* Returns the expression's operator
*
* @return string
*/
public
function
getOperator
()
{
return
$this
->
operator
;
}
/**
* Sets the expression's operator
*
* @param string $operator Operator
*
* @return $this
*/
public
function
setOperator
(
$operator
)
{
$this
->
operator
=
$operator
;
return
$this
;
}
/**
* Returns the prefix flag that is always true since the operator precedes
* the argument
*
* @return bool
*/
public
function
getPrefix
()
{
return
$this
->
prefix
;
}
/**
* This method does nothing since the prefix flag is always true for
* unary expressions
*
* @param bool $prefix Prefix flag
*
* @return $this
*
* @codeCoverageIgnore
*/
public
function
setPrefix
(
$prefix
)
{
return
$this
;
}
/**
* Returns the expression's argument
*
* @return Expression
*/
public
function
getArgument
()
{
return
$this
->
argument
;
}
/**
* Sets the expression's argument
*
* @param Expression $argument Argument
*
* @return $this
*/
public
function
setArgument
(
Expression
$argument
)
{
$this
->
argument
=
$argument
;
return
$this
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 11:57 (3 h, 4 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c5/19/a8b371f0400a66a3a4440a34752c
Default Alt Text
UnaryExpression.php (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment