1
0
Fork 0
mirror of synced 2025-04-20 01:21:01 +00:00

codestyle fix

This commit is contained in:
Sergey Chazov 2020-09-03 12:13:26 +03:00
parent 58d9c0f1a7
commit 6fe2fdfd3e
10 changed files with 79 additions and 27 deletions

View file

@ -14,14 +14,6 @@
namespace RetailCrm;
use Intaro\RetailCrm\Component\Json\Deserializer;
use Intaro\RetailCrm\Component\Json\Serializer;
use Intaro\RetailCrm\Model\Api\Request\SmsVerification\SmsVerificationConfirmRequest;
use Intaro\RetailCrm\Model\Api\Request\SmsVerification\SmsVerificationCreateRequest;
use Intaro\RetailCrm\Model\Api\Response\SmsVerification\SmsVerificationConfirmResponse;
use Intaro\RetailCrm\Model\Api\Response\SmsVerification\SmsVerificationCreateResponse;
use Intaro\RetailCrm\Model\Api\Response\SmsVerification\SmsVerificationStatusRequest;
use Intaro\RetailCrm\Model\Api\Response\SmsVerification\SmsVerificationStatusResponse;
use RetailCrm\Http\Client;
use RetailCrm\Response\ApiResponse;

View file

@ -14,9 +14,6 @@ namespace Intaro\RetailCrm\Component\ApiClient;
use Intaro\RetailCrm\Component\ApiClient\Traits\CustomersCorporateTrait;
use Intaro\RetailCrm\Component\ApiClient\Traits\CustomersTrait;
use Intaro\RetailCrm\Component\ApiClient\Traits\LoyaltyTrait;
use Intaro\RetailCrm\Model\Api\Request\SmsVerification\SmsVerificationConfirmRequest;
use Intaro\RetailCrm\Model\Api\Request\SmsVerification\SmsVerificationCreateRequest;
use Intaro\RetailCrm\Model\Api\Response\SmsVerification\SmsVerificationStatusRequest;
use RetailCrm\Response\ApiResponse;
/**
@ -101,9 +98,6 @@ use RetailCrm\Response\ApiResponse;
* @method ApiResponse statisticUpdate()
* @method ApiResponse getSite()
* @method ApiResponse setSite($site)
* @method ApiResponse confirmLpVerificationBySMS(SmsVerificationConfirmRequest $request)
* @method ApiResponse sendSmsForLpVerification(SmsVerificationCreateRequest $request)
* @method ApiResponse checkStatusPlVerification(SmsVerificationStatusRequest $request)
*/
class ClientAdapter
{

View file

@ -1,5 +1,14 @@
<?php
/**
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Component\Factory
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
* @see http://retailcrm.ru/docs
*/
namespace Intaro\RetailCrm\Component\Factory;
use Intaro\RetailCrm\Component\ApiClient\ClientAdapter;

View file

@ -1,5 +1,14 @@
<?php
/**
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Model\Api\Response\SmsVerification
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
* @see http://retailcrm.ru/docs
*/
namespace Intaro\RetailCrm\Model\Api\Response\SmsVerification;
use Intaro\RetailCrm\Model\Api\AbstractApiModel;

View file

@ -1,5 +1,14 @@
<?php
/**
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Model\Api\Response\SmsVerification
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
* @see http://retailcrm.ru/docs
*/
namespace Intaro\RetailCrm\Model\Api\Response\SmsVerification;
use Intaro\RetailCrm\Model\Api\AbstractApiModel;

View file

@ -1,5 +1,14 @@
<?php
/**
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Model\Api\Response\SmsVerification
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
* @see http://retailcrm.ru/docs
*/
namespace Intaro\RetailCrm\Model\Api\Response\SmsVerification;
use Intaro\RetailCrm\Model\Api\AbstractApiModel;

View file

@ -1,13 +1,24 @@
<?php
/**
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Model\Api
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
* @see http://retailcrm.ru/docs
*/
namespace Intaro\RetailCrm\Model\Api;
/**
* Class SmsVerification
* @package Intaro\RetailCrm\Model\Api
*/
class SmsVerification extends AbstractApiModel
{
/**
* Дата создания. (Y-m-d H:i:s)
* Дата создания. (Y-m-d H:i:s)
*
* @var \DateTime
*
@ -17,7 +28,8 @@ class SmsVerification extends AbstractApiModel
public $createdAt;
/**
* Дата окончания срока жизни. (Y-m-d H:i:s)
* Дата окончания срока жизни. (Y-m-d H:i:s)
*
* @var \DateTime
*
* @Mapping\Type("DateTime<'Y-m-d H:i:s'>")
@ -27,6 +39,7 @@ class SmsVerification extends AbstractApiModel
/**
* Дата успешной верификации. (Y-m-d H:i:s)
*
* @var \DateTime
*
* @Mapping\Type("DateTime<'Y-m-d H:i:s'>")
@ -93,4 +106,4 @@ class SmsVerification extends AbstractApiModel
{
$this->expiredAt = $expiredAt;
}
}
}

View file

@ -54,4 +54,4 @@ class SmsVerificationConfirm extends AbstractApiModel
{
$this->checkId = $checkId;
}
}
}

17
tests/bitrixbootstrap.php Normal file
View file

@ -0,0 +1,17 @@
<?php
// Подключение ядра 1С-Битрикс
define ('NOT_CHECK_PERMISSIONS', true);
define ('NO_AGENT_CHECK', true);
$GLOBALS['DBType'] = 'mysql';
$_SERVER['DOCUMENT_ROOT'] = realpath(__DIR__ . '/../..' );
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
// Искуственная авторизация в роли админа
$_SESSION['SESS_AUTH']['USER_ID'] = 1;
// Подключение автозаргрузки Composer
require_once $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
\Bitrix\Main\Loader::includeModule('intaro.retailcrm');
\Bitrix\Main\Loader::includeModule('sale');
require_once $_SERVER['DOCUMENT_ROOT'] . '/local/tests/helpers/Helpers.php';

View file

@ -1,5 +1,4 @@
<?php
namespace Tests\Intaro\RetailCrm\Component\Factory;
use Bitrix\Main\Config\Option;
@ -13,9 +12,10 @@ class ClientFactoryTest extends TestCase
public function testCreacteClientAdapter(): void
{
$client = ClientFactory::creacteClientAdapter();
if (empty(ConfigProvider::getApiUrl())) {
self::assertEquals(null, $client);
}else{
} else {
self::assertEquals(ClientAdapter::class, get_class($client));
}
}