Skip to content

Commit bfee215

Browse files
committed
Fix psalm / CI issues
1 parent 7a6e77b commit bfee215

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

.github/workflows/tests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ jobs:
2525
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.dependency-preference == 'lowest' && '--prefer-lowest' || '' }} ${{ matrix.dependency-preference == 'stable' && '--prefer-stable' || '' }} ${{ matrix.composer-options }}
2626
- name: Run the tests
2727
run: ./vendor/bin/phpunit
28-
continue-on-error: ${{ matrix.php-versions == '8.5'}}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"psalm/plugin-symfony": "^5.0",
3232
"php-standard-library/psalm-plugin": "^2.2",
3333
"vimeo/psalm": "~6.13.0",
34-
"phpunit/phpunit": "~12.3.0",
34+
"phpunit/phpunit": "~12.4.0",
3535
"php-cs-fixer/shim": "~3.88.0"
3636
},
3737
"license": "MIT",

src/Console/UI/Components/MetaTable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use ReflectionProperty;
1616
use Throwable;
1717
use function Psl\Dict\filter_nulls;
18+
use function Psl\Json\encode;
1819
use function Psl\Vec\map;
1920

2021
final readonly class MetaTable
@@ -71,7 +72,7 @@ private static function tryStringifyValue(mixed $value): ?string
7172
{
7273
try {
7374
return match (true) {
74-
is_array($value) => json_encode($value, JSON_UNESCAPED_SLASHES),
75+
is_array($value) => encode($value, pretty: false, flags: JSON_UNESCAPED_SLASHES),
7576
is_bool($value) => $value ? 'true' : 'false',
7677
is_scalar($value) => (string)$value,
7778
$value instanceof Option => $value->map(self::tryStringifyValue(...))->unwrapOr(null),

src/Console/UI/Components/ScrollableTextAreaState.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use PhpTui\Term\MouseEventKind;
77
use Soap\WsdlReader\Console\UI\EventHandler;
88

9-
use function json_encode;
9+
use function Psl\Json\encode;
1010
use function Psl\Math\max;
1111
use function Psl\Math\min;
1212

@@ -21,7 +21,7 @@ public function __construct(
2121
public static function json(mixed $data, string $fallback): self
2222
{
2323
return new self(
24-
$data !== null ? json_encode($data, JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES) : $fallback,
24+
$data !== null ? encode($data, pretty: true, flags: JSON_UNESCAPED_SLASHES) : $fallback,
2525
);
2626
}
2727

src/Formatter/MetaTableFormatter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Symfony\Component\Console\Helper\Table;
1010
use Symfony\Component\Console\Output\OutputInterface;
1111
use Throwable;
12+
use function Psl\Json\encode;
1213
use function Psl\Vec\filter_nulls;
1314
use function Psl\Vec\map;
1415

@@ -56,7 +57,7 @@ private function tryStringifyValue(mixed $value): ?string
5657
{
5758
try {
5859
return match (true) {
59-
is_array($value) => json_encode($value, JSON_PRETTY_PRINT),
60+
is_array($value) => encode($value, pretty: true),
6061
is_bool($value) => $value ? 'true' : 'false',
6162
is_scalar($value) => (string)$value,
6263
$value instanceof Option => $value->map($this->tryStringifyValue(...))->unwrapOr(null),

tests/PhpCompatibility/test_schema.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ use Soap\WsdlReader\Formatter\ShortMethodFormatter;
88
use Soap\WsdlReader\Metadata\Wsdl1MetadataProvider;
99
use Soap\WsdlReader\Wsdl1Reader;
1010

11+
// Avoid deprecated warnings to be displayed during the test output for the loaded dependencies.
12+
// This is causing issues on lower dependencies.
13+
$previousReporting = error_reporting(E_ALL ^ E_DEPRECATED);
1114
require_once __DIR__.'/../bootstrap.php';
15+
error_reporting($previousReporting);
1216

1317
function test_schema($schema, $type, $style="rpc",$use="encoded", $attributeFormDefault='')
1418
{

0 commit comments

Comments
 (0)