Skip to content

Commit 993db0b

Browse files
committed
update dependencies and fix linter warnings
1 parent 9165ea2 commit 993db0b

13 files changed

Lines changed: 34 additions & 17 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
os: [ubuntu-latest]
2929
coverage-extension: [pcov]
3030
steps:
31-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v6
3232
- name: Use php ${{ matrix.php-version }}
3333
uses: shivammathur/setup-php@v2
3434
with:

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ COMPOSER=$(PHP) -d "apc.enable_cli=0" $(shell which composer)
8383
# phpDocumentor executable file
8484
PHPDOC=$(shell which phpDocumentor)
8585

86+
# phpstan version
87+
PHPSTANVER=2.1.32
88+
8689
# --- MAKE TARGETS ---
8790

8891
# Display general help about this command
@@ -170,7 +173,7 @@ endif
170173
deps: ensuretarget
171174
rm -rf ./vendor/*
172175
($(COMPOSER) install -vvv --no-interaction)
173-
curl --silent --show-error --fail --location --output ./vendor/phpstan.phar https://github.com/phpstan/phpstan/releases/download/2.1.2/phpstan.phar \
176+
curl --silent --show-error --fail --location --output ./vendor/phpstan.phar https://github.com/phpstan/phpstan/releases/download/${PHPSTANVER}/phpstan.phar \
174177
&& chmod +x ./vendor/phpstan.phar
175178

176179
# Generate source code documentation
@@ -212,6 +215,7 @@ endif
212215
.PHONY: lint
213216
lint:
214217
./vendor/bin/phpcs --ignore="./vendor/" --standard=phpcs.xml src test
218+
./vendor/bin/phpcbf --config-set ignore_non_auto_fixable_on_exit 1
215219
./vendor/bin/phpmd src text codesize,unusedcode,naming,design --exclude */vendor/*
216220
./vendor/bin/phpmd test text unusedcode,naming,design --exclude */vendor/*
217221
php -r 'exit((int)version_compare(PHP_MAJOR_VERSION, "7", ">"));' || ./vendor/phpstan.phar analyse

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.25
1+
2.0.27

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"require-dev": {
2828
"pdepend/pdepend": "2.16.2",
2929
"phpmd/phpmd": "2.15.0",
30-
"phpunit/phpunit": "12.2.0 || 11.5.7 || 10.5.40",
31-
"squizlabs/php_codesniffer": "3.13.0"
30+
"phpunit/phpunit": "12.4.4 || 11.5.44 || 10.5.58",
31+
"squizlabs/php_codesniffer": "4.0.1"
3232
},
3333
"autoload": {
3434
"psr-4": {

resources/debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Vcs-Git: https://github.com/~#VENDOR#~/~#PROJECT#~.git
1010
Package: ~#PKGNAME#~
1111
Provides: php-~#PROJECT#~
1212
Architecture: all
13-
Depends: php (>= 8.1.0), php-mbstring, php-tecnickcom-tc-lib-unicode-data (<< 3.0.0), php-tecnickcom-tc-lib-unicode-data (>= 2.0.24), ${misc:Depends}
13+
Depends: php (>= 8.1.0), php-mbstring, php-tecnickcom-tc-lib-unicode-data (<< 3.0.0), php-tecnickcom-tc-lib-unicode-data (>= 2.0.26), ${misc:Depends}
1414
Description: PHP Unicode methods.
1515
PHP library containing Unicode methods.

resources/rpm/rpm.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BuildArch: noarch
1818

1919
Requires: php(language) >= 8.1.0
2020
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) < 3.0.0
21-
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) >= 2.0.24
21+
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) >= 2.0.26
2222
Requires: php-pcre
2323
Requires: php-mbstring
2424

src/Bidi.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,13 @@ protected function setInput(
168168
string $forcedir = ''
169169
): void {
170170
if ($str === null) {
171+
$str = '';
171172
if (($chrarr === null || $chrarr === []) && ($ordarr !== null && $ordarr !== [])) {
172173
$chrarr = $this->conv->ordArrToChrArr($ordarr);
173174
}
174-
175-
$str = implode('', $chrarr);
175+
if (!empty($chrarr)) {
176+
$str = implode('', $chrarr);
177+
}
176178
}
177179

178180
if ($chrarr === null || $chrarr === []) {

src/Bidi/Shaping.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function process(): void
7979
$this->combineShadda();
8080
$this->removeDeletedChars();
8181
$this->seq['item'] = array_values($this->newchardata);
82-
unset($this->newchardata);
82+
$this->newchardata = []; // reset
8383
}
8484

8585
/**
@@ -121,6 +121,7 @@ protected function combineShadda(): void
121121
&& ($nxt >= 0) && (isset(UniArabic::DIACRITIC[$nxt]))
122122
) {
123123
$this->newchardata[$idx]['char'] = -1;
124+
// @phpstan-ignore assign.propertyType
124125
$this->newchardata[($idx + 1)]['char'] = UniArabic::DIACRITIC[$nxt];
125126
}
126127
}

src/Bidi/Shaping/Arabic.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,11 @@ protected function setFinalChar(int $idx, ?array $prevchar, array $thischar, arr
212212
&& ($this->seq['item'][($idx - 2)]['char'] == UniArabic::LAM)
213213
) {
214214
// Allah Word
215+
// @phpstan-ignore assign.propertyType
215216
$this->newchardata[($idx - 2)]['char'] = -1;
217+
// @phpstan-ignore assign.propertyType
216218
$this->newchardata[($idx - 1)]['char'] = -1;
219+
// @phpstan-ignore assign.propertyType
217220
$this->newchardata[$idx]['char'] = UniArabic::LIGATURE_ALLAH_ISOLATED_FORM;
218221
} elseif (($prevchar !== null) && in_array($prevchar['char'], UniArabic::END)) {
219222
if (isset($arabicarr[$thischar['char']][0])) {

src/Bidi/StepL.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,12 @@ protected function processL2(): void
151151
// (b) the Bidi_Mirrored property value of that character is true.
152152
$chardatum['char'] = UniMirror::UNI[$chardatum['char']];
153153
}
154-
155154
$reversed[] = $chardatum;
156155
} else {
157156
if ($reversed !== []) {
158157
$ordered = array_merge($ordered, array_reverse($reversed));
159158
$reversed = [];
160159
}
161-
162160
$ordered[] = $chardatum;
163161
}
164162
}

0 commit comments

Comments
 (0)