Completed
Pull Request — master (#98)
by Christopher
05:13
created

Email::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\Atom;
4
5
/**
6
 * Class representing Email
7
 */
8 View Code Duplication
class Email
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
11
    /**
12
     * @property string $__value
13
     */
14
    private $__value = null;
15
16
    /**
17
     * Construct
18
     *
19
     * @param string $value
20
     */
21
    public function __construct($value)
22
    {
23
        $this->value($value);
24
    }
25
26
    /**
27
     * Gets or sets the inner value
28
     *
29
     * @param string $value
0 ignored issues
show
Bug introduced by
There is no parameter named $value. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
30
     * @return string
31
     */
32
    public function value()
33
    {
34
        if ($args = func_get_args()) {
35
            $this->__value = $args[0];
36
        }
37
        return $this->__value;
38
    }
39
40
    /**
41
     * Gets a string value
42
     *
43
     * @return string
44
     */
45
    public function __toString()
46
    {
47
        return strval($this->__value);
48
    }
49
}
50