DeleteCardRequest::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
ccs 10
cts 10
cp 1
crap 1
rs 9.9666
1
<?php
2
3
namespace Omnipay\Moneris\Message;
4
5
class DeleteCardRequest extends AbstractRequest
6
{
7 6
    public function getData()
8
    {
9 6
        $data = null;
0 ignored issues
show
Unused Code introduced by
The assignment to $data is dead and can be removed.
Loading history...
10 6
        $this->validate('cardReference');
11
12 6
        $request = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><request></request>');
13 6
        $request->addChild('store_id', $this->getMerchantId());
14 6
        $request->addChild('api_token', $this->getMerchantKey());
15
16 6
        $res_delete = $request->addChild('res_delete');
17 6
        $res_delete->addChild('data_key', $this->getCardReference());
18 6
        $data = $request->asXML();
19
20 6
        return preg_replace('/\n/', '', $data);
21
    }
22
}
23