Skip to content

Commit

Permalink
make alibaba exception accept nullable subMessage and subCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik-Czulak committed Feb 9, 2024
1 parent 1135c91 commit 6ad7ef8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/Endpoint/CategoryEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ public function getAttributes(string $categoryId): array
*
* @param ?string $valueId provide null to fetch first level
*/
public function getLevelAttribute(string $categoryId, string $attributeId, ?string $valueId = null): CategoryLevelAttribute
{
public function getLevelAttribute(
string $categoryId,
string $attributeId,
?string $valueId = null
): CategoryLevelAttribute {
$attributeValueRequest = new CategoryLevelAttributeRequest();
$attributeValueRequest->categoryId = $categoryId;
$attributeValueRequest->attributeId = $attributeId;
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/AlibabaException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class AlibabaException extends \RuntimeException
public function __construct(
string $message,
int $code,
private string $subMessage,
private string $subCode,
private ?string $subMessage,
private ?string $subCode,
?\Throwable $previous = null
) {
$message = sprintf('%s. Sub-code: "%s". Sub-message: "%s".', $message, $this->subCode, $this->subMessage);
Expand Down
2 changes: 1 addition & 1 deletion src/Factory/CategoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function createAttributeValue(array $data): CategoryAttributeValue
}

/**
* @param array<string, mixed> $data
* @param <string, mixed> $data
*/
public function createLevelAttribute(array $data): CategoryLevelAttribute

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.0, --prefer-lowest)

Method Kyto\Alibaba\Factory\CategoryFactory::createLevelAttribute() has parameter $data with no value type specified in iterable type array.

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.0, --prefer-lowest)

PHPDoc tag @param has invalid value (<string, mixed> $data): Unexpected token "<", expected type at offset 18

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.0)

Method Kyto\Alibaba\Factory\CategoryFactory::createLevelAttribute() has parameter $data with no value type specified in iterable type array.

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.0)

PHPDoc tag @param has invalid value (<string, mixed> $data): Unexpected token "<", expected type at offset 18

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.1, --prefer-lowest)

Method Kyto\Alibaba\Factory\CategoryFactory::createLevelAttribute() has parameter $data with no value type specified in iterable type array.

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.1, --prefer-lowest)

PHPDoc tag @param has invalid value (<string, mixed> $data): Unexpected token "<", expected type at offset 18

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.1)

Method Kyto\Alibaba\Factory\CategoryFactory::createLevelAttribute() has parameter $data with no value type specified in iterable type array.

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.1)

PHPDoc tag @param has invalid value (<string, mixed> $data): Unexpected token "<", expected type at offset 18

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.2, --prefer-lowest)

Method Kyto\Alibaba\Factory\CategoryFactory::createLevelAttribute() has parameter $data with no value type specified in iterable type array.

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.2, --prefer-lowest)

PHPDoc tag @param has invalid value (<string, mixed> $data): Unexpected token "<", expected type at offset 18

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.2)

Method Kyto\Alibaba\Factory\CategoryFactory::createLevelAttribute() has parameter $data with no value type specified in iterable type array.

Check failure on line 86 in src/Factory/CategoryFactory.php

View workflow job for this annotation

GitHub Actions / build (8.2)

PHPDoc tag @param has invalid value (<string, mixed> $data): Unexpected token "<", expected type at offset 18
{
Expand Down
4 changes: 3 additions & 1 deletion src/Model/CategoryAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class CategoryAttribute

// TODO: change to enums once all values would be known
public string $inputType; // Known values: single_select, multi_select, input
public string $showType; // Known values: list_box (single_select), check_box (multi_select), input (input), group_table (single_select)

// Known values: list_box (single_select), check_box (multi_select), input (input), group_table (single_select)
public string $showType;
public string $valueType; // Known values: string, number

public bool $isSku;
Expand Down

0 comments on commit 6ad7ef8

Please sign in to comment.