Completed
Push — master ( a18731...e2e070 )
by
unknown
99:54 queued 47:45
created

B2bCustomerEmailDeleteValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

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