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

Pickup::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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