| 1 | <?php |
||
| 11 | class Client |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * URL to WSDL |
||
| 15 | * |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $wsdl = 'https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * SOAP client |
||
| 22 | * |
||
| 23 | * @var \SoapClient |
||
| 24 | */ |
||
| 25 | private $soapClient; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * SOAP classmap |
||
| 29 | * |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | private $classmap = [ |
||
| 33 | 'checkVatResponse' => 'Ddeboer\Vatin\Vies\Response\CheckVatResponse' |
||
| 34 | ]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Constructor |
||
| 38 | * |
||
| 39 | * @param string|null $wsdl URL to WSDL |
||
| 40 | */ |
||
| 41 | 2 | public function __construct($wsdl = null) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Check VAT |
||
| 50 | * |
||
| 51 | * @param string $countryCode Country code |
||
| 52 | * @param string $vatNumber VAT number |
||
| 53 | * |
||
| 54 | * @return Response\CheckVatResponse |
||
| 55 | * @throws ViesException |
||
| 56 | */ |
||
| 57 | 2 | public function checkVat($countryCode, $vatNumber) |
|
| 70 | |||
| 71 | /** |
||
| 72 | * Get SOAP client |
||
| 73 | * |
||
| 74 | * @return \SoapClient |
||
| 75 | */ |
||
| 76 | 2 | private function getSoapClient() |
|
| 91 | } |
||
| 92 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: