@@ -29,17 +29,18 @@ class PhpConstant extends AbstractModel implements GenerateableInterface, Docblo
2929 *
3030 * @param string $name
3131 * @param mixed $value
32+ * @param bool $isExpression
3233 * @return static
3334 */
34- public static function create ($ name = null , $ value = null ) {
35- $ constant = new static ();
36- $ constant ->setName ($ name );
35+ public static function create ($ name = null , $ value = null , $ isExpression = false ) {
36+ $ constant = new static ($ name , $ value , $ isExpression );
37+ // $constant->setName($name);
3738
38- if (is_string ($ value )) {
39- $ constant ->setValue ($ value );
40- } else {
41- $ constant ->setExpression ($ value );
42- }
39+ // if (is_string($value)) {
40+ // $constant->setValue($value);
41+ // } else {
42+ // $constant->setExpression($value);
43+ // }
4344
4445return $ constant ;
4546}
@@ -49,14 +50,15 @@ public static function create($name = null, $value = null) {
4950 *
5051 * @param string $name
5152 * @param mixed $value
53+ * @param bool $isExpression
5254 */
53- public function __construct ($ name = null , $ value = null ) {
55+ public function __construct ($ name = null , $ value = null , $ isExpression = false ) {
5456$ this ->setName ($ name );
5557
56- if (is_string ($ value )) {
57- $ this ->setValue ($ value );
58- } else {
58+ if ($ isExpression ) {
5959$ this ->setExpression ($ value );
60+ } else {
61+ $ this ->setValue ($ value );
6062}
6163$ this ->docblock = new Docblock ();
6264}
0 commit comments