aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-06 04:22:46 +0900
committernsfisis <nsfisis@gmail.com>2026-08-06 04:23:22 +0900
commit3d4a0cadc950d4440251efa11b55b0bfb0afdef7 (patch)
treecf1cd680867b9aa633eafe6332b881711b738823 /crates/shirabe/src/package
parentce6192f1cfaac63457b173f573ada661a4665bfb (diff)
downloadphp-shirabe-3d4a0cadc950d4440251efa11b55b0bfb0afdef7.tar.gz
php-shirabe-3d4a0cadc950d4440251efa11b55b0bfb0afdef7.tar.zst
php-shirabe-3d4a0cadc950d4440251efa11b55b0bfb0afdef7.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package')
-rw-r--r--crates/shirabe/src/package/alias_package.rs7
-rw-r--r--crates/shirabe/src/package/loader/array_loader.rs7
-rw-r--r--crates/shirabe/src/package/locker.rs6
-rw-r--r--crates/shirabe/src/package/package_interface.rs29
-rw-r--r--crates/shirabe/src/package/version/version_guesser.rs23
5 files changed, 0 insertions, 72 deletions
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<String, Link>,
@@ -266,19 +262,16 @@ impl PackageInterface for AliasPackage {
}
/// @inheritDoc
- /// @return array<string, Link>
fn get_conflicts(&self) -> IndexMap<String, Link> {
self.conflicts.clone()
}
/// @inheritDoc
- /// @return array<string, Link>
fn get_provides(&self) -> IndexMap<String, Link> {
self.provides.clone()
}
/// @inheritDoc
- /// @return array<string, Link>
fn get_replaces(&self) -> IndexMap<String, Link> {
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<array<mixed>> $versions
- ///
- /// @return list<CompletePackage|CompleteAliasPackage>
#[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<string|int, string> $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<BasePackage::STABILITIES>
pub fn get_minimum_stability(&mut self) -> anyhow::Result<String> {
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<string, string>
pub fn get_platform_overrides(&mut self) -> anyhow::Result<IndexMap<String, String>> {
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<Vec<IndexMap<String, String>>> {
let lock_data = self.get_lock_data()?;
@@ -435,7 +432,6 @@ impl Locker {
.to_string())
}
- /// @return array<string, mixed>
pub fn get_lock_data(&mut self) -> anyhow::Result<IndexMap<String, PhpMixed>> {
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<PhpMixed> {
let mut locked: Vec<IndexMap<String, PhpMixed>> = vec![];
@@ -891,7 +886,6 @@ impl Locker {
Ok(datetime.map(|d| d.format(DATE_RFC3339).to_string()))
}
- /// @return array<string>
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<String>);
/// 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<String>;
/// 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<String>;
/// Returns the repository urls of this package including mirrors, e.g. git://github.com/naderman/composer.git
- ///
- /// @return list<string>
fn get_source_urls(&self) -> Vec<String>;
/// 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<String>;
/// Returns the source mirrors of this package
- ///
- /// @return ?list<array{url: non-empty-string, preferred: bool}>
fn get_source_mirrors(&self) -> Option<Vec<Mirror>>;
- /// @param null|list<array{url: non-empty-string, preferred: bool}> $mirrors
fn set_source_mirrors(&mut self, mirrors: Option<Vec<Mirror>>);
/// 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<String>;
/// Returns the url of the distribution archive of this version
- ///
- /// @return ?non-empty-string
fn get_dist_url(&self) -> Option<String>;
/// Returns the urls of the distribution archive of this version, including mirrors
- ///
- /// @return non-empty-string[]
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
@@ -137,11 +126,8 @@ pub trait PackageInterface: std::fmt::Display + std::fmt::Debug {
fn get_dist_sha1_checksum(&self) -> Option<String>;
/// Returns the dist mirrors of this package
- ///
- /// @return ?list<array{url: non-empty-string, preferred: bool}>
fn get_dist_mirrors(&self) -> Option<Vec<Mirror>>;
- /// @param null|list<array{url: non-empty-string, preferred: bool}> $mirrors
fn set_dist_mirrors(&mut self, mirrors: Option<Vec<Mirror>>);
/// 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<DateTime<Utc>>;
/// 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<string, string>
fn get_suggests(&self) -> IndexMap<String, String>;
/// 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<String, PhpMixed>;
/// 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<String, PhpMixed>;
/// Returns a list of directories which should get added to PHP's
/// include path.
- ///
- /// @return string[]
fn get_include_paths(&self) -> Vec<String>;
/// Returns the settings for php extension packages
- ///
- /// @phpstan-return PhpExtConfig|null
fn get_php_ext(&self) -> Option<IndexMap<String, PhpMixed>>;
/// 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<RepositoryInterfaceHandle>;
/// Returns the package binaries
- ///
- /// @return string[]
fn get_binaries(&self) -> Vec<String>;
/// 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<String, PhpMixed>;
/// Configures the list of options to download package dist files
- ///
- /// @param mixed[] $options
fn set_transport_options(&mut self, options: IndexMap<String, PhpMixed>);
fn set_source_reference(&mut self, reference: Option<String>);
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<string, mixed> $packageConfig
/// @param string $path Path to guess into
- ///
- /// @phpstan-return Version|null
pub fn guess_version(
&mut self,
package_config: &IndexMap<String, PhpMixed>,
@@ -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<string, mixed> $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<String, PhpMixed>,
@@ -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<Option<(String, String)>> {
// try to fetch current version from git tags
let mut output = String::new();
@@ -393,9 +383,6 @@ impl VersionGuesser {
Ok(None)
}
- /// @param array<string, mixed> $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<String, PhpMixed>,
@@ -486,11 +473,6 @@ impl VersionGuesser {
Ok(None)
}
- /// @param array<string, mixed> $packageConfig
- /// @param list<string> $branches
- /// @param list<string> $scmCmdline
- ///
- /// @return array{version: string|null, pretty_version: string|null}
fn guess_feature_version(
&mut self,
package_config: &IndexMap<String, PhpMixed>,
@@ -613,7 +595,6 @@ impl VersionGuesser {
})
}
- /// @param array<string, mixed> $packageConfig
fn is_feature_branch(
&self,
package_config: &IndexMap<String, PhpMixed>,
@@ -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<VersionData> {
let mut version: Option<String> = None;
let mut pretty_version: Option<String> = None;
@@ -688,9 +668,6 @@ impl VersionGuesser {
})
}
- /// @param array<string, mixed> $packageConfig
- ///
- /// @return array{version: string, commit: '', pretty_version: string}|null
fn guess_svn_version(
&mut self,
package_config: &IndexMap<String, PhpMixed>,