Skip to content

Commit 43a5f72

Browse files
committed
Add option to print request and response
1 parent 56dea02 commit 43a5f72

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

src/NMB2BClient.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
class NMB2BClient
2929
{
3030

31+
private $verbose = false;
32+
3133
private $airspaceServices;
3234
private $flowServices;
3335

@@ -112,4 +114,10 @@ public function flowServices() : FlowServices
112114
}
113115
return $this->flowServices;
114116
}
117+
118+
public function setVerbose($verbose)
119+
{
120+
$this->verbose = $verbose;
121+
}
122+
115123
}

src/Services/AirspaceServices.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public function retrieveEAUPChain(\DateTime $chainDate): EAUPChain
4141
);
4242

4343
$this->getSoapClient()->retrieveEAUPChain($params);
44-
44+
45+
if($this->isVerbose()) {
46+
print_r($this->getFullErrorMessage());
47+
}
48+
4549
return new EAUPChain($this->getSoapClient()->__getLastResponse());
4650
}
4751

@@ -69,6 +73,10 @@ public function retrieveEAUPRSAs($designators, \DateTime $date, $sequenceNumber)
6973

7074
$this->getSoapClient()->retrieveEAUPRSAs($params);
7175

76+
if($this->isVerbose()) {
77+
print_r($this->getFullErrorMessage());
78+
}
79+
7280
return new EAUPRSAs($this->getSoapClient()->__getLastResponse(), $this->getNMVersionFloat());
7381
}
7482
}

src/Services/FlowServices.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public function queryRegulations(\DateTime $start, \DateTime $end, $regex = "LF*
5656

5757
$this->getSoapClient()->queryRegulations($params);
5858

59+
if($this->isVerbose()) {
60+
print_r($this->getFullErrorMessage());
61+
}
62+
5963
return new RegulationListReply($this->getSoapClient()->__getLastResponse());
6064
}
6165
}

src/Services/Service.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ class Service {
2626

2727
private $versionFloat;
2828

29+
private $verbose = false;
2930

30-
public function __construct($wsdl, $options)
31+
public function __construct($wsdl, $options, $verbose)
3132
{
3233
$this->client = new \SoapClient($wsdl, $options);
3334
$this->extractNMVersion($wsdl);
@@ -81,4 +82,15 @@ public function getNMVersion() : string
8182
public function getNMVersionFloat() : float {
8283
return $this->versionFloat;
8384
}
85+
86+
public function setVerbose($verbose)
87+
{
88+
$this->verbose = $verbose;
89+
}
90+
91+
public function isVerbose()
92+
{
93+
return $this->verbose;
94+
}
95+
8496
}

0 commit comments

Comments
 (0)