Completed
Push — master ( 3560db...6e658b )
by
unknown
08:14
created

ContactEmailDeleteValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 4 2
1
<?php
2
3
namespace OroCRM\Bundle\ContactBundle\Validator;
4
5
use OroCRM\Bundle\ContactBundle\Entity\ContactEmail;
6
7
class ContactEmailDeleteValidator
8
{
9
    /**
10
     * {@inheritdoc}
11
     *
12
     * @param ContactEmail $value
13
     */
14
    public function validate(ContactEmail $value)
15
    {
16
        return $value->isPrimary() && $value->getOwner()->getEmails()->count() === 1;
17
    }
18
}
19