diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-19 18:47:48 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-19 18:47:48 +0900 |
| commit | fe0352e2db35ed559506c2b477708180768000e8 (patch) | |
| tree | efd3a985b33024914541eaab0bc44de41798a6e7 /crates/shirabe/src/command/package_discovery_trait.rs | |
| parent | d0cd98cd212bc13cbcfd0fd97fc245329b57f50f (diff) | |
| download | php-shirabe-fe0352e2db35ed559506c2b477708180768000e8.tar.gz php-shirabe-fe0352e2db35ed559506c2b477708180768000e8.tar.zst php-shirabe-fe0352e2db35ed559506c2b477708180768000e8.zip | |
fix(show-command): un-ignore 10 tests by fixing show-warnings typing and repo bugs
Replace the PhpMixed-based `$showWarnings` hack in VersionSelector::
findBestCandidate with a typed ShowWarnings enum (Always / Predicate),
letting ShowCommand::findLatestPackage pass its real closure instead of
hardcoding `true`. Fix the --no-dev branch in ShowCommand::execute,
which built `repos` from an empty package list instead of sharing the
same InstalledRepository as `installed_repo`. Pass repository handles
instead of pre-borrowed `&dyn RepositoryInterface` refs into get_package/
generate_package_tree/add_tree to stop a RefCell double-borrow panic on
--all/--locked. Add the missing CompletePackage/RootPackage
set_release_date setter so the outdated sorting-by-age test can set
fixture dates. Resolve OutputFormatterStyleStack::pop's empty-style
todo!() via clone_box(), and fix FileDownloader's cache-GC log call to
pass the VERY_VERBOSE verbosity PHP uses.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/package_discovery_trait.rs')
| -rw-r--r-- | crates/shirabe/src/command/package_discovery_trait.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/shirabe/src/command/package_discovery_trait.rs b/crates/shirabe/src/command/package_discovery_trait.rs index f8f7cede..830f1996 100644 --- a/crates/shirabe/src/command/package_discovery_trait.rs +++ b/crates/shirabe/src/command/package_discovery_trait.rs @@ -10,6 +10,7 @@ use crate::io::io_interface; use crate::package::PackageInterfaceHandle; use crate::package::version::VersionParser; use crate::package::version::VersionSelector; +use crate::package::version::version_selector::ShowWarnings; use crate::repository::CompositeRepository; use crate::repository::PlatformRepository; use crate::repository::PlatformRepositoryHandle; @@ -486,7 +487,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { Some(platform_requirement_filter.clone()), 0, None, - shirabe_php_shim::PhpMixed::Null, + ShowWarnings::Always, )?; if package.is_none() { @@ -544,7 +545,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { Some(PlatformRequirementFilterFactory::ignore_all()), 0, None, - shirabe_php_shim::PhpMixed::Null, + ShowWarnings::Always, )?; if let Some(candidate) = candidate { return Err(InvalidArgumentException { @@ -569,7 +570,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { Some(platform_requirement_filter.clone()), RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES, None, - shirabe_php_shim::PhpMixed::Null, + ShowWarnings::Always, )?; if let Some(package) = package_at_unacceptable { // we must first verify if a valid package would be found in a lower priority repository @@ -580,7 +581,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { Some(PlatformRequirementFilterFactory::ignore_nothing()), RepositorySet::ALLOW_SHADOWED_REPOSITORIES, None, - shirabe_php_shim::PhpMixed::Null, + ShowWarnings::Always, )?; if let Some(all_repos_package) = all_repos_package { return Err(InvalidArgumentException { @@ -620,7 +621,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { Some(PlatformRequirementFilterFactory::ignore_all()), RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES, None, - shirabe_php_shim::PhpMixed::Null, + ShowWarnings::Always, )?; if let Some(candidate) = candidate { let mut additional = String::new(); @@ -631,7 +632,7 @@ pub trait PackageDiscoveryTrait: BaseCommand { Some(PlatformRequirementFilterFactory::ignore_all()), 0, None, - shirabe_php_shim::PhpMixed::Null, + ShowWarnings::Always, )?; if no_match.is_none() { additional = format!( |
