-
Notifications
You must be signed in to change notification settings - Fork 0
/
Expression.php
61 lines (53 loc) · 1.08 KB
/
Expression.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* Copyright (c) 2018 Webbing Brasil (http://www.webbingbrasil.com.br)
* All Rights Reserved
*
* This file is part of the NomadLog Portal project.
*
* @project NomadLog Portal
* @file Expression.php
* @author Danilo Andrade <danilo@webbingbrasil.com.br>
* @date 06/03/18 at 18:09
* @copyright Copyright (c) 2018 Webbing Brasil (http://www.webbingbrasil.com.br)
*/
namespace App\MathParser;
use App\MathParser\Contracts\ExpressionContract;
/**
* Class Expression
* @package App\MathParser
*/
abstract class Expression implements ExpressionContract
{
/**
* @var string|Stack
*/
protected $value = '';
/**
* Expression constructor.
*
* @param $value
*/
public function __construct($value=null)
{
$this->value = $value;
}
/**
* @return string
*/
public function render()
{
return $this->value;
}
/**
* @return int
*/
public function getValue()
{
return $this->value;
}
public function __toString()
{
return $this->value;
}
}