Transfer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A setOperation() 0 9 2
1
<?php
2
3
/**
4
 * This file is part of the php-epp2 library.
5
 *
6
 * (c) Gunter Grodotzki <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE file
9
 * that was distributed with this source code.
10
 */
11
12
namespace AfriCC\EPP\Frame\Command;
13
14
use AfriCC\EPP\Frame\Command as CommandFrame;
15
use Exception;
16
17
/**
18
 * @see http://tools.ietf.org/html/rfc5730#section-2.9.3.4
19
 */
20
abstract class Transfer extends CommandFrame
21
{
22
    public function setOperation($op)
23
    {
24
        if (!in_array($op, ['request', 'cancel', 'approve', 'reject', 'query'])) {
25
            throw new Exception(sprintf('%s is a unknown operation', $op));
26
        }
27
28
        $node = $this->set('//epp:epp/epp:command/epp:transfer');
29
        $node->setAttribute('op', $op);
30
    }
31
}
32