| Total Complexity | 3 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 9 | class ClientSoap |
||
| 10 | { |
||
| 11 | private $storage; |
||
| 12 | private $userToken; |
||
| 13 | private $client; |
||
| 14 | private $wsdl = 'https://openapi.nalog.ru:8090/open-api/ais3/KktService/0.1?wsdl'; |
||
| 15 | |||
| 16 | public function __construct(string $userToken, CacheInterface $cache, $debug = false) |
||
| 17 | { |
||
| 18 | $this->storage = $cache; |
||
| 19 | $this->userToken = $userToken; |
||
| 20 | $this->client = new SoapClient( |
||
| 21 | $this->wsdl, |
||
| 22 | [ |
||
| 23 | 'trace' => $debug, |
||
| 24 | 'stream_context' => stream_context_create(['http' => ['header' => $this->getHeaderString()]]) |
||
| 25 | ] |
||
| 26 | ); |
||
| 27 | } |
||
| 28 | |||
| 29 | private function getHeaderString() : string |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getClient() : SoapClient |
||
| 44 |