diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-22 19:47:23 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-22 19:47:23 +0900 |
| commit | 3ef7095aa0c8cdb6c1f15d46304bbe8c2e6393d6 (patch) | |
| tree | 4d323bda622be7771549a9c8e91665906dc3772d /crates/shirabe/src/command/create_project_command.rs | |
| parent | 6195e33dfc87cf4b231006b3e5e686a9d8fe2dc1 (diff) | |
| download | php-shirabe-3ef7095aa0c8cdb6c1f15d46304bbe8c2e6393d6.tar.gz php-shirabe-3ef7095aa0c8cdb6c1f15d46304bbe8c2e6393d6.tar.zst php-shirabe-3ef7095aa0c8cdb6c1f15d46304bbe8c2e6393d6.zip | |
fix(package): dispatch get_links_for_type on Link::TYPE_* values
PHP resolves a link kind through `$package->{'get'.ucfirst($linkType)}()`,
so the argument is a `Link::$TYPES` value ("requires", "devRequires", ...).
The helper matched the composer.json key names ("require", "require-dev",
...) instead, so every caller passing a `Link::TYPE_*` constant got an empty
map back: `show <package>` printed none of its requires/provides/conflicts/
replaces sections, and `--format=json` carried none of those keys.
The two callers that were passing composer.json keys now pass the matching
`method`, as PHP does.
Diffstat (limited to 'crates/shirabe/src/command/create_project_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/create_project_command.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs index a2b44713..7f85b17d 100644 --- a/crates/shirabe/src/command/create_project_command.rs +++ b/crates/shirabe/src/command/create_project_command.rs @@ -392,8 +392,8 @@ impl CreateProjectCommand { )?)), false, ); - for (r#type, _meta) in SUPPORTED_LINK_TYPES.iter() { - for link in package.get_links_for_type(r#type).values() { + for (r#type, meta) in SUPPORTED_LINK_TYPES.iter() { + for link in package.get_links_for_type(meta.method).values() { if link.get_pretty_constraint() == "self.version" { config_source.add_link( r#type, |
