aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package/package_interface.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-28 16:32:33 +0900
committernsfisis <nsfisis@gmail.com>2026-06-28 16:32:59 +0900
commit212f5cd75b1403ee75ffa44d7ebdb181174340c0 (patch)
tree9a92a3e2b395f6c4fb652330f9a1d9d407d43088 /crates/shirabe/src/package/package_interface.rs
parente2955f0acb9e82448b1f72354e7e8dd6ab229ad5 (diff)
downloadphp-shirabe-212f5cd75b1403ee75ffa44d7ebdb181174340c0.tar.gz
php-shirabe-212f5cd75b1403ee75ffa44d7ebdb181174340c0.tar.zst
php-shirabe-212f5cd75b1403ee75ffa44d7ebdb181174340c0.zip
feat(package): impl alias getter delegation via owned String returns
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/package_interface.rs')
-rw-r--r--crates/shirabe/src/package/package_interface.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/shirabe/src/package/package_interface.rs b/crates/shirabe/src/package/package_interface.rs
index 621c73f..42a2ca2 100644
--- a/crates/shirabe/src/package/package_interface.rs
+++ b/crates/shirabe/src/package/package_interface.rs
@@ -84,17 +84,17 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug {
///
/// @return ?string source/dist
/// @phpstan-return 'source'|'dist'|null
- fn get_installation_source(&self) -> Option<&str>;
+ fn get_installation_source(&self) -> Option<String>;
/// Returns the repository type of this package, e.g. git, svn
///
/// @return ?string The repository type
- fn get_source_type(&self) -> Option<&str>;
+ fn get_source_type(&self) -> Option<String>;
/// Returns the repository url of this package, e.g. git://github.com/naderman/composer.git
///
/// @return ?string The repository url
- fn get_source_url(&self) -> Option<&str>;
+ fn get_source_url(&self) -> Option<String>;
/// Returns the repository urls of this package including mirrors, e.g. git://github.com/naderman/composer.git
///
@@ -104,7 +104,7 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug {
/// Returns the repository reference of this package, e.g. master, 1.0.0 or a commit hash for git
///
/// @return ?string The repository reference
- fn get_source_reference(&self) -> Option<&str>;
+ fn get_source_reference(&self) -> Option<String>;
/// Returns the source mirrors of this package
///
@@ -117,12 +117,12 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug {
/// Returns the type of the distribution archive of this version, e.g. zip, tarball
///
/// @return ?string The repository type
- fn get_dist_type(&self) -> Option<&str>;
+ fn get_dist_type(&self) -> Option<String>;
/// Returns the url of the distribution archive of this version
///
/// @return ?non-empty-string
- fn get_dist_url(&self) -> Option<&str>;
+ fn get_dist_url(&self) -> Option<String>;
/// Returns the urls of the distribution archive of this version, including mirrors
///
@@ -130,12 +130,12 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug {
fn get_dist_urls(&self) -> Vec<String>;
/// Returns the reference of the distribution archive of this version, e.g. master, 1.0.0 or a commit hash for git
- fn get_dist_reference(&self) -> Option<&str>;
+ fn get_dist_reference(&self) -> Option<String>;
/// Returns the sha1 checksum for the distribution archive of this version
///
/// Can be an empty string which should be treated as null
- fn get_dist_sha1_checksum(&self) -> Option<&str>;
+ fn get_dist_sha1_checksum(&self) -> Option<String>;
/// Returns the dist mirrors of this package
///
@@ -269,7 +269,7 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug {
fn get_unique_name(&self) -> String;
/// Returns the package notification url
- fn get_notification_url(&self) -> Option<&str>;
+ fn get_notification_url(&self) -> Option<String>;
// PHP: __toString — implemented via std::fmt::Display supertrait
@@ -299,7 +299,7 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug {
fn set_dist_reference(&mut self, reference: Option<String>);
/// Set dist and source references and update dist URL for ones that contain a reference
- fn set_source_dist_references(&mut self, reference: &str);
+ fn set_source_dist_references(&mut self, reference: String);
fn as_alias_package(&self) -> Option<&crate::package::AliasPackage> {
None