Completed
Push — master ( ca4bd4...d89b8a )
by Mauro
03:26
created

Email   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEmail() 0 4 1
A setEmail() 0 4 1
1
<?php
2
/*
3
 * This file is part of the La Voz Feed Generator package.
4
 *
5
 * (c) Zephia <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Zephia\LaVozFeed\Entity;
12
13
/**
14
 * Class Email
15
 *
16
 * @package Zephia\LaVozFeed\Entity
17
 * @author  Mauro Moreno <[email protected]>
18
 */
19
class Email extends ContactMethod
20
{
21
    /**
22
     * @var string
23
     */
24
    const ATTRIBUTE = 'email';
25
26
    /**
27
     * Get Email
28
     *
29
     * @return string
30
     */
31
    public function getEmail()
32
    {
33
        return parent::getValue();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getValue() instead of getEmail()). Are you sure this is correct? If so, you might want to change this to $this->getValue().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
34
    }
35
36
    /**
37
     * Set Email
38
     *
39
     * @param string $email
40
     *
41
     * @return ContactMethod
42
     */
43
    public function setEmail($email)
44
    {
45
        return parent::setValue($email);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (setValue() instead of setEmail()). Are you sure this is correct? If so, you might want to change this to $this->setValue().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
46
    }
47
}
48