diff options
Diffstat (limited to 'crates/shirabe/src/package/version')
| -rw-r--r-- | crates/shirabe/src/package/version/mod.rs | 11 | ||||
| -rw-r--r-- | crates/shirabe/src/package/version/version_guesser.rs | 17 | ||||
| -rw-r--r-- | crates/shirabe/src/package/version/version_parser.rs | 6 | ||||
| -rw-r--r-- | crates/shirabe/src/package/version/version_selector.rs | 18 |
4 files changed, 18 insertions, 34 deletions
diff --git a/crates/shirabe/src/package/version/mod.rs b/crates/shirabe/src/package/version/mod.rs deleted file mode 100644 index b2f32a2..0000000 --- a/crates/shirabe/src/package/version/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub mod stability_filter; -pub mod version_bumper; -pub mod version_guesser; -pub mod version_parser; -pub mod version_selector; - -pub use stability_filter::*; -pub use version_bumper::*; -pub use version_guesser::*; -pub use version_parser::*; -pub use version_selector::*; diff --git a/crates/shirabe/src/package/version/version_guesser.rs b/crates/shirabe/src/package/version/version_guesser.rs index 6642201..f18f363 100644 --- a/crates/shirabe/src/package/version/version_guesser.rs +++ b/crates/shirabe/src/package/version/version_guesser.rs @@ -1,14 +1,5 @@ //! ref: composer/src/Composer/Package/Version/VersionGuesser.php -use anyhow::Result; -use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; -use shirabe_php_shim::{ - PHP_INT_MAX, PhpMixed, RuntimeException, array_keys, array_map, array_merge, empty, - function_exists, implode, is_string, json_encode, preg_quote, str_replace, strlen, - strnatcasecmp, strpos, substr, trim, usort, -}; - use crate::config::Config; use crate::io::IOInterface; use crate::io::NullIO; @@ -19,6 +10,14 @@ use crate::util::HttpDownloader; use crate::util::Platform; use crate::util::ProcessExecutor; use crate::util::Svn as SvnUtil; +use anyhow::Result; +use indexmap::IndexMap; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; +use shirabe_php_shim::{ + PHP_INT_MAX, PhpMixed, RuntimeException, array_keys, array_map, array_merge, empty, + function_exists, implode, is_string, json_encode, preg_quote, str_replace, strlen, + strnatcasecmp, strpos, substr, trim, usort, +}; /// Seam over the parts of [`VersionGuesser`] that consumers depend on, so they can be exercised /// with a test double. PHP has no such interface; this exists only to allow mocking the concrete diff --git a/crates/shirabe/src/package/version/version_parser.rs b/crates/shirabe/src/package/version/version_parser.rs index d412d47..3527722 100644 --- a/crates/shirabe/src/package/version/version_parser.rs +++ b/crates/shirabe/src/package/version/version_parser.rs @@ -1,14 +1,12 @@ //! ref: composer/src/Composer/Package/Version/VersionParser.php +use crate::repository::PlatformRepository; use indexmap::IndexMap; -use std::sync::{LazyLock, Mutex}; - use shirabe_external_packages::composer::pcre::Preg; use shirabe_semver::Semver; use shirabe_semver::VersionParser as SemverVersionParser; use shirabe_semver::constraint::AnyConstraint; - -use crate::repository::PlatformRepository; +use std::sync::{LazyLock, Mutex}; static CONSTRAINTS: LazyLock<Mutex<IndexMap<String, AnyConstraint>>> = LazyLock::new(|| Mutex::new(IndexMap::new())); diff --git a/crates/shirabe/src/package/version/version_selector.rs b/crates/shirabe/src/package/version/version_selector.rs index 8a0d037..48b045e 100644 --- a/crates/shirabe/src/package/version/version_selector.rs +++ b/crates/shirabe/src/package/version/version_selector.rs @@ -1,21 +1,12 @@ //! ref: composer/src/Composer/Package/Version/VersionSelector.php -use crate::io::io_interface; - -use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::Preg; -use shirabe_php_shim::{ - PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, strtolower, version_compare, -}; -use shirabe_semver::constraint::AnyConstraint; -use shirabe_semver::constraint::SimpleConstraint; - use crate::filter::platform_requirement_filter::IgnoreAllPlatformRequirementFilter; use crate::filter::platform_requirement_filter::IgnoreListPlatformRequirementFilter; use crate::filter::platform_requirement_filter::PlatformRequirementFilterFactory; use crate::filter::platform_requirement_filter::PlatformRequirementFilterInterface; use crate::io::IOInterface; use crate::io::IOInterfaceImmutable; +use crate::io::io_interface; use crate::package::PackageInterfaceHandle; use crate::package::base_package; use crate::package::dumper::ArrayDumper; @@ -24,6 +15,13 @@ use crate::package::version::VersionParser; use crate::repository::PlatformRepository; use crate::repository::RepositoryInterface; use crate::repository::RepositorySetInterface; +use indexmap::IndexMap; +use shirabe_external_packages::composer::pcre::Preg; +use shirabe_php_shim::{ + PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, strtolower, version_compare, +}; +use shirabe_semver::constraint::AnyConstraint; +use shirabe_semver::constraint::SimpleConstraint; #[derive(Debug)] pub struct VersionSelector { |
