for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* For licensing information, please see the LICENSE file accompanied with this file.
*
* @author Gerard van Helden <[email protected]>
* @copyright 2012 Gerard van Helden <http://melp.nl>
*/
namespace Zicht\Tool\Script\Node\Expr\Op;
use Zicht\Tool\Script\Node\Branch;
use Zicht\Tool\Script\Node\Node;
use Zicht\Tool\Script\Buffer;
* Represents a unary expression
class Unary extends Branch
{
* Constructor.
* @param string $operator
* @param Node $subject
public function __construct($operator, $subject)
parent::__construct();
$this->operator = $operator;
operator
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->nodes[0] = $subject;
}
* @{inheritDoc}
public function compile(Buffer $buffer)
$buffer->raw($this->operator);
$this->nodes[0]->compile($buffer);
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: