Completed
Push — master ( 83ff7f...5810d6 )
by Nicholas
01:05
created

Pickup   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 1 1
A carrierPickupAvailability() 0 16 1
1
<?php
2
3
namespace Nickcheek\USPSLookup\Service;
4
5
use Nickcheek\USPSLookup\USPSLookup;
6
7
class Pickup extends USPSLookup
8
{
9
    public function __construct(){}
10
11
    public function carrierPickupAvailability($firm,$address,$apt,$city,$state,$zip5,$zip4)
12
    {
13
        $carrier = new \SimpleXMLElement('<CarrierPickupAvailabilityRequest></CarrierPickupAvailabilityRequest>');
14
        $carrier->addAttribute('USERID', self::$user);
15
        $carrier->addChild('FirmName' , $firm);
16
        $carrier->addChild('SuiteOrApt' , $apt);
17
        $carrier->addChild('Address2', $address);
18
        $carrier->addChild('Urbanization');
19
        $carrier->addChild('City',$city);
20
        $carrier->addChild('State',$state);
21
        $carrier->addChild('ZIP5',$zip5);
22
        $carrier->addChild('ZIP4',$zip4);
23
        $url = self::$service . 'CarrierPickupAvailability&XML='.$carrier->asXML();
24
        return simplexml_load_file($url);
25
26
    }
27
}
28