@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | * @var string |
| 31 | 31 | */ |
| 32 | 32 | public $customerLegalForm; |
| 33 | - const CUSTOMER_LEGAL_FORM_LEGAL = 'legal'; //Юр. лицо |
|
| 33 | + const CUSTOMER_LEGAL_FORM_LEGAL = 'legal'; //Юр. лицо |
|
| 34 | 34 | const CUSTOMER_LEGAL_FORM_INDIVIDUAL = 'individual'; //ИП |
| 35 | - const CUSTOMER_LEGAL_FORM_PERSON = 'person'; //Физ. лицо |
|
| 35 | + const CUSTOMER_LEGAL_FORM_PERSON = 'person'; //Физ. лицо |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Если передан, изменяется запись с указанным ID, иначе создается новая заявка |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | * @var string |
| 124 | 124 | */ |
| 125 | 125 | public $customerTarget; |
| 126 | - const CUSTOMER_TARGET_OWNER = 'owner'; //Руководитель организации (ИП) (по умолчанию) |
|
| 127 | - const CUSTOMER_TARGET_CONFIDANT = 'confidant'; //Доверенное лицо организации (ИП) |
|
| 126 | + const CUSTOMER_TARGET_OWNER = 'owner'; //Руководитель организации (ИП) (по умолчанию) |
|
| 127 | + const CUSTOMER_TARGET_CONFIDANT = 'confidant'; //Доверенное лицо организации (ИП) |
|
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | 130 | * Кто получает подпись |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | if (!empty(self::$data)) { |
| 61 | 61 | return self::$data; |
| 62 | 62 | } |
| 63 | - if (file_exists(__DIR__ . '/mock.runtime')) { |
|
| 64 | - self::$data = unserialize(file_get_contents(__DIR__ . '/mock.runtime')); |
|
| 63 | + if (file_exists(__DIR__.'/mock.runtime')) { |
|
| 64 | + self::$data = unserialize(file_get_contents(__DIR__.'/mock.runtime')); |
|
| 65 | 65 | } else { |
| 66 | 66 | self::$data = [ |
| 67 | 67 | 'currentId' => 1, |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | private static function flushData($data) |
| 77 | 77 | { |
| 78 | 78 | self::$data = $data; |
| 79 | - file_put_contents(__DIR__ . '/mock.runtime', serialize(self::$data)); |
|
| 79 | + file_put_contents(__DIR__.'/mock.runtime', serialize(self::$data)); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function egrul(EgrulRequest $request) |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function getCustomerFormCertificateBlank($customerFormCrmId, $format = 'pdf') |
| 93 | 93 | { |
| 94 | - return base64_encode(file_get_contents(__DIR__ . '/data/blank.pdf')); |
|
| 94 | + return base64_encode(file_get_contents(__DIR__.'/data/blank.pdf')); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | public function getCustomerFormClaim($customerFormCrmId, $format = 'pdf') |
| 98 | 98 | { |
| 99 | - return base64_encode(file_get_contents(__DIR__ . '/data/claim.pdf')); |
|
| 99 | + return base64_encode(file_get_contents(__DIR__.'/data/claim.pdf')); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | public function sendCustomerForm(SendCustomerFormRequest $customerForm) |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | case 404: |
| 101 | 101 | throw new NotFoundException("$endpoint: Сущность или точка АПИ не найдены"); |
| 102 | 102 | case 500: |
| 103 | - throw new ServerException("$endpoint: Ошибка сервера \n" . $response->getBody()->getContents()); |
|
| 103 | + throw new ServerException("$endpoint: Ошибка сервера \n".$response->getBody()->getContents()); |
|
| 104 | 104 | default: |
| 105 | 105 | throw new TransportException("$endpoint: Неожиданный код ответа {$response->getStatusCode()}"); |
| 106 | 106 | } |
@@ -132,21 +132,21 @@ discard block |
||
| 132 | 132 | case 200: |
| 133 | 133 | return $data; |
| 134 | 134 | case 400: |
| 135 | - throw new InvalidRequestException("$endpoint: " . $data->error->message ?? $data->message ?? "Неверный формат запроса"); |
|
| 135 | + throw new InvalidRequestException("$endpoint: ".$data->error->message ?? $data->message ?? "Неверный формат запроса"); |
|
| 136 | 136 | case 404: |
| 137 | - throw new NotFoundException("$endpoint: " . $data->error->message ?? $data->message ?? "Сущность или точка АПИ не найдены"); |
|
| 137 | + throw new NotFoundException("$endpoint: ".$data->error->message ?? $data->message ?? "Сущность или точка АПИ не найдены"); |
|
| 138 | 138 | case 500: |
| 139 | - throw new ServerException("$endpoint: " . $data->error->message ?? $data->message ?? "Неожиданная ошибка сервера"); |
|
| 139 | + throw new ServerException("$endpoint: ".$data->error->message ?? $data->message ?? "Неожиданная ошибка сервера"); |
|
| 140 | 140 | default: |
| 141 | - throw new TransportException("$endpoint: " . $data->error->message ?? $data->message ?? "Неожиданный код ответа {$response->getStatusCode()}"); |
|
| 141 | + throw new TransportException("$endpoint: ".$data->error->message ?? $data->message ?? "Неожиданный код ответа {$response->getStatusCode()}"); |
|
| 142 | 142 | } |
| 143 | 143 | } catch (TransportException $e) { |
| 144 | - throw new TransportException('Ошибка во время отправки запроса ' . print_r([ |
|
| 144 | + throw new TransportException('Ошибка во время отправки запроса '.print_r([ |
|
| 145 | 145 | $method, |
| 146 | - $this->url . $endpoint, |
|
| 146 | + $this->url.$endpoint, |
|
| 147 | 147 | $options, |
| 148 | 148 | $data, |
| 149 | - ], true) . ': ' . $e->getMessage(), $e->getCode(), $e); |
|
| 149 | + ], true).': '.$e->getMessage(), $e->getCode(), $e); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | { |
| 160 | 160 | $body = $response->getBody(); |
| 161 | 161 | if (strlen($body) === 0) { |
| 162 | - throw new TransportException('Пустое тело ответа на JSON запрос. Код ответа ' . $response->getStatusCode()); |
|
| 162 | + throw new TransportException('Пустое тело ответа на JSON запрос. Код ответа '.$response->getStatusCode()); |
|
| 163 | 163 | } |
| 164 | 164 | $json = json_decode($body); |
| 165 | 165 | $jsonErrorCode = json_last_error(); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $response->status = $result->status; |
| 245 | 245 | $response->message = $result->message ?? null; |
| 246 | 246 | if (!$response->status) { |
| 247 | - throw new BooleanResponseException('Ошибка при обновлении статуса в CRM ' . print_r($response, true)); |
|
| 247 | + throw new BooleanResponseException('Ошибка при обновлении статуса в CRM '.print_r($response, true)); |
|
| 248 | 248 | } |
| 249 | 249 | return $response; |
| 250 | 250 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $response->status = $result->status; |
| 272 | 272 | $response->message = $result->message ?? null; |
| 273 | 273 | if (!$response->status) { |
| 274 | - throw new BooleanResponseException('Ошибка при удалении заявки в CRM ' . print_r($response, true)); |
|
| 274 | + throw new BooleanResponseException('Ошибка при удалении заявки в CRM '.print_r($response, true)); |
|
| 275 | 275 | } |
| 276 | 276 | return $response; |
| 277 | 277 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | */ |
| 569 | 569 | public function certificateDownloadUrl($customerFormId, $token) |
| 570 | 570 | { |
| 571 | - return $this->url . '/customerForms/external/downloadCertificate?token=' . $token . '&customerFormId=' . $customerFormId; |
|
| 571 | + return $this->url.'/customerForms/external/downloadCertificate?token='.$token.'&customerFormId='.$customerFormId; |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | /** |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | */ |
| 581 | 581 | public function realizationDownloadUrl($customerFormId, $token) |
| 582 | 582 | { |
| 583 | - return $this->url . '/customerForms/external/downloadFirstRealization?token=' . $token . '&customerFormId=' . $customerFormId; |
|
| 583 | + return $this->url.'/customerForms/external/downloadFirstRealization?token='.$token.'&customerFormId='.$customerFormId; |
|
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | /** |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | */ |
| 592 | 592 | public function editUrl($token) |
| 593 | 593 | { |
| 594 | - return $this->url . '/customerForms/external?token=' . $token; |
|
| 594 | + return $this->url.'/customerForms/external?token='.$token; |
|
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | /** |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | */ |
| 605 | 605 | public function generationUrl($token, $generatonToken, $iframe = false) |
| 606 | 606 | { |
| 607 | - $return = $this->url . '/customerForms/external/generate?token=' . $token . '&generationToken=' . $generatonToken; |
|
| 607 | + $return = $this->url.'/customerForms/external/generate?token='.$token.'&generationToken='.$generatonToken; |
|
| 608 | 608 | if ($iframe) { |
| 609 | 609 | $return .= '&iframe=1'; |
| 610 | 610 | } |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | */ |
| 621 | 621 | public function customerFormFrameUrl($customerFormId, $token) |
| 622 | 622 | { |
| 623 | - return $this->url . '/customerForms/external/step1?token=' . $token . '&customerFormId=' . $customerFormId; |
|
| 623 | + return $this->url.'/customerForms/external/step1?token='.$token.'&customerFormId='.$customerFormId; |
|
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | /** |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | */ |
| 633 | 633 | public function certificateWriteUrl($customerFormId, $token) |
| 634 | 634 | { |
| 635 | - return $this->url . '/customerForms/external/writeCertificate?token=' . $token . '&customerFormId=' . $customerFormId; |
|
| 635 | + return $this->url.'/customerForms/external/writeCertificate?token='.$token.'&customerFormId='.$customerFormId; |
|
| 636 | 636 | } |
| 637 | 637 | #endregion urls |
| 638 | 638 | } |