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

B2bCustomerPhoneDeleteValidator::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 1
1
<?php
2
3
namespace OroCRM\Bundle\SalesBundle\Validator;
4
5
use OroCRM\Bundle\SalesBundle\Entity\B2bCustomerPhone;
6
7
class B2bCustomerPhoneDeleteValidator
8
{
9
    /**
10
     * {@inheritdoc}
11
     *
12
     * @param B2bCustomerPhone $value
13
     */
14
    public function validate(B2bCustomerPhone $value)
15
    {
16
        return $value->isPrimary() && $value->getOwner()->getPhones()->count() === 1;
17
    }
18
}
19