Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ "8.2", "8.4" ]
php: [ "8.2", "8.5" ]
steps:
- uses: actions/checkout@v4

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
include:
- php: "8.4"
- php: "8.5"
stability: --prefer-stable
- php: "8.2"
stability: --prefer-lowest
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:

- name: Run tests
run: |
export WITH_COVERAGE=$(if [[ ("${{ matrix.php }}" = "8.4") && ("${{ matrix.stability }}" = "--prefer-stable") ]]; then echo "true"; else echo "false"; fi)
export WITH_COVERAGE=$(if [[ ("${{ matrix.php }}" = "8.5") && ("${{ matrix.stability }}" = "--prefer-stable") ]]; then echo "true"; else echo "false"; fi)
echo "WITH_COVERAGE=${WITH_COVERAGE}" >> $GITHUB_ENV
make vendor
make tests
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build:
analysis:
environment:
php:
version: 8.4
version: 8.5
cache:
disabled: false
directories:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DOCKER_COMPOSE ?= docker compose
EXEC_PHP = $(DOCKER_COMPOSE) run --rm php
PHP_VERSION ?= 8.4
PHP_VERSION ?= 8.5
DEPS_STRATEGY ?= --prefer-stable
COMPOSER = $(EXEC_PHP) composer
WITH_COVERAGE ?= "FALSE"
Expand All @@ -25,7 +25,7 @@ setup: build

.PHONY: build kill setup

PHPUNIT_FLAGS = $(if $(filter 8.4,$(PHP_VERSION)),--display-deprecations,) \
PHPUNIT_FLAGS = $(if $(filter 8.5,$(PHP_VERSION)),--display-deprecations,) \
$(if $(filter true,$(WITH_COVERAGE)),--coverage-clover clover.xml,)

tests: ## Run all tests
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
services:
php:
image: tigitz/phpspellchecker:${PHP_VERSION:-8.4}
image: tigitz/phpspellchecker:${PHP_VERSION:-8.5}
build:
context: docker/php
args:
PHP_VERSION: ${PHP_VERSION:-8.4}
PHP_VERSION: ${PHP_VERSION:-8.5}
volumes:
- .:/usr/src/myapp
- ./cache:/root/composer/cache
Expand Down
8 changes: 4 additions & 4 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ RUN apt-get update \
libpspell-dev

RUN pecl channel-update pecl.php.net && \
pecl install xdebug-3.4.0 && \
pecl install xdebug-3.5.1 && \
docker-php-ext-enable xdebug

RUN if [ "${PHP_VERSION}" = "8.4" ]; then \
pecl install pspell; \
else \
RUN if [ "${PHP_VERSION}" = "8.2" ] || [ "${PHP_VERSION}" = "8.3" ]; then \
docker-php-ext-configure pspell && \
docker-php-ext-install pspell; \
else \
pecl install pspell; \
fi && \
docker-php-ext-enable pspell && \
rm -r /var/lib/apt/lists/*
Expand Down
17 changes: 8 additions & 9 deletions src/Spellchecker/LanguageTool/LanguageToolApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ public function spellCheck(string $text, array $languages, array $options): arra
*/
public function getSupportedLanguages(): array
{
/** @var array<string> */
return array_values(array_unique(array_column(
$this->requestAPI(
'/v2/languages',
'GET',
'Accept: application/json'
),
'longCode'
)));
/** @var array<array{longCode: string}> $languages */
$languages = $this->requestAPI(
'/v2/languages',
'GET',
'Accept: application/json'
);

return array_values(array_unique(array_column($languages, 'longCode')));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/php-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function preg_match_all(string $pattern, string $subject, &$matches = [], int $f
*
* @param-out 0|positive-int $count
*
* @return ($subject is array ? list<string> : string)
* @return ($subject is array ? array<string> : string)
*/
function preg_replace(array|string $pattern, array|string $replacement, array|string $subject, int $limit = -1, ?int &$count = null): array|string
{
Expand Down
Loading