diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-03 01:57:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-03 01:57:34 +0900 |
| commit | 26daafaae3713cd94ce32354e6404d95e06c568c (patch) | |
| tree | c2accce206af3492f12317ff8674acf5444b3425 /crates/shirabe/src/command | |
| parent | 8888e4b8bfeb41e4edd45ab47db8a293e93ded3f (diff) | |
| download | php-shirabe-26daafaae3713cd94ce32354e6404d95e06c568c.tar.gz php-shirabe-26daafaae3713cd94ce32354e6404d95e06c568c.tar.zst php-shirabe-26daafaae3713cd94ce32354e6404d95e06c568c.zip | |
feat(downcast): wire package/repo/filter instanceof checks via existing handle/as_any
Resolve three category-4 TODO(phase-b) placeholders that were short-circuited
to None/true, by routing them through downcast mechanisms that already exist:
- package_sorter: PackageInterfaceHandle::as_root() for the
instanceof RootPackageInterface check that adds dev-requires
- platform_repository::is_complete_package: as_complete().is_some(),
consistent with the inlined check already in add_package
- create_project_command: PlatformRequirementFilterInterface::as_any()
downcast to IgnoreAllPlatformRequirementFilter
No new trait infrastructure introduced.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command')
| -rw-r--r-- | crates/shirabe/src/command/create_project_command.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs index e52fe39..90a4d99 100644 --- a/crates/shirabe/src/command/create_project_command.rs +++ b/crates/shirabe/src/command/create_project_command.rs @@ -830,9 +830,11 @@ impl CreateProjectCommand { format!("stability {}", stability) } ); - // TODO(phase-b): `$platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter` - let is_ignore_all: Option<&IgnoreAllPlatformRequirementFilter> = None; - if is_ignore_all.is_none() + let is_ignore_all = platform_requirement_filter + .as_any() + .downcast_ref::<IgnoreAllPlatformRequirementFilter>() + .is_some(); + if !is_ignore_all && version_selector .find_best_candidate( &name, |
