diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 16cb922..4644460 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -27,9 +27,9 @@ jobs: matrix: include: - php-version: '8.4' - docker-image: 'anzusystems/php:5.0.1-php84-cli' + docker-image: 'anzusystems/php:5.1.0-php84-cli' - php-version: '8.5' - docker-image: 'anzusystems/php:5.0.1-php85-cli' + docker-image: 'anzusystems/php:5.1.0-php85-cli' services: mysql: diff --git a/Dockerfile b/Dockerfile index 0fdd442..ab64925 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM anzusystems/php:5.0.1-php84-cli +FROM anzusystems/php:5.1.0-php84-cli # ### Basic arguments and variables ARG DOCKER_USER_ID diff --git a/src/ApiFilter/ApiParams.php b/src/ApiFilter/ApiParams.php index 3021641..1cb2655 100644 --- a/src/ApiFilter/ApiParams.php +++ b/src/ApiFilter/ApiParams.php @@ -81,6 +81,9 @@ public function __construct() $this->bigTable = self::DEFAULTS[self::BIG_TABLE]; } + /** + * @return Generator + */ public static function generateAllAvailableOAQueryParams(): Generator { foreach (self::AVAILABLE_FILTERS as $filterName) { diff --git a/src/Model/OpenApi/Get/OAGetInfiniteList.php b/src/Model/OpenApi/Get/OAGetInfiniteList.php index 421426d..d902fcc 100644 --- a/src/Model/OpenApi/Get/OAGetInfiniteList.php +++ b/src/Model/OpenApi/Get/OAGetInfiniteList.php @@ -15,7 +15,7 @@ final class OAGetInfiniteList extends Get public function __construct(string $type) { parent::__construct( - parameters: iterator_to_array(ApiParams::generateAllAvailableOAQueryParams()), + parameters: array_values(iterator_to_array(ApiParams::generateAllAvailableOAQueryParams())), responses: [ new OAResponseInfiniteList(type: $type), ] diff --git a/src/Model/OpenApi/Get/OAGetList.php b/src/Model/OpenApi/Get/OAGetList.php index a2c0cf8..27e1e6e 100644 --- a/src/Model/OpenApi/Get/OAGetList.php +++ b/src/Model/OpenApi/Get/OAGetList.php @@ -19,7 +19,7 @@ final class OAGetList extends Get public function __construct(string $type, array $customFilters = []) { parent::__construct( - parameters: iterator_to_array(ApiParams::generateAllAvailableOAQueryParams()), + parameters: array_values(iterator_to_array(ApiParams::generateAllAvailableOAQueryParams())), responses: [new OAResponseList($type)] ); } diff --git a/src/Model/OpenApi/Parameter/OAEnumParameterPath.php b/src/Model/OpenApi/Parameter/OAEnumParameterPath.php index 86bd002..1016dab 100644 --- a/src/Model/OpenApi/Parameter/OAEnumParameterPath.php +++ b/src/Model/OpenApi/Parameter/OAEnumParameterPath.php @@ -21,13 +21,15 @@ final class OAEnumParameterPath extends PathParameter public function __construct(string $name, string $class, ?string $description = null) { if (is_a($class, EnumInterface::class, true)) { + /** @var list $enum */ + $enum = array_values($class::values()); parent::__construct( name: $name, description: $description, schema: new Schema( type: 'string', default: $class::Default, - enum: $class::values(), + enum: $enum, ) ); } diff --git a/src/Model/OpenApi/Property/OAEnumProperty.php b/src/Model/OpenApi/Property/OAEnumProperty.php index 6a60dca..664ee26 100644 --- a/src/Model/OpenApi/Property/OAEnumProperty.php +++ b/src/Model/OpenApi/Property/OAEnumProperty.php @@ -20,11 +20,13 @@ final class OAEnumProperty extends Property public function __construct(string $class, ?string $description = null) { if (is_a($class, EnumInterface::class, true)) { + /** @var list $enum */ + $enum = array_values($class::values()); parent::__construct( description: $description, type: 'string', default: $class::Default, - enum: $class::values(), + enum: $enum, ); } }