Expression::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Recca0120\Repository;
4
5
use Illuminate\Database\Query\Expression as QueryExpression;
6
7
class Expression extends QueryExpression
8
{
9
    /**
10
     * The value of the expression.
11
     *
12
     * @var mixed
13
     */
14
    protected $value;
15
16
    /**
17
     * Create a new raw query expression.
18
     *
19
     * @param  mixed  $value
20
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
21
     */
22 3
    public function __construct($value)
23
    {
24 3
        $this->value = $value;
25 3
    }
26
27
    /**
28
     * Get the value of the expression.
29
     *
30
     * @return string
31
     */
32 1
    public function __toString()
33
    {
34 1
        return (string) $this->getValue();
35
    }
36
37
    /**
38
     * Get the value of the expression.
39
     *
40
     * @return mixed
41
     */
42 3
    public function getValue()
43
    {
44 3
        return $this->value;
45
    }
46
}
47