diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:10:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-19 00:11:03 +0900 |
| commit | c839244d8d09f3036ebfee8eef7eb6b147e593ab (patch) | |
| tree | fe48c94f2c2e62468beef5ff1a8f3cff6adeef4f /crates/shirabe/src/package/package_interface.rs | |
| parent | 48839250146b217e2756ed3c0e624fd341b54d6c (diff) | |
| download | php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.gz php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.tar.zst php-shirabe-c839244d8d09f3036ebfee8eef7eb6b147e593ab.zip | |
fix(compile): fix various compile errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/package_interface.rs')
| -rw-r--r-- | crates/shirabe/src/package/package_interface.rs | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/crates/shirabe/src/package/package_interface.rs b/crates/shirabe/src/package/package_interface.rs index 6a07556..c6ccce8 100644 --- a/crates/shirabe/src/package/package_interface.rs +++ b/crates/shirabe/src/package/package_interface.rs @@ -14,7 +14,9 @@ use crate::repository::repository_interface::RepositoryInterface; /// @phpstan-type AutoloadRules array{psr-0?: array<string, string|string[]>, psr-4?: array<string, string|string[]>, classmap?: list<string>, files?: list<string>, exclude-from-classmap?: list<string>} /// @phpstan-type DevAutoloadRules array{psr-0?: array<string, string|string[]>, psr-4?: array<string, string|string[]>, classmap?: list<string>, files?: list<string>} /// @phpstan-type PhpExtConfig array{extension-name?: string, priority?: int, support-zts?: bool, support-nts?: bool, build-path?: string|null, download-url-method?: string|list<string>, os-families?: non-empty-list<non-empty-string>, os-families-exclude?: non-empty-list<non-empty-string>, configure-options?: list<array{name: string, description?: string}>} -pub trait PackageInterface: std::fmt::Display { +pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { + fn as_any(&self) -> &dyn std::any::Any; + /// Returns the package's name without version info, thus not a unique identifier /// /// @return string package name @@ -170,20 +172,20 @@ pub trait PackageInterface: std::fmt::Display { /// Returns a set of links to packages which must not be installed at the /// same time as this package /// - /// @return Link[] An array of package links defining conflicting packages - fn get_conflicts(&self) -> Vec<Link>; + /// @return array<string, Link> A map of package links defining conflicting packages + fn get_conflicts(&self) -> IndexMap<String, Link>; /// Returns a set of links to virtual packages that are provided through /// this package /// - /// @return Link[] An array of package links defining provided packages - fn get_provides(&self) -> Vec<Link>; + /// @return array<string, Link> A map of package links defining provided packages + fn get_provides(&self) -> IndexMap<String, Link>; /// Returns a set of links to packages which can alternatively be /// satisfied by installing this package /// - /// @return Link[] An array of package links defining replaced packages - fn get_replaces(&self) -> Vec<Link>; + /// @return array<string, Link> A map of package links defining replaced packages + fn get_replaces(&self) -> IndexMap<String, Link>; /// Returns a set of links to packages which are required to develop /// this package. These are installed if in dev mode. @@ -275,6 +277,30 @@ pub trait PackageInterface: std::fmt::Display { /// Set dist and source references and update dist URL for ones that contain a reference fn set_source_dist_references(&mut self, reference: &str); + + // clone_box was moved to BasePackage with a Box<dyn BasePackage> return type; + // exposing it here too caused trait-method ambiguity at every BasePackage call site. + // Callers holding `&dyn PackageInterface` (rather than `&dyn BasePackage`) can use + // `clone_package_box` instead. + fn clone_package_box(&self) -> Box<dyn PackageInterface> { + todo!() + } + + fn as_alias_package(&self) -> Option<&crate::package::alias_package::AliasPackage> { + None + } + + fn as_complete_package_interface( + &self, + ) -> Option<&dyn crate::package::complete_package_interface::CompletePackageInterface> { + None + } + + fn as_complete_package( + &self, + ) -> Option<&dyn crate::package::complete_package_interface::CompletePackageInterface> { + None + } } impl dyn PackageInterface { |
