Expression   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 4 1
A getValue() 0 4 1
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