chore(deps): bump zircote/swagger-php from 4.11.1 to 6.0.6 in /src#8118
chore(deps): bump zircote/swagger-php from 4.11.1 to 6.0.6 in /src#8118dependabot[bot] wants to merge 2 commits intomasterfrom
Conversation
Bumps [zircote/swagger-php](https://github.com/zircote/swagger-php) from 4.11.1 to 6.0.6. - [Release notes](https://github.com/zircote/swagger-php/releases) - [Commits](zircote/swagger-php@4.11.1...6.0.6) --- updated-dependencies: - dependency-name: zircote/swagger-php dependency-version: 6.0.6 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
|
@copilot any updates to our software to support this major lib update |
There was a problem hiding this comment.
Pull request overview
Updates the swagger-php dependency to v6 and adjusts ChurchCRM’s OpenAPI generation workflow to remain compatible with the removal of --legacy, then regenerates the published OpenAPI YAML specs.
Changes:
- Bump
zircote/swagger-phpfrom^4.xto^6.0(plus updated lockfile dependency graph). - Replace
vendor/bin/openapi --legacywith a custom generator script (src/api/openapi/generate.php) wired into Composer scripts. - Regenerate
openapi/public-api.yamlandopenapi/private-api.yamlusing the new generation pipeline.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/composer.json |
Updates swagger-php version constraint and switches OpenAPI scripts to the new generator entrypoint. |
src/composer.lock |
Locks updated dependency set for swagger-php v6 and its new transitive requirements. |
src/api/openapi/generate.php |
Adds a custom “legacy-style” docblock scanner intended to replace removed --legacy behavior. |
openapi/public-api.yaml |
Regenerated public OpenAPI spec output. |
openapi/private-api.yaml |
Regenerated private OpenAPI spec output. |
| $options['output'] = $argv[++$i] ?? null; | ||
| break; | ||
| case '--format': | ||
| case '-f': | ||
| $options['format'] = $argv[++$i] ?? 'yaml'; | ||
| break; | ||
| case '--exclude': | ||
| case '-e': | ||
| $options['exclude'][] = $argv[++$i] ?? ''; | ||
| break; | ||
| case '--debug': | ||
| case '-d': | ||
| $options['debug'] = true; | ||
| break; | ||
| case '--version': | ||
| $options['version'] = $argv[++$i] ?? null; |
There was a problem hiding this comment.
--version reads its value via $argv[++$i] without checking that a value follows. If omitted, this can emit an undefined array key warning in PHP 8.4. Consider validating required option values consistently across all flags.
| $options['output'] = $argv[++$i] ?? null; | |
| break; | |
| case '--format': | |
| case '-f': | |
| $options['format'] = $argv[++$i] ?? 'yaml'; | |
| break; | |
| case '--exclude': | |
| case '-e': | |
| $options['exclude'][] = $argv[++$i] ?? ''; | |
| break; | |
| case '--debug': | |
| case '-d': | |
| $options['debug'] = true; | |
| break; | |
| case '--version': | |
| $options['version'] = $argv[++$i] ?? null; | |
| if ($i + 1 >= $argc) { | |
| $error = "Missing value for $arg"; | |
| break 2; | |
| } | |
| $options['output'] = $argv[++$i]; | |
| break; | |
| case '--format': | |
| case '-f': | |
| if ($i + 1 >= $argc) { | |
| $error = "Missing value for $arg"; | |
| break 2; | |
| } | |
| $options['format'] = $argv[++$i]; | |
| break; | |
| case '--exclude': | |
| case '-e': | |
| if ($i + 1 >= $argc) { | |
| $error = "Missing value for $arg"; | |
| break 2; | |
| } | |
| $options['exclude'][] = $argv[++$i]; | |
| break; | |
| case '--debug': | |
| case '-d': | |
| $options['debug'] = true; | |
| break; | |
| case '--version': | |
| if ($i + 1 >= $argc) { | |
| $error = "Missing value for $arg"; | |
| break 2; | |
| } | |
| $options['version'] = $argv[++$i]; |
| $vendorAutoload = __DIR__ . '/../../vendor/autoload.php'; | ||
| if (!file_exists($vendorAutoload)) { | ||
| fwrite(STDERR, "vendor/autoload.php not found. Run `composer install` first.\n"); | ||
| exit(1); | ||
| } | ||
| require_once $vendorAutoload; |
There was a problem hiding this comment.
use import statements must appear before any executable code. Because this file executes require_once $vendorAutoload; and only then declares use OpenApi\..., PHP will throw a parse error. Move the use statements above the autoloader require (or avoid use and reference classes by FQCN).
| $options['output'] = $argv[++$i] ?? null; | ||
| break; | ||
| case '--format': | ||
| case '-f': | ||
| $options['format'] = $argv[++$i] ?? 'yaml'; | ||
| break; | ||
| case '--exclude': | ||
| case '-e': | ||
| $options['exclude'][] = $argv[++$i] ?? ''; | ||
| break; | ||
| case '--debug': | ||
| case '-d': | ||
| $options['debug'] = true; | ||
| break; | ||
| case '--version': | ||
| $options['version'] = $argv[++$i] ?? null; |
There was a problem hiding this comment.
Option parsing uses $argv[++$i] without validating that a value actually follows the flag. If --output (or -o) is the last argument, PHP 8.4 will emit an "Undefined array key" warning and the script may mis-parse subsequent args. Add an explicit bounds check and treat a missing value as an error.
| $options['output'] = $argv[++$i] ?? null; | |
| break; | |
| case '--format': | |
| case '-f': | |
| $options['format'] = $argv[++$i] ?? 'yaml'; | |
| break; | |
| case '--exclude': | |
| case '-e': | |
| $options['exclude'][] = $argv[++$i] ?? ''; | |
| break; | |
| case '--debug': | |
| case '-d': | |
| $options['debug'] = true; | |
| break; | |
| case '--version': | |
| $options['version'] = $argv[++$i] ?? null; | |
| if ($i + 1 >= $argc) { | |
| $error = '--output requires a value'; | |
| break 2; | |
| } | |
| $options['output'] = $argv[++$i]; | |
| break; | |
| case '--format': | |
| case '-f': | |
| if ($i + 1 >= $argc) { | |
| $error = '--format requires a value'; | |
| break 2; | |
| } | |
| $options['format'] = $argv[++$i]; | |
| break; | |
| case '--exclude': | |
| case '-e': | |
| if ($i + 1 >= $argc) { | |
| $error = '--exclude requires a value'; | |
| break 2; | |
| } | |
| $options['exclude'][] = $argv[++$i]; | |
| break; | |
| case '--debug': | |
| case '-d': | |
| $options['debug'] = true; | |
| break; | |
| case '--version': | |
| if ($i + 1 >= $argc) { | |
| $error = '--version requires a value'; | |
| break 2; | |
| } | |
| $options['version'] = $argv[++$i]; |
| $options['output'] = $argv[++$i] ?? null; | ||
| break; | ||
| case '--format': | ||
| case '-f': | ||
| $options['format'] = $argv[++$i] ?? 'yaml'; | ||
| break; | ||
| case '--exclude': | ||
| case '-e': | ||
| $options['exclude'][] = $argv[++$i] ?? ''; | ||
| break; | ||
| case '--debug': | ||
| case '-d': | ||
| $options['debug'] = true; | ||
| break; | ||
| case '--version': | ||
| $options['version'] = $argv[++$i] ?? null; |
There was a problem hiding this comment.
Similar to --output, --format / -f reads the next argv slot via $argv[++$i] without checking it exists. If the value is missing, this triggers an undefined array key warning and silently falls back to yaml. Consider failing fast with a clear error when the value is omitted.
| $options['output'] = $argv[++$i] ?? null; | |
| break; | |
| case '--format': | |
| case '-f': | |
| $options['format'] = $argv[++$i] ?? 'yaml'; | |
| break; | |
| case '--exclude': | |
| case '-e': | |
| $options['exclude'][] = $argv[++$i] ?? ''; | |
| break; | |
| case '--debug': | |
| case '-d': | |
| $options['debug'] = true; | |
| break; | |
| case '--version': | |
| $options['version'] = $argv[++$i] ?? null; | |
| if ($i + 1 >= $argc) { | |
| fwrite(STDERR, "Missing value for $arg option.\n"); | |
| exit(1); | |
| } | |
| $options['output'] = $argv[++$i]; | |
| break; | |
| case '--format': | |
| case '-f': | |
| if ($i + 1 >= $argc) { | |
| fwrite(STDERR, "Missing value for $arg option.\n"); | |
| exit(1); | |
| } | |
| $options['format'] = $argv[++$i]; | |
| break; | |
| case '--exclude': | |
| case '-e': | |
| if ($i + 1 >= $argc) { | |
| fwrite(STDERR, "Missing value for $arg option.\n"); | |
| exit(1); | |
| } | |
| $options['exclude'][] = $argv[++$i]; | |
| break; | |
| case '--debug': | |
| case '-d': | |
| $options['debug'] = true; | |
| break; | |
| case '--version': | |
| if ($i + 1 >= $argc) { | |
| fwrite(STDERR, "Missing value for $arg option.\n"); | |
| exit(1); | |
| } | |
| $options['version'] = $argv[++$i]; |
| break; | ||
| case '--exclude': | ||
| case '-e': | ||
| $options['exclude'][] = $argv[++$i] ?? ''; |
There was a problem hiding this comment.
--exclude / -e also uses $argv[++$i] without validating a following value. If the user forgets to pass a path, the script will add an empty string to the exclude list and may behave unexpectedly. Please validate the option value and surface a user-facing error.
| $options['exclude'][] = $argv[++$i] ?? ''; | |
| $nextIndex = $i + 1; | |
| if ($nextIndex >= $argc || $argv[$nextIndex] === '') { | |
| $error = "Missing path for $arg option."; | |
| break; | |
| } | |
| $i = $nextIndex; | |
| $options['exclude'][] = $argv[$i]; |
Bumps zircote/swagger-php from 4.11.1 to 6.0.6.
Release notes
Sourced from zircote/swagger-php's releases.
... (truncated)
Commits
9447c1fAllow to passContextintoSerializer(#1968)380227fCleanup imports and improve CS rules (#1964)d99f8c3Refactor AbstractAnnotation::identity() (#1962)ec21679Centralize all pure JSON Schema properties (#1960)9a0a612Add missingdeepObjectparameter to attributeParameter(#1957)6c92867Updatenpmtools deps (#1954)6a221d1Fix v6 migration typo: TypeInfoTypeResolver is the default resolver (#1951)f0717a5Fix regression about unexpected items when augmenting parameters (#1949)40d8c82Some code cleanup (#1947)01a7fcdRemove obsolete conditionals aroundTypeInfoTypeResolver(#1945)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)