Skip to content

Commit 9f9bdce

Browse files
authored
Merge pull request #18 from kynx/renovate/all-minor-patch
Update dependency php to ~8.3.0 || ~8.4.0 || ~8.5.0
2 parents bb63b47 + a26c15a commit 9f9bdce

File tree

133 files changed

+2990
-1977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+2990
-1977
lines changed

composer.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,24 @@
2626
}
2727
},
2828
"require": {
29-
"php": "~8.3.0 || ~8.4.0",
29+
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
3030
"ext-fileinfo": "*",
3131
"composer-runtime-api": "^2.2",
32-
"kynx/code-utils": "^2.3",
33-
"kynx/mezzio-authentication-apikey": "^1.2",
32+
"kynx/code-utils": "^2.4.1",
33+
"kynx/mezzio-authentication-apikey": "^1.3",
3434
"kynx/mezzio-openapi": "^0.8",
35-
"laminas/laminas-cli": "^1.7",
36-
"laminas/laminas-diactoros": "^3.2",
37-
"laminas/laminas-filter": "^2.30",
35+
"laminas/laminas-cli": "^1.11",
36+
"laminas/laminas-diactoros": "^3.6",
37+
"laminas/laminas-filter": "^2.41",
3838
"mezzio/mezzio-authentication-basic": "^1.9",
39-
"nette/php-generator": "^v4.1"
39+
"nette/php-generator": "^4.2"
4040
},
4141
"require-dev": {
42-
"laminas/laminas-coding-standard": "^3.0",
43-
"phpunit/phpunit": "^10.5.37",
44-
"psalm/plugin-phpunit": "^0.19",
42+
"laminas/laminas-coding-standard": "^3.1",
43+
"phpunit/phpunit": "^12.5",
44+
"psalm/plugin-phpunit": "^0.19.5",
4545
"roave/security-advisories": "dev-master",
46-
"squizlabs/php_codesniffer": "^3.10",
47-
"vimeo/psalm": "^5.26"
46+
"vimeo/psalm": "^6.14.2"
4847
},
4948
"autoload": {
5049
"psr-4": {

composer.lock

Lines changed: 2134 additions & 1132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
88
findUnusedBaselineEntry="true"
99
findUnusedCode="true"
10+
ensureOverrideAttribute="false"
1011
>
1112
<projectFiles>
1213
<directory name="src"/>

src/ConfigProvider/ConfigProviderGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Nette\PhpGenerator\PhpNamespace;
1818

1919
use function asort;
20+
use function assert;
2021
use function current;
2122
use function ksort;
2223
use function ltrim;
@@ -47,6 +48,7 @@ public function generate(
4748
->setFinal();
4849

4950
$namespace = current($file->getNamespaces());
51+
assert($namespace instanceof PhpNamespace);
5052
$namespace->addUse(InvokableFactory::class)
5153
->addUse(OpenApiConfigProvider::class)
5254
->addUse(Application::class)

src/GeneratorUtil.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static function getAlias(string $shortName): string
7575

7676
public static function normalizePropertyName(PropertyInterface $property): string
7777
{
78-
return preg_replace('/^\$/', '', $property->getName());
78+
return (string) preg_replace('/^\$/', '', $property->getName());
7979
}
8080

8181
/**
@@ -85,6 +85,6 @@ public static function formatAsList(Dumper $dumper, array $list): string
8585
{
8686
/** @psalm-suppress ImpureMethodCall */
8787
$dump = $dumper->dump($list);
88-
return preg_replace('/^\s*\[(.*)]\s*$/s', '$1', $dump);
88+
return (string) preg_replace('/^\s*\[(.*)]\s*$/s', '$1', $dump);
8989
}
9090
}

src/Handler/HandlerFactoryGenerator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
use Kynx\Mezzio\OpenApi\Attribute\OpenApiHandlerFactory;
88
use Kynx\Mezzio\OpenApi\Serializer\SerializerInterface;
99
use Nette\PhpGenerator\PhpFile;
10+
use Nette\PhpGenerator\PhpNamespace;
1011
use Psr\Container\ContainerInterface;
1112

13+
use function assert;
1214
use function current;
1315

1416
final class HandlerFactoryGenerator
@@ -26,6 +28,7 @@ public function generate(HandlerModel $handler): PhpFile
2628
->addAttribute(OpenApiHandlerFactory::class, [$pointer]);
2729

2830
$namespace = current($file->getNamespaces());
31+
assert($namespace instanceof PhpNamespace);
2932
$namespace->addUse(ContainerInterface::class)
3033
->addUse(OpenApiHandlerFactory::class)
3134
->addUse($operation->getResponseFactoryClassName());

src/Handler/HandlerGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Psr\Http\Message\ServerRequestInterface;
1616
use Psr\Http\Server\RequestHandlerInterface;
1717

18+
use function assert;
1819
use function current;
1920

2021
/**
@@ -41,6 +42,7 @@ public function generate(HandlerModel $handler): PhpFile
4142
->addAttribute(OpenApiHandler::class, [$pointer]);
4243

4344
$namespace = current($file->getNamespaces());
45+
assert($namespace instanceof PhpNamespace);
4446

4547
$namespace->addUse(OpenApiHandler::class)
4648
->addUse(RequestHandlerInterface::class)

src/Model/Property/PropertyBuilder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ public function getProperty(
6161
if (count($types) > 1) {
6262
return new UnionProperty($name, $originalName, $metadata, null, ...$types);
6363
}
64-
return new SimpleProperty($name, $originalName, $metadata, array_pop($types));
64+
65+
$type = array_pop($types);
66+
assert($type instanceof PropertyType);
67+
return new SimpleProperty($name, $originalName, $metadata, $type);
6568
}
6669

6770
if (! empty($schema->oneOf)) {

src/Model/Schema/MediaTypeLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getNamedSpecifications(string $baseName, array $mediaTypes): arr
5757

5858
// add content type to name if they're not all pointing at same schema
5959
if ($numPointers > 1) {
60-
$name = $baseName . ' ' . preg_replace('/[^a-z0-9]+/i', ' ', (string) $type);
60+
$name = $baseName . ' ' . (string) preg_replace('/[^a-z0-9]+/i', ' ', (string) $type);
6161
} else {
6262
$name = $baseName;
6363
}

src/Model/Schema/ResponseLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getNamedSchemas(string $baseName, Response $response): array
5757

5858
public function normalizeHeaderName(string $name): string
5959
{
60-
$parts = preg_split('/[^a-z0-9]+/i', strtolower($name));
60+
$parts = preg_split('/[^a-z0-9]+/i', strtolower($name)) ?: [];
6161
return implode('', array_map('ucfirst', $parts)) . 'Header';
6262
}
6363
}

0 commit comments

Comments
 (0)