for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Property
*
* @author Alexey Krupskiy <[email protected]>
* @link http://inji.ru/
* @copyright 2015 Alexey Krupskiy
* @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
*/
namespace Inji\CodeGenerator;
class Property extends \Inji\InjiObject {
public $security = 'public';
public $static = false;
public $name = 'property';
public $value = 'value';
public function generate() {
$code = $this->security . ' ';
$code .= $this->static ? 'static ' : '';
$code .= '$' . $this->name . ' = ';
if (is_array($this->value)) {
$code .= \CodeGenerator::genArray($this->value);
} else {
$code .= '"' . str_replace('"', '\"', $this->value) . '";';
}
return $code;