File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -117,10 +117,13 @@ $response = $smsResource->dispatch($params);
117117use Seven\Api\Resource\Lookup\LookupResource;
118118
119119$lookupResource = new LookupResource($client);
120- $result = $lookupResource->hlr('+491234567890');
120+ $results = $lookupResource->hlr('+491234567890');
121+ $hlr = $results[0];
121122
122- echo "Carrier: " . $result->getCarrier();
123- echo "Country: " . $result->getCountry();
123+ echo "Current Carrier: " . $hlr->getCurrentCarrier()->getName() . "\n";
124+ echo "Country: " . $hlr->getCountryName() . "\n";
125+ echo "Reachable: " . $hlr->getReachable() . "\n";
126+ echo "Ported: " . $hlr->getPorted() . "\n";
124127```
125128
126129### Check account balance
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ class LookupHlr {
77 protected ?string $ countryName ;
88 protected string |false $ countryPrefix ;
99 protected Carrier $ currentCarrier ;
10- protected ?string $ gsmCode ;
10+ protected ?int $ gsmCode ;
1111 protected ?string $ gsmMessage ;
1212 protected string $ internationalFormatNumber ;
1313 protected string $ internationalFormatted ;
@@ -59,7 +59,7 @@ public function getCurrentCarrier(): Carrier {
5959 return $ this ->currentCarrier ;
6060 }
6161
62- public function getGsmCode (): ?string {
62+ public function getGsmCode (): ?int {
6363 return $ this ->gsmCode ;
6464 }
6565
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public function testHlr(): void {
6868 $ this ->assertNotEmpty ($ hlr ->getCountryName ());
6969 $ this ->assertNotEmpty ($ hlr ->getCountryPrefix ());
7070 $ this ->assertCarrier ($ hlr ->getCurrentCarrier ());
71- $ this ->assertIsString ($ hlr ->getGsmCode ());
71+ $ this ->assertIsInt ($ hlr ->getGsmCode ());
7272 $ this ->assertNotEmpty ($ hlr ->getGsmMessage ());
7373 $ this ->assertNotEmpty ($ hlr ->getInternationalFormatNumber ());
7474 $ this ->assertNotEmpty ($ hlr ->getInternationalFormatted ());
@@ -107,7 +107,7 @@ public function testHlrFaulty(): void {
107107 $ this ->assertNull ($ hlr ->getCountryName ());
108108 $ this ->assertFalse ($ hlr ->getCountryPrefix ());
109109 $ this ->assertCarrier ($ hlr ->getCurrentCarrier (), true );
110- $ this ->assertTrue ($ hlr ->getGsmCode () === null || $ hlr ->getGsmCode () === ' 0 ' );
110+ $ this ->assertTrue ($ hlr ->getGsmCode () === null || $ hlr ->getGsmCode () === 0 );
111111 $ this ->assertTrue ($ hlr ->getGsmMessage () === null || is_string ($ hlr ->getGsmMessage ()));
112112 $ this ->assertEmpty ($ hlr ->getInternationalFormatNumber ());
113113 $ this ->assertEmpty ($ hlr ->getInternationalFormatted ());
You can’t perform that action at this time.
0 commit comments