Skip to content

Commit f12cd6f

Browse files
committed
refact(API-1925): Run ECS
1 parent 2427e6c commit f12cd6f

File tree

103 files changed

+563
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+563
-293
lines changed

src/AkeneoPimClient.php

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,46 @@
5050
*/
5151
class AkeneoPimClient implements AkeneoPimClientInterface
5252
{
53-
public function __construct(protected Authentication $authentication, protected ProductApiInterface $productApi, protected CategoryApiInterface $categoryApi, protected AttributeApiInterface $attributeApi, protected AttributeOptionApiInterface $attributeOptionApi, protected AttributeGroupApiInterface $attributeGroupApi, protected FamilyApiInterface $familyApi, protected MediaFileApiInterface $productMediaFileApi, protected LocaleApiInterface $localeApi, protected ChannelApiInterface $channelApi, protected CurrencyApiInterface $currencyApi, protected MeasureFamilyApiInterface $measureFamilyApi, private MeasurementFamilyApiInterface $measurementFamilyApi, protected AssociationTypeApiInterface $associationTypeApi, protected FamilyVariantApiInterface $familyVariantApi, protected ProductModelApiInterface $productModelApi, private ProductModelDraftApiInterface $productModelDraftApi, private PublishedProductApiInterface $publishedProductApi, private ProductDraftApiInterface $productDraftApi, private AssetApiInterface $assetApi, private AssetCategoryApiInterface $assetCategoryApi, private AssetTagApiInterface $assetTagApi, private AssetReferenceFileApiInterface $assetReferenceFileApi, private AssetVariationFileApiInterface $assetVariationFileApi, private ReferenceEntityRecordApiInterface $referenceEntityRecordApi, private ReferenceEntityMediaFileApiInterface $referenceEntityMediaFileApi, private ReferenceEntityAttributeApiInterface $referenceEntityAttributeApi, private ReferenceEntityAttributeOptionApiInterface $referenceEntityAttributeOptionApi, private ReferenceEntityApiInterface $referenceEntityApi, private AssetManagerApiInterface $assetManagerApi, private AssetFamilyApiInterface $assetFamilyApi, private AssetAttributeApiInterface $assetAttributeApi, private AssetAttributeOptionApiInterface $assetAttributeOptionApi, private AssetMediaFileApiInterface $assetMediaFileApi, private ProductUuidApiInterface $productUuidApi, private ProductDraftUuidApiInterface $productDraftUuidApi, private AppCatalogApiInterface $appCatalogApi, private AppCatalogProductApiInterface $appCatalogProductApi)
54-
{
53+
public function __construct(
54+
protected Authentication $authentication,
55+
protected ProductApiInterface $productApi,
56+
protected CategoryApiInterface $categoryApi,
57+
protected AttributeApiInterface $attributeApi,
58+
protected AttributeOptionApiInterface $attributeOptionApi,
59+
protected AttributeGroupApiInterface $attributeGroupApi,
60+
protected FamilyApiInterface $familyApi,
61+
protected MediaFileApiInterface $productMediaFileApi,
62+
protected LocaleApiInterface $localeApi,
63+
protected ChannelApiInterface $channelApi,
64+
protected CurrencyApiInterface $currencyApi,
65+
protected MeasureFamilyApiInterface $measureFamilyApi,
66+
private MeasurementFamilyApiInterface $measurementFamilyApi,
67+
protected AssociationTypeApiInterface $associationTypeApi,
68+
protected FamilyVariantApiInterface $familyVariantApi,
69+
protected ProductModelApiInterface $productModelApi,
70+
private ProductModelDraftApiInterface $productModelDraftApi,
71+
private PublishedProductApiInterface $publishedProductApi,
72+
private ProductDraftApiInterface $productDraftApi,
73+
private AssetApiInterface $assetApi,
74+
private AssetCategoryApiInterface $assetCategoryApi,
75+
private AssetTagApiInterface $assetTagApi,
76+
private AssetReferenceFileApiInterface $assetReferenceFileApi,
77+
private AssetVariationFileApiInterface $assetVariationFileApi,
78+
private ReferenceEntityRecordApiInterface $referenceEntityRecordApi,
79+
private ReferenceEntityMediaFileApiInterface $referenceEntityMediaFileApi,
80+
private ReferenceEntityAttributeApiInterface $referenceEntityAttributeApi,
81+
private ReferenceEntityAttributeOptionApiInterface $referenceEntityAttributeOptionApi,
82+
private ReferenceEntityApiInterface $referenceEntityApi,
83+
private AssetManagerApiInterface $assetManagerApi,
84+
private AssetFamilyApiInterface $assetFamilyApi,
85+
private AssetAttributeApiInterface $assetAttributeApi,
86+
private AssetAttributeOptionApiInterface $assetAttributeOptionApi,
87+
private AssetMediaFileApiInterface $assetMediaFileApi,
88+
private ProductUuidApiInterface $productUuidApi,
89+
private ProductDraftUuidApiInterface $productDraftUuidApi,
90+
private AppCatalogApiInterface $appCatalogApi,
91+
private AppCatalogProductApiInterface $appCatalogProductApi
92+
) {
5593
}
5694

5795
/**

src/AkeneoPimClientBuilder.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ class AkeneoPimClientBuilder
8989
/**
9090
* @param string $baseUri Base uri to request the API
9191
*/
92-
public function __construct(protected string $baseUri, array $options = [])
93-
{
92+
public function __construct(
93+
protected string $baseUri,
94+
array $options = []
95+
) {
9496
$this->options = Options::fromArray($options);
9597
}
9698

@@ -142,8 +144,12 @@ public function setFileSystem(FileSystemInterface $fileSystem): self
142144
* @param string $username Username to use for the authentication
143145
* @param string $password Password associated to the username
144146
*/
145-
public function buildAuthenticatedByPassword(string $clientId, string $secret, string $username, string $password): AkeneoPimClientInterface
146-
{
147+
public function buildAuthenticatedByPassword(
148+
string $clientId,
149+
string $secret,
150+
string $username,
151+
string $password
152+
): AkeneoPimClientInterface {
147153
$authentication = Authentication::fromPassword($clientId, $secret, $username, $password);
148154

149155
return $this->buildAuthenticatedClient($authentication);
@@ -164,8 +170,12 @@ public function buildAuthenticatedByAppToken(string $token): AkeneoPimClientInte
164170
* @param string $token Token to use for the authentication
165171
* @param string $refreshToken Token to use to refresh the access token
166172
*/
167-
public function buildAuthenticatedByToken(string $clientId, string $secret, string $token, string $refreshToken): AkeneoPimClientInterface
168-
{
173+
public function buildAuthenticatedByToken(
174+
string $clientId,
175+
string $secret,
176+
string $token,
177+
string $refreshToken
178+
): AkeneoPimClientInterface {
169179
$authentication = Authentication::fromToken($clientId, $secret, $token, $refreshToken);
170180

171181
return $this->buildAuthenticatedClient($authentication);

src/Api/AppCatalog/AppCatalogApi.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ class AppCatalogApi implements AppCatalogApiInterface
2020
public const APP_CATALOGS_URI = 'api/rest/v1/catalogs';
2121
public const APP_CATALOG_URI = 'api/rest/v1/catalogs/%s';
2222

23-
public function __construct(protected ResourceClientInterface $resourceClient, protected PageFactoryInterface $pageFactory, protected ResourceCursorFactoryInterface $cursorFactory)
24-
{
23+
public function __construct(
24+
protected ResourceClientInterface $resourceClient,
25+
protected PageFactoryInterface $pageFactory,
26+
protected ResourceCursorFactoryInterface $cursorFactory
27+
) {
2528
}
2629

2730
public function listPerPage(int $limit = 100, bool $withCount = false, array $queryParameters = []): PageInterface

src/Api/AppCatalog/AppCatalogProductApi.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ class AppCatalogProductApi implements AppCatalogProductApiInterface
1717
{
1818
public const APP_CATALOG_PRODUCT_URI = '/api/rest/v1/catalogs/%s/product-uuids';
1919

20-
public function __construct(protected ResourceClientInterface $resourceClient, protected PageFactoryInterface $pageFactory, protected ResourceCursorFactoryInterface $cursorFactory)
21-
{
20+
public function __construct(
21+
protected ResourceClientInterface $resourceClient,
22+
protected PageFactoryInterface $pageFactory,
23+
protected ResourceCursorFactoryInterface $cursorFactory
24+
) {
2225
}
2326

2427
/**

src/Api/AssetApi.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ class AssetApi implements AssetApiInterface
2525
public const ASSETS_URI = '/api/rest/v1/assets';
2626
public const ASSET_URI = '/api/rest/v1/assets/%s';
2727

28-
public function __construct(private ResourceClientInterface $resourceClient, private PageFactoryInterface $pageFactory, private ResourceCursorFactoryInterface $cursorFactory)
29-
{
28+
public function __construct(
29+
private ResourceClientInterface $resourceClient,
30+
private PageFactoryInterface $pageFactory,
31+
private ResourceCursorFactoryInterface $cursorFactory
32+
) {
3033
}
3134

3235
/**

src/Api/AssetCategoryApi.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ class AssetCategoryApi implements AssetCategoryApiInterface
2525
public const ASSET_CATEGORIES_URI = '/api/rest/v1/asset-categories';
2626
public const ASSET_CATEGORY_URI = '/api/rest/v1/asset-categories/%s';
2727

28-
public function __construct(private ResourceClientInterface $resourceClient, private PageFactoryInterface $pageFactory, private ResourceCursorFactoryInterface $cursorFactory)
29-
{
28+
public function __construct(
29+
private ResourceClientInterface $resourceClient,
30+
private PageFactoryInterface $pageFactory,
31+
private ResourceCursorFactoryInterface $cursorFactory
32+
) {
3033
}
3134

3235
/**

src/Api/AssetManager/AssetApi.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111

1212
class AssetApi implements AssetApiInterface
1313
{
14-
public const ASSET_URI= 'api/rest/v1/asset-families/%s/assets/%s';
14+
public const ASSET_URI = 'api/rest/v1/asset-families/%s/assets/%s';
1515
public const ASSETS_URI = 'api/rest/v1/asset-families/%s/assets';
1616

17-
public function __construct(private ResourceClientInterface $resourceClient, private PageFactoryInterface $pageFactory, private ResourceCursorFactoryInterface $cursorFactory)
18-
{
17+
public function __construct(
18+
private ResourceClientInterface $resourceClient,
19+
private PageFactoryInterface $pageFactory,
20+
private ResourceCursorFactoryInterface $cursorFactory
21+
) {
1922
}
2023

2124
/**

src/Api/AssetManager/AssetAttributeApi.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ class AssetAttributeApi implements AssetAttributeApiInterface
1111
public const ASSET_ATTRIBUTE_URI = 'api/rest/v1/asset-families/%s/attributes/%s';
1212
public const ASSET_ATTRIBUTES_URI = 'api/rest/v1/asset-families/%s/attributes';
1313

14-
public function __construct(private ResourceClientInterface $resourceClient)
15-
{
14+
public function __construct(
15+
private ResourceClientInterface $resourceClient
16+
) {
1617
}
1718

1819
/**

src/Api/AssetManager/AssetAttributeOptionApi.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ class AssetAttributeOptionApi implements AssetAttributeOptionApiInterface
1111
public const ASSET_ATTRIBUTE_OPTION_URI = 'api/rest/v1/asset-families/%s/attributes/%s/options/%s';
1212
public const ASSET_ATTRIBUTE_OPTIONS_URI = 'api/rest/v1/asset-families/%s/attributes/%s/options';
1313

14-
public function __construct(private ResourceClientInterface $resourceClient)
15-
{
14+
public function __construct(
15+
private ResourceClientInterface $resourceClient
16+
) {
1617
}
1718

1819
/**

src/Api/AssetManager/AssetFamilyApi.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
class AssetFamilyApi implements AssetFamilyApiInterface
1313
{
1414
public const ASSET_FAMILY_URI = 'api/rest/v1/asset-families/%s';
15-
public const ASSET_FAMILIES_URI= 'api/rest/v1/asset-families';
15+
public const ASSET_FAMILIES_URI = 'api/rest/v1/asset-families';
1616

17-
public function __construct(private ResourceClientInterface $resourceClient, private PageFactoryInterface $pageFactory, private ResourceCursorFactoryInterface $cursorFactory)
18-
{
17+
public function __construct(
18+
private ResourceClientInterface $resourceClient,
19+
private PageFactoryInterface $pageFactory,
20+
private ResourceCursorFactoryInterface $cursorFactory
21+
) {
1922
}
2023

2124
/**

0 commit comments

Comments
 (0)