From 92be05739c05ec21e5910cd80488dd55c4a4b333 Mon Sep 17 00:00:00 2001 From: Aydarkhan Tsyrenzhapov Date: Wed, 18 May 2022 18:50:14 +0300 Subject: [PATCH] Closes BR-43 fix values model for chained_list type fix namespaces and chained_list field type value model factory --- examples/chained_list_custom_field_actions.php | 8 ++++---- examples/currencies_actions.php | 2 +- examples/monetary_custom_field_actions.php | 4 ++-- src/AmoCRM/Client/AmoCRMApiClient.php | 2 +- src/AmoCRM/Collections/CurrenciesCollection.php | 5 ++--- src/AmoCRM/EntitiesServices/Currencies.php | 9 ++++----- src/AmoCRM/Filters/CurrenciesFilter.php | 4 +--- src/AmoCRM/Models/CurrencyModel.php | 4 +--- src/AmoCRM/Models/CustomFields/ChainedList.php | 2 +- .../Models/CustomFields/ChainedListCustomFieldModel.php | 4 +--- src/AmoCRM/Models/CustomFields/ChainedLists.php | 2 +- .../CustomFields/Factories/CustomFieldModelFactory.php | 4 ++-- .../Models/CustomFields/MonetaryCustomFieldModel.php | 4 +--- .../ChainedListCustomFieldValuesModel.php | 3 +-- .../Factories/CustomFieldValueCollectionFactory.php | 4 ++-- .../Factories/CustomFieldValueModelFactory.php | 2 +- .../Factories/CustomFieldValuesModelFactory.php | 3 ++- .../ChainedListCustomFieldValueCollection.php | 5 ++--- .../MonetaryCustomFieldValueCollection.php | 4 +--- .../ValueModels/ChainedListCustomFieldValueModel.php | 4 +--- 20 files changed, 32 insertions(+), 47 deletions(-) diff --git a/examples/chained_list_custom_field_actions.php b/examples/chained_list_custom_field_actions.php index 2d9ecb9b..e4f25d6d 100644 --- a/examples/chained_list_custom_field_actions.php +++ b/examples/chained_list_custom_field_actions.php @@ -2,10 +2,10 @@ /** @since Release Spring 2022 */ -use AmoCRM\AmoCRM\Models\CustomFields\ChainedListCustomFieldModel; -use AmoCRM\AmoCRM\Models\CustomFields\ChainedLists; -use AmoCRM\AmoCRM\Models\CustomFieldsValues\ChainedListCustomFieldValuesModel; -use AmoCRM\AmoCRM\Models\CustomFieldsValues\ValueCollections\ChainedListCustomFieldValueCollection; +use AmoCRM\Models\CustomFields\ChainedListCustomFieldModel; +use AmoCRM\Models\CustomFields\ChainedLists; +use AmoCRM\Models\CustomFieldsValues\ChainedListCustomFieldValuesModel; +use AmoCRM\Models\CustomFieldsValues\ValueCollections\ChainedListCustomFieldValueCollection; use AmoCRM\Client\AmoCRMApiClient; use AmoCRM\Collections\CustomFieldsValuesCollection; use AmoCRM\Exceptions\AmoCRMApiException; diff --git a/examples/currencies_actions.php b/examples/currencies_actions.php index db99db62..cea33697 100644 --- a/examples/currencies_actions.php +++ b/examples/currencies_actions.php @@ -2,7 +2,7 @@ /** @since Release Spring 2022 */ -use AmoCRM\AmoCRM\Filters\CurrenciesFilter; +use AmoCRM\Filters\CurrenciesFilter; use AmoCRM\Client\AmoCRMApiClient; use AmoCRM\Exceptions\AmoCRMApiException; use League\OAuth2\Client\Token\AccessTokenInterface; diff --git a/examples/monetary_custom_field_actions.php b/examples/monetary_custom_field_actions.php index c6b9561e..46bb2191 100644 --- a/examples/monetary_custom_field_actions.php +++ b/examples/monetary_custom_field_actions.php @@ -2,7 +2,7 @@ /** @since Release Spring 2022 */ -use AmoCRM\AmoCRM\Models\CustomFields\MonetaryCustomFieldModel; +use AmoCRM\Models\CustomFields\MonetaryCustomFieldModel; use AmoCRM\Client\AmoCRMApiClient; use AmoCRM\Exceptions\AmoCRMApiException; use AmoCRM\Filters\LeadsFilter; @@ -105,7 +105,7 @@ function (AccessTokenInterface $accessToken, string $baseDomain) { $monetaryValuesModel = new \AmoCRM\Models\CustomFieldsValues\MonetaryCustomFieldValuesModel(); $monetaryValuesModel->setFieldId($monetaryCf->getId()); $monetaryValuesModel->setValues( - (new \AmoCRM\AmoCRM\Models\CustomFieldsValues\ValueCollections\MonetaryCustomFieldValueCollection())->add( + (new \AmoCRM\Models\CustomFieldsValues\ValueCollections\MonetaryCustomFieldValueCollection())->add( (new \AmoCRM\Models\CustomFieldsValues\ValueModels\MonetaryCustomFieldValueModel())->setValue(100) ) ); diff --git a/src/AmoCRM/Client/AmoCRMApiClient.php b/src/AmoCRM/Client/AmoCRMApiClient.php index 457c83be..54272d3b 100644 --- a/src/AmoCRM/Client/AmoCRMApiClient.php +++ b/src/AmoCRM/Client/AmoCRMApiClient.php @@ -2,7 +2,7 @@ namespace AmoCRM\Client; -use AmoCRM\AmoCRM\EntitiesServices\Currencies; +use AmoCRM\EntitiesServices\Currencies; use AmoCRM\EntitiesServices\Account; use AmoCRM\EntitiesServices\Calls; use AmoCRM\EntitiesServices\CatalogElements; diff --git a/src/AmoCRM/Collections/CurrenciesCollection.php b/src/AmoCRM/Collections/CurrenciesCollection.php index 16a10c74..c5c4aac7 100644 --- a/src/AmoCRM/Collections/CurrenciesCollection.php +++ b/src/AmoCRM/Collections/CurrenciesCollection.php @@ -2,10 +2,9 @@ declare(strict_types=1); -namespace AmoCRM\AmoCRM\Collections; +namespace AmoCRM\Collections; -use AmoCRM\AmoCRM\Models\CurrencyModel; -use AmoCRM\Collections\BaseApiCollection; +use AmoCRM\Models\CurrencyModel; use AmoCRM\Collections\Interfaces\HasPagesInterface; use AmoCRM\Collections\Traits\PagesTrait; diff --git a/src/AmoCRM/EntitiesServices/Currencies.php b/src/AmoCRM/EntitiesServices/Currencies.php index 6df17aec..64fdc8b1 100644 --- a/src/AmoCRM/EntitiesServices/Currencies.php +++ b/src/AmoCRM/EntitiesServices/Currencies.php @@ -2,15 +2,14 @@ declare(strict_types=1); -namespace AmoCRM\AmoCRM\EntitiesServices; +namespace AmoCRM\EntitiesServices; -use AmoCRM\AmoCRM\Collections\CurrenciesCollection; -use AmoCRM\AmoCRM\Filters\CurrenciesFilter; -use AmoCRM\AmoCRM\Models\CurrencyModel; +use AmoCRM\Collections\CurrenciesCollection; +use AmoCRM\Filters\CurrenciesFilter; +use AmoCRM\Models\CurrencyModel; use AmoCRM\Client\AmoCRMApiClient; use AmoCRM\Client\AmoCRMApiRequest; use AmoCRM\Collections\BaseApiCollection; -use AmoCRM\EntitiesServices\BaseEntity; use AmoCRM\EntitiesServices\Interfaces\HasPageMethodsInterface; use AmoCRM\EntitiesServices\Traits\PageMethodsTrait; use AmoCRM\Exceptions\NotAvailableForActionException; diff --git a/src/AmoCRM/Filters/CurrenciesFilter.php b/src/AmoCRM/Filters/CurrenciesFilter.php index bd57ae84..9655fcce 100644 --- a/src/AmoCRM/Filters/CurrenciesFilter.php +++ b/src/AmoCRM/Filters/CurrenciesFilter.php @@ -2,9 +2,7 @@ declare(strict_types=1); -namespace AmoCRM\AmoCRM\Filters; - -use AmoCRM\Filters\PagesFilter; +namespace AmoCRM\Filters; /** * @since Release Spring 2022 diff --git a/src/AmoCRM/Models/CurrencyModel.php b/src/AmoCRM/Models/CurrencyModel.php index 1e737dc7..d960ea47 100644 --- a/src/AmoCRM/Models/CurrencyModel.php +++ b/src/AmoCRM/Models/CurrencyModel.php @@ -2,9 +2,7 @@ declare(strict_types=1); -namespace AmoCRM\AmoCRM\Models; - -use AmoCRM\Models\BaseApiModel; +namespace AmoCRM\Models; /** * @since Release Spring 2022 diff --git a/src/AmoCRM/Models/CustomFields/ChainedList.php b/src/AmoCRM/Models/CustomFields/ChainedList.php index cd04e4b6..3f109d39 100644 --- a/src/AmoCRM/Models/CustomFields/ChainedList.php +++ b/src/AmoCRM/Models/CustomFields/ChainedList.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace AmoCRM\AmoCRM\Models\CustomFields; +namespace AmoCRM\Models\CustomFields; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Jsonable; diff --git a/src/AmoCRM/Models/CustomFields/ChainedListCustomFieldModel.php b/src/AmoCRM/Models/CustomFields/ChainedListCustomFieldModel.php index 99219d21..547466a3 100644 --- a/src/AmoCRM/Models/CustomFields/ChainedListCustomFieldModel.php +++ b/src/AmoCRM/Models/CustomFields/ChainedListCustomFieldModel.php @@ -2,9 +2,7 @@ declare(strict_types=1); -namespace AmoCRM\AmoCRM\Models\CustomFields; - -use AmoCRM\Models\CustomFields\CustomFieldModel; +namespace AmoCRM\Models\CustomFields; /** * Модель поля вложенных списков diff --git a/src/AmoCRM/Models/CustomFields/ChainedLists.php b/src/AmoCRM/Models/CustomFields/ChainedLists.php index c813693f..fbb25603 100644 --- a/src/AmoCRM/Models/CustomFields/ChainedLists.php +++ b/src/AmoCRM/Models/CustomFields/ChainedLists.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace AmoCRM\AmoCRM\Models\CustomFields; +namespace AmoCRM\Models\CustomFields; use Illuminate\Support\Collection; diff --git a/src/AmoCRM/Models/CustomFields/Factories/CustomFieldModelFactory.php b/src/AmoCRM/Models/CustomFields/Factories/CustomFieldModelFactory.php index b3dd3750..a86bda31 100644 --- a/src/AmoCRM/Models/CustomFields/Factories/CustomFieldModelFactory.php +++ b/src/AmoCRM/Models/CustomFields/Factories/CustomFieldModelFactory.php @@ -2,8 +2,8 @@ namespace AmoCRM\Models\CustomFields\Factories; -use AmoCRM\AmoCRM\Models\CustomFields\ChainedListCustomFieldModel; -use AmoCRM\AmoCRM\Models\CustomFields\MonetaryCustomFieldModel; +use AmoCRM\Models\CustomFields\ChainedListCustomFieldModel; +use AmoCRM\Models\CustomFields\MonetaryCustomFieldModel; use AmoCRM\Models\CustomFields\OrgLegalNameCustomFieldModel; use AmoCRM\Models\CustomFields\TrackingDataCustomFieldModel; use AmoCRM\Models\CustomFields\BirthdayCustomFieldModel; diff --git a/src/AmoCRM/Models/CustomFields/MonetaryCustomFieldModel.php b/src/AmoCRM/Models/CustomFields/MonetaryCustomFieldModel.php index 9d293ac3..34c1755c 100644 --- a/src/AmoCRM/Models/CustomFields/MonetaryCustomFieldModel.php +++ b/src/AmoCRM/Models/CustomFields/MonetaryCustomFieldModel.php @@ -1,8 +1,6 @@