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

Address::ZipCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
3
namespace Nickcheek\USPSLookup\Service;
4
5
use Nickcheek\USPSLookup\USPSLookup;
6
7
class Address extends USPSLookup
8
{
9
    public function __construct(){}
10
11
    public static function Verify($address,$address2,$city,$state,$zip)
12
    {
13
        $Address = new \SimpleXMLElement("<AddressValidateRequest></AddressValidateRequest>");
14
        $Address->addAttribute('USERID', self::$user);
15
        $Revision = $Address->addChild('Revision','1');
0 ignored issues
show
Unused Code introduced by
$Revision is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
16
        $add = $Address->addChild('Address');
17
        $add->addAttribute('ID', '0');
18
        $a1 = $add->addChild('Address1',$address);
0 ignored issues
show
Unused Code introduced by
$a1 is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
19
        $a2 = $add->addChild('Address2',$address2);
0 ignored issues
show
Unused Code introduced by
$a2 is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
20
        $c = $add->addChild('City',$city);
0 ignored issues
show
Unused Code introduced by
$c is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
21
        $s = $add->addChild('State',$state);
0 ignored issues
show
Unused Code introduced by
$s is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
22
        $z1  = $add->addChild('Zip5',$zip);
0 ignored issues
show
Unused Code introduced by
$z1 is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
23
        $z2  = $add->addChild('Zip4');
0 ignored issues
show
Unused Code introduced by
$z2 is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
24
        $url = self::$service . 'Verify&XML='.$Address->asXML();
25
        $response = simplexml_load_file($url);
26
        return $response;
27
    }
28
29
    public static function CityState($zip)
30
    {
31
        $CityState = new \SimpleXMLElement("<CityStateLookupRequest></CityStateLookupRequest>");
32
        $CityState->addAttribute('USERID', self::$user);
33
        $ZipCode = $CityState->addChild('ZipCode');
34
        $ZipCode->addAttribute('ID', '0');
35
        $Zip  = $ZipCode->addChild('Zip5',$zip);
0 ignored issues
show
Unused Code introduced by
$Zip is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
36
        $url = self::$service.'CityStateLookup&XML='.$CityState->asXML();
37
        $response = simplexml_load_file($url);
38
        return $response;
39
    }
40
41
    public static function CityStateMultiple($zip)
42
    {
43
        $CityState = new \SimpleXMLElement("<CityStateLookupRequest></CityStateLookupRequest>");
44
        $CityState->addAttribute('USERID', self::$user);
45
46
        foreach($zip as $k=>$z){
47
            $ZipCode = $CityState->addChild('ZipCode');
48
            $ZipCode->addAttribute('ID', $k);
49
            $Zip  = $ZipCode->addChild('Zip5',$z);
0 ignored issues
show
Unused Code introduced by
$Zip is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
50
        }
51
52
        $url = self::$service . 'CityStateLookup&XML='.$CityState->asXML();
53
        $response = simplexml_load_file($url);
54
        return $response;
55
    }
56
57
    public static function ZipCode($address,$address2,$city,$state)
58
    {
59
        $Address = new \SimpleXMLElement("<ZipCodeLookupRequest></ZipCodeLookupRequest>");
60
        $Address->addAttribute('USERID', self::$user);
61
        $add = $Address->addChild('Address');
62
        $add->addAttribute('ID', '0');
63
        $a1 = $add->addChild('Address1',$address);
0 ignored issues
show
Unused Code introduced by
$a1 is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
64
        $a2 = $add->addChild('Address2',$address2);
0 ignored issues
show
Unused Code introduced by
$a2 is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
65
        $c = $add->addChild('City',$city);
0 ignored issues
show
Unused Code introduced by
$c is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
66
        $s = $add->addChild('State',$state);
0 ignored issues
show
Unused Code introduced by
$s is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
67
        $url = self::$service . 'ZipCodeLookup&XML='.$Address->asXML();
68
        $response = simplexml_load_file($url);
69
        return $response;
70
    }
71
}
72