From 3d4a0cadc950d4440251efa11b55b0bfb0afdef7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 6 Aug 2026 04:22:46 +0900 Subject: chore: drop @param/@return tags that only restate Rust types The ported docblocks copied @param and @return straight from the PHP source. When such a tag carries nothing but a type and an argument name, the Rust signature already states it, so the line is noise. Tags whose text adds prose beyond the type are kept. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/package/alias_package.rs | 7 ------ crates/shirabe/src/package/loader/array_loader.rs | 7 ------ crates/shirabe/src/package/locker.rs | 6 ----- crates/shirabe/src/package/package_interface.rs | 29 ---------------------- .../shirabe/src/package/version/version_guesser.rs | 23 ----------------- 5 files changed, 72 deletions(-) (limited to 'crates/shirabe/src/package') diff --git a/crates/shirabe/src/package/alias_package.rs b/crates/shirabe/src/package/alias_package.rs index ef503b16..8073f3ff 100644 --- a/crates/shirabe/src/package/alias_package.rs +++ b/crates/shirabe/src/package/alias_package.rs @@ -120,10 +120,6 @@ impl AliasPackage { self.root_package_alias } - /// @param Link[] $links - /// @param Link::TYPE_* $linkType - /// - /// @return Link[] pub(crate) fn replace_self_version_dependencies( &mut self, mut links: IndexMap, @@ -266,19 +262,16 @@ impl PackageInterface for AliasPackage { } /// @inheritDoc - /// @return array fn get_conflicts(&self) -> IndexMap { self.conflicts.clone() } /// @inheritDoc - /// @return array fn get_provides(&self) -> IndexMap { self.provides.clone() } /// @inheritDoc - /// @return array fn get_replaces(&self) -> IndexMap { self.replaces.clone() } diff --git a/crates/shirabe/src/package/loader/array_loader.rs b/crates/shirabe/src/package/loader/array_loader.rs index 3ebdc488..f0399e89 100644 --- a/crates/shirabe/src/package/loader/array_loader.rs +++ b/crates/shirabe/src/package/loader/array_loader.rs @@ -189,9 +189,6 @@ impl LoaderInterface for ArrayLoader { } impl ArrayLoader { - /// @param array> $versions - /// - /// @return list #[tracing::instrument(skip_all)] pub fn load_packages( &self, @@ -773,10 +770,6 @@ impl ArrayLoader { /// @param string $sourceVersion source package version (pretty version ideally) /// @param string $description link description (e.g. requires, replaces, ..) /// @param array $links array of package name => constraint mappings - /// - /// @return Link[] - /// - /// @phpstan-param Link::TYPE_* $description pub fn parse_links( &self, source: &str, diff --git a/crates/shirabe/src/package/locker.rs b/crates/shirabe/src/package/locker.rs index d2d1b109..f06f2bdc 100644 --- a/crates/shirabe/src/package/locker.rs +++ b/crates/shirabe/src/package/locker.rs @@ -339,7 +339,6 @@ impl Locker { Ok(requirements.into_iter().map(|(_, v)| v).collect()) } - /// @return key-of pub fn get_minimum_stability(&mut self) -> anyhow::Result { let lock_data = self.get_lock_data()?; @@ -382,7 +381,6 @@ impl Locker { Ok(lock_data.get("prefer-lowest").and_then(|v| v.as_bool())) } - /// @return array pub fn get_platform_overrides(&mut self) -> anyhow::Result> { let lock_data = self.get_lock_data()?; @@ -399,7 +397,6 @@ impl Locker { .unwrap_or_default()) } - /// @return string[][] pub fn get_aliases(&mut self) -> anyhow::Result>> { let lock_data = self.get_lock_data()?; @@ -435,7 +432,6 @@ impl Locker { .to_string()) } - /// @return array pub fn get_lock_data(&mut self) -> anyhow::Result> { if let Some(cache) = self.lock_data_cache.borrow().clone() { return Ok(cache); @@ -719,7 +715,6 @@ impl Locker { lock_data } - /// @param PackageInterface[] $packages fn lock_packages(&mut self, packages: &[PackageInterfaceHandle]) -> anyhow::Result { let mut locked: Vec> = vec![]; @@ -891,7 +886,6 @@ impl Locker { Ok(datetime.map(|d| d.format(DATE_RFC3339).to_string())) } - /// @return array pub fn get_missing_requirement_info( &mut self, package: RootPackageInterfaceHandle, diff --git a/crates/shirabe/src/package/package_interface.rs b/crates/shirabe/src/package/package_interface.rs index 8c9213c0..ffbec286 100644 --- a/crates/shirabe/src/package/package_interface.rs +++ b/crates/shirabe/src/package/package_interface.rs @@ -76,13 +76,11 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { /// Sets source from which this package was installed (source/dist). /// /// @param ?string $type source/dist - /// @phpstan-param 'source'|'dist'|null $type fn set_installation_source(&mut self, r#type: Option); /// Returns source from which this package was installed (source/dist). /// /// @return ?string source/dist - /// @phpstan-return 'source'|'dist'|null fn get_installation_source(&self) -> Option; /// Returns the repository type of this package, e.g. git, svn @@ -96,8 +94,6 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { fn get_source_url(&self) -> Option; /// Returns the repository urls of this package including mirrors, e.g. git://github.com/naderman/composer.git - /// - /// @return list fn get_source_urls(&self) -> Vec; /// Returns the repository reference of this package, e.g. master, 1.0.0 or a commit hash for git @@ -106,11 +102,8 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { fn get_source_reference(&self) -> Option; /// Returns the source mirrors of this package - /// - /// @return ?list fn get_source_mirrors(&self) -> Option>; - /// @param null|list $mirrors fn set_source_mirrors(&mut self, mirrors: Option>); /// Returns the type of the distribution archive of this version, e.g. zip, tarball @@ -119,13 +112,9 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { fn get_dist_type(&self) -> Option; /// Returns the url of the distribution archive of this version - /// - /// @return ?non-empty-string fn get_dist_url(&self) -> Option; /// Returns the urls of the distribution archive of this version, including mirrors - /// - /// @return non-empty-string[] fn get_dist_urls(&self) -> Vec; /// Returns the reference of the distribution archive of this version, e.g. master, 1.0.0 or a commit hash for git @@ -137,11 +126,8 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { fn get_dist_sha1_checksum(&self) -> Option; /// Returns the dist mirrors of this package - /// - /// @return ?list fn get_dist_mirrors(&self) -> Option>; - /// @param null|list $mirrors fn set_dist_mirrors(&mut self, mirrors: Option>); /// Returns the version of this package @@ -167,8 +153,6 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { fn get_release_date(&self) -> Option>; /// Returns the stability of this package: one of (dev, alpha, beta, RC, stable) - /// - /// @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev' fn get_stability(&self) -> &str; /// Returns a set of links to packages which need to be installed before @@ -205,7 +189,6 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { /// combination with this package. /// /// @return array An array of package suggestions with descriptions - /// @phpstan-return array fn get_suggests(&self) -> IndexMap; /// PHP helper that switches on the link kind (require/require-dev/conflict/etc.). @@ -228,7 +211,6 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { /// directories for autoloading using the type specified. /// /// @return array Mapping of autoloading rules - /// @phpstan-return AutoloadRules fn get_autoload(&self) -> IndexMap; /// Returns an associative array of dev autoloading rules @@ -239,18 +221,13 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { /// directories for autoloading using the type specified. /// /// @return array Mapping of dev autoloading rules - /// @phpstan-return DevAutoloadRules fn get_dev_autoload(&self) -> IndexMap; /// Returns a list of directories which should get added to PHP's /// include path. - /// - /// @return string[] fn get_include_paths(&self) -> Vec; /// Returns the settings for php extension packages - /// - /// @phpstan-return PhpExtConfig|null fn get_php_ext(&self) -> Option>; /// Stores a reference to the repository that owns the package @@ -260,8 +237,6 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { fn get_repository(&self) -> Option; /// Returns the package binaries - /// - /// @return string[] fn get_binaries(&self) -> Vec; /// Returns package unique name, constructed from name and version. @@ -278,13 +253,9 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug { fn is_default_branch(&self) -> bool; /// Returns a list of options to download package dist files - /// - /// @return mixed[] fn get_transport_options(&self) -> IndexMap; /// Configures the list of options to download package dist files - /// - /// @param mixed[] $options fn set_transport_options(&mut self, options: IndexMap); fn set_source_reference(&mut self, reference: Option); diff --git a/crates/shirabe/src/package/version/version_guesser.rs b/crates/shirabe/src/package/version/version_guesser.rs index 22b78a59..98853952 100644 --- a/crates/shirabe/src/package/version/version_guesser.rs +++ b/crates/shirabe/src/package/version/version_guesser.rs @@ -94,10 +94,7 @@ impl VersionGuesser { } } - /// @param array $packageConfig /// @param string $path Path to guess into - /// - /// @phpstan-return Version|null pub fn guess_version( &mut self, package_config: &IndexMap, @@ -145,9 +142,6 @@ impl VersionGuesser { Ok(None) } - /// @phpstan-param Version $versionData - /// - /// @phpstan-return Version fn postprocess(&self, mut version_data: VersionData) -> VersionData { // PHP: !empty($versionData['feature_version']) && $versionData['feature_version'] === $versionData['version'] && $versionData['feature_pretty_version'] === $versionData['pretty_version'] let feature_matches = version_data @@ -202,9 +196,6 @@ impl VersionGuesser { version_data } - /// @param array $packageConfig - /// - /// @return array{version: string|null, commit: string|null, pretty_version: string|null, feature_version?: string|null, feature_pretty_version?: string|null} fn guess_git_version( &mut self, package_config: &IndexMap, @@ -370,7 +361,6 @@ impl VersionGuesser { }) } - /// @return array{version: string, pretty_version: string}|null fn version_from_git_tags(&mut self, path: &str) -> anyhow::Result> { // try to fetch current version from git tags let mut output = String::new(); @@ -393,9 +383,6 @@ impl VersionGuesser { Ok(None) } - /// @param array $packageConfig - /// - /// @return array{version: string|null, commit: ''|null, pretty_version: string|null, feature_version?: string|null, feature_pretty_version?: string|null}|null fn guess_hg_version( &mut self, package_config: &IndexMap, @@ -486,11 +473,6 @@ impl VersionGuesser { Ok(None) } - /// @param array $packageConfig - /// @param list $branches - /// @param list $scmCmdline - /// - /// @return array{version: string|null, pretty_version: string|null} fn guess_feature_version( &mut self, package_config: &IndexMap, @@ -613,7 +595,6 @@ impl VersionGuesser { }) } - /// @param array $packageConfig fn is_feature_branch( &self, package_config: &IndexMap, @@ -642,7 +623,6 @@ impl VersionGuesser { ) } - /// @return array{version: string|null, commit: '', pretty_version: string|null} fn guess_fossil_version(&mut self, path: &str) -> anyhow::Result { let mut version: Option = None; let mut pretty_version: Option = None; @@ -688,9 +668,6 @@ impl VersionGuesser { }) } - /// @param array $packageConfig - /// - /// @return array{version: string, commit: '', pretty_version: string}|null fn guess_svn_version( &mut self, package_config: &IndexMap, -- cgit v1.3.1