Skip to content

Commit

Permalink
Add option to print request and response
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoSpy committed Feb 22, 2020
1 parent 56dea02 commit 43a5f72
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/NMB2BClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
class NMB2BClient
{

private $verbose = false;

private $airspaceServices;
private $flowServices;

Expand Down Expand Up @@ -112,4 +114,10 @@ public function flowServices() : FlowServices
}
return $this->flowServices;
}

public function setVerbose($verbose)
{
$this->verbose = $verbose;
}

}
10 changes: 9 additions & 1 deletion src/Services/AirspaceServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ public function retrieveEAUPChain(\DateTime $chainDate): EAUPChain
);

$this->getSoapClient()->retrieveEAUPChain($params);


if($this->isVerbose()) {
print_r($this->getFullErrorMessage());
}

return new EAUPChain($this->getSoapClient()->__getLastResponse());
}

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

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

if($this->isVerbose()) {
print_r($this->getFullErrorMessage());
}

return new EAUPRSAs($this->getSoapClient()->__getLastResponse(), $this->getNMVersionFloat());
}
}
4 changes: 4 additions & 0 deletions src/Services/FlowServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public function queryRegulations(\DateTime $start, \DateTime $end, $regex = "LF*

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

if($this->isVerbose()) {
print_r($this->getFullErrorMessage());
}

return new RegulationListReply($this->getSoapClient()->__getLastResponse());
}
}
14 changes: 13 additions & 1 deletion src/Services/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class Service {

private $versionFloat;

private $verbose = false;

public function __construct($wsdl, $options)
public function __construct($wsdl, $options, $verbose)
{
$this->client = new \SoapClient($wsdl, $options);
$this->extractNMVersion($wsdl);
Expand Down Expand Up @@ -81,4 +82,15 @@ public function getNMVersion() : string
public function getNMVersionFloat() : float {
return $this->versionFloat;
}

public function setVerbose($verbose)
{
$this->verbose = $verbose;
}

public function isVerbose()
{
return $this->verbose;
}

}

0 comments on commit 43a5f72

Please sign in to comment.