Skip to content

Commit 16e9b1d

Browse files
committed
Flesh out and hook up migration guide for v6
1 parent 5890807 commit 16e9b1d

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

docs/.vitepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function getGuideSidebar() {
2424
{
2525
text: 'Upgrading',
2626
items: [
27+
{ text: 'Migration from 5.x to 6.x', link: '/guide/migrating-to-v6' },
2728
{ text: 'Migration from 4.x to 5.x', link: '/guide/migrating-to-v5' },
2829
{ text: 'Migration from 3.x to 4.x', link: '/guide/migrating-to-v4' },
2930
{ text: 'Migration from 2.x to 3.x', link: '/guide/migrating-to-v3' },

docs/guide/migrating-to-v6.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,15 @@ v6 is mostly a cleanup release with updated dependencies. The main changes are:
1010
For most installations upgrading should not require any changes.
1111

1212
## Removed deprecated elements
13-
### `\Openapi\Generator::getProcessors()` and `\Openapi\Generator::setProcessors()`
13+
### Methods `\Openapi\Generator::getProcessors()` and `\Openapi\Generator::setProcessors()`
1414
Use `getProcessorPipeline()` and `setProcessorPipeline(new Pipeline(...))` methods instead
15+
16+
### Static method `\Openapi\Generator::scan()`
17+
Main entry point into the `Generator` is now the **non-static** `generate()` method:
18+
```php
19+
(new Generator())->generate(/* ... */);
20+
```
21+
22+
### `Utils` helper
23+
Most methods in the class were internal to start with and the `Util::finder()` factory methods is now replaced with
24+
the new `SourceFinder` class.

src/Annotations/AbstractAnnotation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function jsonSerialize()
390390
if (isset($data->type) && is_array($data->type)) {
391391
if (in_array('null', $data->type)) {
392392
$data->nullable = true;
393-
$data->type = array_filter($data->type, fn ($t): bool => 'null' !== $t);
393+
$data->type = array_filter($data->type, fn ($v): bool => $v !== 'null');
394394
if (1 === count($data->type)) {
395395
$data->type = array_pop($data->type);
396396
}

0 commit comments

Comments
 (0)