aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe-php-rpc/src/lib.rs2
-rw-r--r--crates/shirabe-php-shim/src/lib.rs20
-rw-r--r--crates/shirabe-seld-json-lint/src/parsing_exception.rs2
-rw-r--r--crates/shirabe-semver/src/constraint/simple_constraint.rs4
-rw-r--r--crates/shirabe-symfony-console/src/helper/helper.rs2
-rw-r--r--crates/shirabe-symfony-console/src/helper/question_helper.rs6
-rw-r--r--crates/shirabe-symfony-console/src/helper/table_cell.rs2
-rw-r--r--crates/shirabe-symfony-console/src/input/array_input.rs2
-rw-r--r--crates/shirabe-symfony-console/src/input/input.rs4
-rw-r--r--crates/shirabe-symfony-console/src/input/string_input.rs2
-rw-r--r--crates/shirabe-symfony-console/src/output/stream_output.rs2
-rw-r--r--crates/shirabe-symfony-process/src/lib.rs4
-rw-r--r--crates/shirabe-symfony-string/src/byte_string.rs2
-rw-r--r--crates/shirabe-symfony-string/src/unicode_string.rs2
-rw-r--r--crates/shirabe/src/autoload/autoload_generator.rs32
-rw-r--r--crates/shirabe/src/cache.rs2
-rw-r--r--crates/shirabe/src/command/base_command.rs10
-rw-r--r--crates/shirabe/src/command/config_command.rs13
-rw-r--r--crates/shirabe/src/command/create_project_command.rs2
-rw-r--r--crates/shirabe/src/command/diagnose_command.rs8
-rw-r--r--crates/shirabe/src/command/init_command.rs13
-rw-r--r--crates/shirabe/src/command/show_command.rs34
-rw-r--r--crates/shirabe/src/console/application.rs12
-rw-r--r--crates/shirabe/src/console/github_action_error.rs2
-rw-r--r--crates/shirabe/src/console/input.rs4
-rw-r--r--crates/shirabe/src/dependency_resolver/decisions.rs6
-rw-r--r--crates/shirabe/src/dependency_resolver/default_policy.rs12
-rw-r--r--crates/shirabe/src/dependency_resolver/generic_rule.rs2
-rw-r--r--crates/shirabe/src/dependency_resolver/lock_transaction.rs6
-rw-r--r--crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs2
-rw-r--r--crates/shirabe/src/dependency_resolver/operation/install_operation.rs2
-rw-r--r--crates/shirabe/src/dependency_resolver/operation/mark_alias_installed_operation.rs2
-rw-r--r--crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs2
-rw-r--r--crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs2
-rw-r--r--crates/shirabe/src/dependency_resolver/operation/update_operation.rs4
-rw-r--r--crates/shirabe/src/dependency_resolver/pool.rs14
-rw-r--r--crates/shirabe/src/dependency_resolver/problem.rs10
-rw-r--r--crates/shirabe/src/dependency_resolver/request.rs14
-rw-r--r--crates/shirabe/src/dependency_resolver/rule.rs6
-rw-r--r--crates/shirabe/src/dependency_resolver/rule_set.rs6
-rw-r--r--crates/shirabe/src/dependency_resolver/rule_set_generator.rs18
-rw-r--r--crates/shirabe/src/dependency_resolver/rule_set_iterator.rs10
-rw-r--r--crates/shirabe/src/dependency_resolver/rule_watch_graph.rs4
-rw-r--r--crates/shirabe/src/dependency_resolver/rule_watch_node.rs2
-rw-r--r--crates/shirabe/src/dependency_resolver/solver.rs24
-rw-r--r--crates/shirabe/src/dependency_resolver/solver_problems_exception.rs4
-rw-r--r--crates/shirabe/src/dependency_resolver/transaction.rs14
-rw-r--r--crates/shirabe/src/downloader/download_manager.rs7
-rw-r--r--crates/shirabe/src/downloader/file_downloader.rs6
-rw-r--r--crates/shirabe/src/downloader/git_downloader.rs16
-rw-r--r--crates/shirabe/src/downloader/path_downloader.rs4
-rw-r--r--crates/shirabe/src/downloader/perforce_downloader.rs2
-rw-r--r--crates/shirabe/src/downloader/svn_downloader.rs6
-rw-r--r--crates/shirabe/src/downloader/transport_exception.rs8
-rw-r--r--crates/shirabe/src/event_dispatcher/event.rs6
-rw-r--r--crates/shirabe/src/event_dispatcher/event_dispatcher.rs12
-rw-r--r--crates/shirabe/src/installer.rs88
-rw-r--r--crates/shirabe/src/installer/binary_installer.rs20
-rw-r--r--crates/shirabe/src/installer/library_installer.rs23
-rw-r--r--crates/shirabe/src/io/console_io.rs4
-rw-r--r--crates/shirabe/src/json.rs2
-rw-r--r--crates/shirabe/src/json/json_file.rs2
-rw-r--r--crates/shirabe/src/json/json_manipulator.rs2
-rw-r--r--crates/shirabe/src/json/json_validation_exception.rs2
-rw-r--r--crates/shirabe/src/package/alias_package.rs12
-rw-r--r--crates/shirabe/src/package/archiver/archivable_files_finder.rs2
-rw-r--r--crates/shirabe/src/package/archiver/archive_manager.rs8
-rw-r--r--crates/shirabe/src/package/complete_package.rs24
-rw-r--r--crates/shirabe/src/package/link.rs10
-rw-r--r--crates/shirabe/src/package/loader/array_loader.rs2
-rw-r--r--crates/shirabe/src/package/package.rs64
-rw-r--r--crates/shirabe/src/package/root_package.rs12
-rw-r--r--crates/shirabe/src/plugin/php_plugin_proxy.rs14
-rw-r--r--crates/shirabe/src/plugin/plugin_manager.rs18
-rw-r--r--crates/shirabe/src/repository/array_repository.rs4
-rw-r--r--crates/shirabe/src/repository/artifact_repository.rs6
-rw-r--r--crates/shirabe/src/repository/composer_repository.rs28
-rw-r--r--crates/shirabe/src/repository/filesystem_repository.rs2
-rw-r--r--crates/shirabe/src/repository/path_repository.rs2
-rw-r--r--crates/shirabe/src/repository/platform_repository.rs14
-rw-r--r--crates/shirabe/src/repository/repository_set.rs14
-rw-r--r--crates/shirabe/src/repository/vcs/forgejo_driver.rs14
-rw-r--r--crates/shirabe/src/repository/vcs/fossil_driver.rs16
-rw-r--r--crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs8
-rw-r--r--crates/shirabe/src/repository/vcs/github_driver.rs34
-rw-r--r--crates/shirabe/src/repository/vcs/gitlab_driver.rs25
-rw-r--r--crates/shirabe/src/repository/vcs/hg_driver.rs10
-rw-r--r--crates/shirabe/src/repository/vcs/perforce_driver.rs6
-rw-r--r--crates/shirabe/src/repository/vcs/svn_driver.rs28
-rw-r--r--crates/shirabe/src/repository/vcs_repository.rs28
-rw-r--r--crates/shirabe/src/util/auth_helper.rs4
-rw-r--r--crates/shirabe/src/util/filesystem.rs8
-rw-r--r--crates/shirabe/src/util/git.rs10
-rw-r--r--crates/shirabe/src/util/gitlab.rs8
-rw-r--r--crates/shirabe/src/util/no_proxy_pattern.rs17
-rw-r--r--crates/shirabe/src/util/perforce.rs44
-rw-r--r--crates/shirabe/src/util/process_executor.rs6
-rw-r--r--crates/shirabe/src/util/svn.rs35
-rw-r--r--crates/shirabe/tests/plugin/plugin_installer_test.rs4
99 files changed, 531 insertions, 574 deletions
diff --git a/crates/shirabe-php-rpc/src/lib.rs b/crates/shirabe-php-rpc/src/lib.rs
index f95a9d45..34c3961d 100644
--- a/crates/shirabe-php-rpc/src/lib.rs
+++ b/crates/shirabe-php-rpc/src/lib.rs
@@ -593,7 +593,7 @@ pub fn get_all_ini_files() -> Vec<String> {
/// `Composer\XdebugHandler\XdebugHandler::isXdebugActive()` as measured in the worker, which is
/// the process Xdebug is loaded into.
-pub(crate) fn xdebug_active() -> bool {
+fn xdebug_active() -> bool {
match call("xdebug_active", "") {
PhpMixed::Bool(b) => b,
other => panic!("PHP RPC: `xdebug_active` did not return a bool: {other:?}"),
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs
index 63e4226e..b9613053 100644
--- a/crates/shirabe-php-shim/src/lib.rs
+++ b/crates/shirabe-php-shim/src/lib.rs
@@ -402,7 +402,7 @@ impl PhpResource {
/// Returns the underlying OS file descriptor backing this resource, when it has one.
/// Used by `stream_set_blocking`/`stream_select` to drive `fcntl(2)`/`select(2)`. In-memory
/// streams (`php://memory`/`php://temp`) and process handles have no fd and return `None`.
- pub(crate) fn raw_fd(&self) -> Option<std::os::unix::io::RawFd> {
+ fn raw_fd(&self) -> Option<std::os::unix::io::RawFd> {
use std::os::unix::io::AsRawFd;
match self {
PhpResource::Stdin => Some(std::io::stdin().as_raw_fd()),
@@ -442,7 +442,7 @@ pub enum StreamBacking {
}
impl StreamBacking {
- pub(crate) fn as_rws(&mut self) -> &mut dyn ReadWriteSeek {
+ fn as_rws(&mut self) -> &mut dyn ReadWriteSeek {
match self {
StreamBacking::File(f) => f,
StreamBacking::Memory(c) => c,
@@ -515,23 +515,23 @@ impl std::os::unix::io::AsRawFd for ChildPipe {
#[derive(Debug)]
pub struct StreamState {
- pub(crate) backing: StreamBacking,
+ backing: StreamBacking,
/// Whether the mode opened the stream for reading.
- pub(crate) readable: bool,
+ readable: bool,
/// Whether the mode opened the stream for writing.
- pub(crate) writable: bool,
+ writable: bool,
/// Set once a read attempt sees end-of-stream, mirroring PHP's `feof()` which
/// only reports true after a read has hit the end; cleared by a seek.
- pub(crate) eof: bool,
- pub(crate) closed: bool,
+ eof: bool,
+ closed: bool,
/// The mode string passed to `fopen`, reported back by `stream_get_meta_data`.
- pub(crate) mode: String,
+ mode: String,
/// The path/URI the stream was opened from, reported back by `stream_get_meta_data`.
- pub(crate) uri: String,
+ uri: String,
}
impl StreamState {
- pub(crate) fn new(
+ fn new(
backing: StreamBacking,
readable: bool,
writable: bool,
diff --git a/crates/shirabe-seld-json-lint/src/parsing_exception.rs b/crates/shirabe-seld-json-lint/src/parsing_exception.rs
index 9d3eaa57..7038f04a 100644
--- a/crates/shirabe-seld-json-lint/src/parsing_exception.rs
+++ b/crates/shirabe-seld-json-lint/src/parsing_exception.rs
@@ -26,7 +26,7 @@ pub struct ParsingExceptionDetails {
#[derive(Debug)]
pub struct ParsingException {
inner: shirabe_php_shim::Exception,
- pub(crate) details: Box<ParsingExceptionDetails>,
+ details: Box<ParsingExceptionDetails>,
}
impl ParsingException {
diff --git a/crates/shirabe-semver/src/constraint/simple_constraint.rs b/crates/shirabe-semver/src/constraint/simple_constraint.rs
index fa08ce85..049c6519 100644
--- a/crates/shirabe-semver/src/constraint/simple_constraint.rs
+++ b/crates/shirabe-semver/src/constraint/simple_constraint.rs
@@ -6,8 +6,8 @@ use shirabe_php_shim::{CmpOp, var_export_str, version_compare};
/// Corresponds to PHP's `Constraint`.
#[derive(Debug, Clone)]
pub struct SimpleConstraint {
- pub(crate) operator: CmpOp,
- pub(crate) version: String,
+ operator: CmpOp,
+ version: String,
pub(crate) pretty_string: Option<String>,
}
diff --git a/crates/shirabe-symfony-console/src/helper/helper.rs b/crates/shirabe-symfony-console/src/helper/helper.rs
index c92b7cb1..4f0447f3 100644
--- a/crates/shirabe-symfony-console/src/helper/helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/helper.rs
@@ -8,7 +8,7 @@ use shirabe_symfony_string::unicode_string::UnicodeString;
/// Helper is the base class for all helper classes.
#[derive(Debug, Default)]
pub struct Helper {
- pub(crate) helper_set: Option<std::rc::Rc<std::cell::RefCell<HelperSet>>>,
+ helper_set: Option<std::rc::Rc<std::cell::RefCell<HelperSet>>>,
}
impl Helper {
diff --git a/crates/shirabe-symfony-console/src/helper/question_helper.rs b/crates/shirabe-symfony-console/src/helper/question_helper.rs
index c051fff2..6e28049e 100644
--- a/crates/shirabe-symfony-console/src/helper/question_helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/question_helper.rs
@@ -24,7 +24,7 @@ use shirabe_symfony_string::s;
/// The QuestionHelper class provides helpers to interact with the user.
#[derive(Debug, Default)]
pub struct QuestionHelper {
- pub(crate) inner: Helper,
+ inner: Helper,
/// @var resource|null
input_stream: Option<shirabe_php_shim::PhpResource>,
@@ -352,7 +352,7 @@ impl QuestionHelper {
}
/// Outputs the question prompt.
- pub(crate) fn write_prompt(
+ fn write_prompt(
&self,
output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>,
question: &impl QuestionInterface,
@@ -403,7 +403,7 @@ impl QuestionHelper {
}
/// Outputs an error message.
- pub(crate) fn write_error(
+ fn write_error(
&self,
output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>,
error: &shirabe_php_shim::Exception,
diff --git a/crates/shirabe-symfony-console/src/helper/table_cell.rs b/crates/shirabe-symfony-console/src/helper/table_cell.rs
index fdcda7b8..3081c26a 100644
--- a/crates/shirabe-symfony-console/src/helper/table_cell.rs
+++ b/crates/shirabe-symfony-console/src/helper/table_cell.rs
@@ -14,7 +14,7 @@ pub enum TableCellOption {
#[derive(Debug, Clone)]
pub struct TableCell {
- pub(crate) value: String,
+ value: String,
options: IndexMap<String, TableCellOption>,
}
diff --git a/crates/shirabe-symfony-console/src/input/array_input.rs b/crates/shirabe-symfony-console/src/input/array_input.rs
index e19381a9..a032432b 100644
--- a/crates/shirabe-symfony-console/src/input/array_input.rs
+++ b/crates/shirabe-symfony-console/src/input/array_input.rs
@@ -21,7 +21,7 @@ use shirabe_php_shim::PhpMixed;
/// key type (`PhpMixed::Int` / `PhpMixed::String`) and the insertion order.
#[derive(Debug, Clone)]
pub struct ArrayInput {
- pub(crate) inner: Input,
+ inner: Input,
parameters: Vec<(PhpMixed, PhpMixed)>,
}
diff --git a/crates/shirabe-symfony-console/src/input/input.rs b/crates/shirabe-symfony-console/src/input/input.rs
index 0da2b95c..7744a4f1 100644
--- a/crates/shirabe-symfony-console/src/input/input.rs
+++ b/crates/shirabe-symfony-console/src/input/input.rs
@@ -16,10 +16,10 @@ use shirabe_php_shim::{PhpMixed, PhpResource, php_regex};
#[derive(Debug, Clone)]
pub struct Input {
pub(crate) definition: InputDefinition,
- pub(crate) stream: Option<PhpResource>,
+ stream: Option<PhpResource>,
pub(crate) options: IndexMap<String, PhpMixed>,
pub(crate) arguments: IndexMap<String, PhpMixed>,
- pub(crate) interactive: bool,
+ interactive: bool,
}
impl Input {
diff --git a/crates/shirabe-symfony-console/src/input/string_input.rs b/crates/shirabe-symfony-console/src/input/string_input.rs
index 5e6d4e76..453bca45 100644
--- a/crates/shirabe-symfony-console/src/input/string_input.rs
+++ b/crates/shirabe-symfony-console/src/input/string_input.rs
@@ -17,7 +17,7 @@ use shirabe_php_shim::{CaptureKey, PhpMixed, php_regex};
/// ```
#[derive(Debug, Clone)]
pub struct StringInput {
- pub(crate) inner: ArgvInput,
+ inner: ArgvInput,
}
impl StringInput {
diff --git a/crates/shirabe-symfony-console/src/output/stream_output.rs b/crates/shirabe-symfony-console/src/output/stream_output.rs
index 8ffe7e82..c183444b 100644
--- a/crates/shirabe-symfony-console/src/output/stream_output.rs
+++ b/crates/shirabe-symfony-console/src/output/stream_output.rs
@@ -77,7 +77,7 @@ impl StreamOutput {
///
/// Reference: Composer\XdebugHandler\Process::supportsColor
/// https://github.com/composer/xdebug-handler
- pub(crate) fn has_color_support(stream: &shirabe_php_shim::PhpResource) -> bool {
+ fn has_color_support(stream: &shirabe_php_shim::PhpResource) -> bool {
// Follow https://no-color.org/
if !no_color_first_char().is_empty() {
return false;
diff --git a/crates/shirabe-symfony-process/src/lib.rs b/crates/shirabe-symfony-process/src/lib.rs
index 3a5656c6..050faa94 100644
--- a/crates/shirabe-symfony-process/src/lib.rs
+++ b/crates/shirabe-symfony-process/src/lib.rs
@@ -1,9 +1,9 @@
pub mod exception;
pub mod executable_finder;
pub mod php_executable_finder;
-pub(crate) mod pipes;
+mod pipes;
pub mod process;
-pub(crate) mod process_utils;
+mod process_utils;
pub use exception::*;
pub use executable_finder::*;
diff --git a/crates/shirabe-symfony-string/src/byte_string.rs b/crates/shirabe-symfony-string/src/byte_string.rs
index cf597bbf..eca1380b 100644
--- a/crates/shirabe-symfony-string/src/byte_string.rs
+++ b/crates/shirabe-symfony-string/src/byte_string.rs
@@ -4,7 +4,7 @@ use crate::code_point_string::CodePointString;
#[derive(Debug, Clone)]
pub struct ByteString {
- pub(crate) string: String,
+ string: String,
}
impl ByteString {
diff --git a/crates/shirabe-symfony-string/src/unicode_string.rs b/crates/shirabe-symfony-string/src/unicode_string.rs
index 21117437..e611da6b 100644
--- a/crates/shirabe-symfony-string/src/unicode_string.rs
+++ b/crates/shirabe-symfony-string/src/unicode_string.rs
@@ -2,7 +2,7 @@
#[derive(Debug, Clone)]
pub struct UnicodeString {
- pub(crate) string: String,
+ string: String,
}
impl UnicodeString {
diff --git a/crates/shirabe/src/autoload/autoload_generator.rs b/crates/shirabe/src/autoload/autoload_generator.rs
index 10f76536..0f7fe22a 100644
--- a/crates/shirabe/src/autoload/autoload_generator.rs
+++ b/crates/shirabe/src/autoload/autoload_generator.rs
@@ -801,7 +801,7 @@ return array(
}
/// Throws InvalidArgumentException if the package has illegal settings.
- pub(crate) fn validate_package(&self, package: PackageInterfaceHandle) -> anyhow::Result<()> {
+ fn validate_package(&self, package: PackageInterfaceHandle) -> anyhow::Result<()> {
let autoload = package.get_autoload();
if autoload
.get("psr-4")
@@ -968,7 +968,7 @@ return array(
loader
}
- pub(crate) fn get_include_paths_file(
+ fn get_include_paths_file(
&self,
package_map: &Vec<(PackageInterfaceHandle, Option<String>)>,
filesystem: &Filesystem,
@@ -1033,7 +1033,7 @@ return array(
))
}
- pub(crate) fn get_include_files_file(
+ fn get_include_files_file(
&self,
files: &IndexMap<String, String>,
filesystem: &Filesystem,
@@ -1103,7 +1103,7 @@ return array(
))
}
- pub(crate) fn get_path_code(
+ fn get_path_code(
&self,
filesystem: &Filesystem,
base_path: &str,
@@ -1137,7 +1137,7 @@ return array(
format!("{}{}", base_dir, var_export(&PhpMixed::String(path), true))
}
- pub(crate) fn get_platform_check(
+ fn get_platform_check(
&self,
package_map: &Vec<(PackageInterfaceHandle, Option<String>)>,
check_platform: PhpMixed,
@@ -1382,11 +1382,7 @@ if ($issues) {{
))
}
- pub(crate) fn get_autoload_file(
- &self,
- vendor_path_to_target_dir_code: &str,
- suffix: &str,
- ) -> String {
+ fn get_autoload_file(&self, vendor_path_to_target_dir_code: &str, suffix: &str) -> String {
let last_char = vendor_path_to_target_dir_code
.chars()
.nth(vendor_path_to_target_dir_code.len() - 1)
@@ -1431,7 +1427,7 @@ return ComposerAutoloaderInit{}::getLoader();
/// Note: vendor_path_code and app_base_dir_code are unused in this method
#[allow(clippy::too_many_arguments, reason = "to keep PHP signature")]
- pub(crate) fn get_autoload_real_file(
+ fn get_autoload_real_file(
&self,
_use_class_map: bool,
use_include_path: bool,
@@ -1580,7 +1576,7 @@ class ComposerAutoloaderInit{}
format!("{}}}\n", file)
}
- pub(crate) fn get_static_file(
+ fn get_static_file(
&self,
suffix: &str,
target_dir: &str,
@@ -1819,7 +1815,7 @@ class ComposerStaticInit{}
)
}
- pub(crate) fn parse_autoloads_type(
+ fn parse_autoloads_type(
&self,
package_map: &Vec<(PackageInterfaceHandle, Option<String>)>,
r#type: &str,
@@ -2029,17 +2025,13 @@ class ComposerStaticInit{}
autoloads
}
- pub(crate) fn get_file_identifier(
- &self,
- package: PackageInterfaceHandle,
- path: &str,
- ) -> String {
+ fn get_file_identifier(&self, package: PackageInterfaceHandle, path: &str) -> String {
// TODO composer v3 change this to sha1 or xxh3? Possibly not worth the potential breakage though
hash("md5", &format!("{}:{}", package.get_name(), path))
}
/// Filters out dev-dependencies
- pub(crate) fn filter_package_map(
+ fn filter_package_map(
&self,
package_map: Vec<(PackageInterfaceHandle, Option<String>)>,
root_package: RootPackageInterfaceHandle,
@@ -2096,7 +2088,7 @@ class ComposerStaticInit{}
/// Sorts packages by dependency weight
///
/// Packages of equal weight are sorted alphabetically
- pub(crate) fn sort_package_map(
+ fn sort_package_map(
&self,
package_map: Vec<(PackageInterfaceHandle, Option<String>)>,
) -> Vec<(PackageInterfaceHandle, Option<String>)> {
diff --git a/crates/shirabe/src/cache.rs b/crates/shirabe/src/cache.rs
index 435e45c6..b41350f5 100644
--- a/crates/shirabe/src/cache.rs
+++ b/crates/shirabe/src/cache.rs
@@ -485,7 +485,7 @@ impl Cache {
None
}
- pub(crate) fn get_finder(&self) -> Finder {
+ fn get_finder(&self) -> Finder {
let mut finder = Finder::create();
finder.r#in(&self.root).files();
finder
diff --git a/crates/shirabe/src/command/base_command.rs b/crates/shirabe/src/command/base_command.rs
index 9eb28dd8..d7f935c1 100644
--- a/crates/shirabe/src/command/base_command.rs
+++ b/crates/shirabe/src/command/base_command.rs
@@ -38,16 +38,16 @@ pub const INVALID: i64 = 2;
#[derive(Debug)]
pub struct BaseCommandData {
inner: CommandData,
- pub(crate) composer: std::cell::RefCell<Option<PartialComposerHandle>>,
- pub(crate) io: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<dyn IOInterface>>>>,
+ composer: std::cell::RefCell<Option<PartialComposerHandle>>,
+ io: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<dyn IOInterface>>>>,
/// The definition entries that were registered through the Composer-typed
/// InputArgument/InputOption (which carry the suggested-values backport). PHP checks
/// `$definition->getArgument($name) instanceof Composer\Console\Input\InputArgument`; in
/// this port `set_definition` converts the entries to the Symfony types for storage, so
/// the Composer-typedness is tracked by name in these side maps instead.
- pub(crate) composer_arguments:
+ composer_arguments:
std::cell::RefCell<IndexMap<String, std::rc::Rc<crate::console::input::InputArgument>>>,
- pub(crate) composer_options:
+ composer_options:
std::cell::RefCell<IndexMap<String, std::rc::Rc<crate::console::input::InputOption>>>,
}
@@ -65,7 +65,7 @@ impl BaseCommandData {
/// Access to the embedded Symfony command state, used by the Composer-typed definition
/// builders to forward to `CommandData`'s Symfony-typed entry points. `CommandData` is
/// interior-mutable, so a shared reference is enough.
- pub(crate) fn command_data(&self) -> &CommandData {
+ fn command_data(&self) -> &CommandData {
&self.inner
}
}
diff --git a/crates/shirabe/src/command/config_command.rs b/crates/shirabe/src/command/config_command.rs
index 3d92de4b..504a0f11 100644
--- a/crates/shirabe/src/command/config_command.rs
+++ b/crates/shirabe/src/command/config_command.rs
@@ -38,16 +38,15 @@ pub struct ConfigCommand {
config_file: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<JsonFile>>>>,
config_source: std::cell::RefCell<Option<JsonConfigSource>>,
- pub(crate) auth_config_file:
- std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<JsonFile>>>>,
- pub(crate) auth_config_source: std::cell::RefCell<Option<JsonConfigSource>>,
+ auth_config_file: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<JsonFile>>>>,
+ auth_config_source: std::cell::RefCell<Option<JsonConfigSource>>,
}
impl_php_class!(ConfigCommand, r"Composer\Command\ConfigCommand");
impl ConfigCommand {
/// List of additional configurable package-properties
- pub(crate) const CONFIGURABLE_PACKAGE_PROPERTIES: &'static [&'static str] = &[
+ const CONFIGURABLE_PACKAGE_PROPERTIES: &'static [&'static str] = &[
"name",
"type",
"description",
@@ -77,7 +76,7 @@ impl ConfigCommand {
command
}
- pub(crate) fn handle_single_value(
+ fn handle_single_value(
&self,
key: &str,
callbacks: &(ValidatorFn, NormalizerFn),
@@ -143,7 +142,7 @@ impl ConfigCommand {
Ok(())
}
- pub(crate) fn handle_multi_value(
+ fn handle_multi_value(
&self,
key: &str,
callbacks: &(ValidatorFn, NormalizerFn),
@@ -181,7 +180,7 @@ impl ConfigCommand {
}
/// Display the contents of the file in a pretty formatted way
- pub(crate) fn list_configuration(
+ fn list_configuration(
&self,
contents: PhpMixed,
raw_contents: PhpMixed,
diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs
index c7768f11..124f809b 100644
--- a/crates/shirabe/src/command/create_project_command.rs
+++ b/crates/shirabe/src/command/create_project_command.rs
@@ -56,7 +56,7 @@ pub struct CreateProjectCommand {
base_command_data: BaseCommandData,
/// @var SuggestedPackagesReporter
- pub(crate) suggested_packages_reporter:
+ suggested_packages_reporter:
std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<SuggestedPackagesReporter>>>>,
}
diff --git a/crates/shirabe/src/command/diagnose_command.rs b/crates/shirabe/src/command/diagnose_command.rs
index 451b051c..4b148c09 100644
--- a/crates/shirabe/src/command/diagnose_command.rs
+++ b/crates/shirabe/src/command/diagnose_command.rs
@@ -50,11 +50,9 @@ use shirabe_symfony_process::ExecutableFinder;
pub struct DiagnoseCommand {
base_command_data: BaseCommandData,
- pub(crate) http_downloader:
- std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<HttpDownloader>>>>,
- pub(crate) process:
- std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<ProcessExecutor>>>>,
- pub(crate) exit_code: std::cell::Cell<i64>,
+ http_downloader: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<HttpDownloader>>>>,
+ process: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<ProcessExecutor>>>>,
+ exit_code: std::cell::Cell<i64>,
}
impl_php_class!(DiagnoseCommand, r"Composer\Command\DiagnoseCommand");
diff --git a/crates/shirabe/src/command/init_command.rs b/crates/shirabe/src/command/init_command.rs
index 7e6021a9..c348fa6f 100644
--- a/crates/shirabe/src/command/init_command.rs
+++ b/crates/shirabe/src/command/init_command.rs
@@ -125,10 +125,7 @@ impl InitCommand {
.into())
}
- pub(crate) fn format_authors(
- &self,
- author: &str,
- ) -> anyhow::Result<Vec<IndexMap<String, PhpMixed>>> {
+ fn format_authors(&self, author: &str) -> anyhow::Result<Vec<IndexMap<String, PhpMixed>>> {
let parsed = self.parse_author_string(author)?;
let mut author_map: IndexMap<String, PhpMixed> = IndexMap::new();
let name = parsed.get("name").cloned().unwrap_or(None);
@@ -163,7 +160,7 @@ impl InitCommand {
Some(implode("\\", &namespace))
}
- pub(crate) fn get_git_config(&self) -> IndexMap<String, String> {
+ fn get_git_config(&self) -> IndexMap<String, String> {
if self.git_config.borrow().is_some() {
return self.git_config.borrow().clone().unwrap_or_default();
}
@@ -208,7 +205,7 @@ impl InitCommand {
/// "/$vendor/"
/// "/$vendor/*"
/// "$vendor/*"
- pub(crate) fn has_vendor_ignore(&self, ignore_file: &str, vendor: &str) -> bool {
+ fn has_vendor_ignore(&self, ignore_file: &str, vendor: &str) -> bool {
if !file_exists(ignore_file) {
return false;
}
@@ -225,7 +222,7 @@ impl InitCommand {
false
}
- pub(crate) fn add_vendor_ignore(&self, ignore_file: &str, vendor: &str) {
+ fn add_vendor_ignore(&self, ignore_file: &str, vendor: &str) {
let mut contents = String::new();
if file_exists(ignore_file) {
contents = file_get_contents(ignore_file).unwrap_or_default();
@@ -269,7 +266,7 @@ impl InitCommand {
self.add_vendor_ignore(ignore_file, vendor)
}
- pub(crate) fn is_valid_email(&self, email: &str) -> bool {
+ fn is_valid_email(&self, email: &str) -> bool {
shirabe_php_shim::filter_var_email(email)
}
diff --git a/crates/shirabe/src/command/show_command.rs b/crates/shirabe/src/command/show_command.rs
index f2246cbe..ead034da 100644
--- a/crates/shirabe/src/command/show_command.rs
+++ b/crates/shirabe/src/command/show_command.rs
@@ -55,8 +55,8 @@ use shirabe_symfony_console::output::OutputInterface;
pub struct ShowCommand {
base_command_data: BaseCommandData,
- pub(crate) version_parser: std::cell::RefCell<VersionParser>,
- pub(crate) colors: std::cell::RefCell<Vec<String>>,
+ version_parser: std::cell::RefCell<VersionParser>,
+ colors: std::cell::RefCell<Vec<String>>,
repository_set: std::cell::RefCell<Option<std::rc::Rc<std::cell::RefCell<RepositorySet>>>>,
}
@@ -83,7 +83,7 @@ impl ShowCommand {
}
/// PHP: protected function suggestPackageBasedOnMode(): \Closure
- pub(crate) fn suggest_package_based_on_mode(&self) -> crate::console::input::SuggestedValues {
+ fn suggest_package_based_on_mode(&self) -> crate::console::input::SuggestedValues {
crate::console::input::SuggestedValues::Closure(Box::new(|this, input, suggestions| {
if input.get_option("available")?.to_bool() || input.get_option("all")?.to_bool() {
return this.suggest_available_package_incl_platform().call(
@@ -259,7 +259,7 @@ impl ShowCommand {
}
}
- pub(crate) fn get_root_requires(&self) -> Vec<String> {
+ fn get_root_requires(&self) -> Vec<String> {
let composer_rc = self.try_composer(None, None);
let composer_rc = match composer_rc {
None => return vec![],
@@ -279,7 +279,7 @@ impl ShowCommand {
combined.keys().map(|k| strtolower(k)).collect()
}
- pub(crate) fn get_version_style(
+ fn get_version_style(
&self,
latest_package: PackageInterfaceHandle,
package: PackageInterfaceHandle,
@@ -294,7 +294,7 @@ impl ShowCommand {
}
/// finds a package by name and version if provided
- pub(crate) fn get_package(
+ fn get_package(
&self,
installed_repo: &RepositoryInterfaceHandle,
repos: &RepositoryInterfaceHandle,
@@ -371,7 +371,7 @@ impl ShowCommand {
}
/// Prints package info.
- pub(crate) fn print_package_info(
+ fn print_package_info(
&self,
package: CompletePackageInterfaceHandle,
versions: &IndexMap<String, String>,
@@ -401,7 +401,7 @@ impl ShowCommand {
}
/// Prints package metadata.
- pub(crate) fn print_meta(
+ fn print_meta(
&self,
package: CompletePackageInterfaceHandle,
versions: &IndexMap<String, String>,
@@ -564,7 +564,7 @@ impl ShowCommand {
}
/// Prints all available versions of this package and highlights the installed one if any.
- pub(crate) fn print_versions(
+ fn print_versions(
&self,
package: CompletePackageInterfaceHandle,
versions: &IndexMap<String, String>,
@@ -599,7 +599,7 @@ impl ShowCommand {
}
/// print link objects
- pub(crate) fn print_links(
+ fn print_links(
&self,
package: CompletePackageInterfaceHandle,
link_type: &str,
@@ -622,7 +622,7 @@ impl ShowCommand {
}
/// Prints the licenses of a package with metadata
- pub(crate) fn print_licenses(&self, package: CompletePackageInterfaceHandle) {
+ fn print_licenses(&self, package: CompletePackageInterfaceHandle) {
let spdx_licenses = SpdxLicenses::new();
let licenses = package.get_license();
@@ -650,7 +650,7 @@ impl ShowCommand {
}
/// Prints package info in JSON format.
- pub(crate) fn print_package_info_as_json(
+ fn print_package_info_as_json(
&self,
package: CompletePackageInterfaceHandle,
versions: &IndexMap<String, String>,
@@ -971,7 +971,7 @@ impl ShowCommand {
}
/// Init styles for tree
- pub(crate) fn init_styles(&self, output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>) {
+ fn init_styles(&self, output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>) {
*self.colors.borrow_mut() = vec![
"green".to_string(),
"yellow".to_string(),
@@ -991,7 +991,7 @@ impl ShowCommand {
}
/// Display the tree
- pub(crate) fn display_package_tree(&self, array_tree: Vec<IndexMap<String, PhpMixed>>) {
+ fn display_package_tree(&self, array_tree: Vec<IndexMap<String, PhpMixed>>) {
for package in array_tree.iter() {
let name = package
.get("name")
@@ -1070,7 +1070,7 @@ impl ShowCommand {
}
/// Generate the package tree
- pub(crate) fn generate_package_tree(
+ fn generate_package_tree(
&self,
package: PackageInterfaceHandle,
installed_repo: &RepositoryInterfaceHandle,
@@ -1147,7 +1147,7 @@ impl ShowCommand {
}
/// Display a package tree
- pub(crate) fn display_tree(
+ fn display_tree(
&self,
package: &PhpMixed,
packages_in_tree: &[PhpMixed],
@@ -1216,7 +1216,7 @@ impl ShowCommand {
}
/// Display a package tree
- pub(crate) fn add_tree(
+ fn add_tree(
&self,
name: &str,
link: &Link,
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 9a17868c..fb89f8b0 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -119,8 +119,8 @@ pub struct Application {
default_command: String,
single_command: bool,
// $initialized is omitted. See ApplicationHandle::init().
- pub(crate) composer: Option<PartialComposerHandle>,
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ composer: Option<PartialComposerHandle>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
has_plugin_commands: bool,
/// Whether this application published the worker-side console application handoff. The
/// handoff is process-wide, so a second application in the same process must replace it
@@ -443,9 +443,7 @@ impl Application {
}
/// Initializes all the composer commands.
- pub(crate) fn get_default_commands(
- &self,
- ) -> Vec<std::rc::Rc<std::cell::RefCell<dyn SymfonyCommand>>> {
+ fn get_default_commands(&self) -> Vec<std::rc::Rc<std::cell::RefCell<dyn SymfonyCommand>>> {
let mut commands = self.base_get_default_commands();
let composer_commands: Vec<std::rc::Rc<std::cell::RefCell<dyn SymfonyCommand>>> = vec![
std::rc::Rc::new(std::cell::RefCell::new(AboutCommand::new())),
@@ -525,7 +523,7 @@ impl Application {
)
}
- pub(crate) fn get_default_input_definition(&self) -> anyhow::Result<InputDefinition> {
+ fn get_default_input_definition(&self) -> anyhow::Result<InputDefinition> {
let mut definition = self.base_get_default_input_definition();
definition.add_option(InputOption::new(
"--profile",
@@ -3089,7 +3087,7 @@ thread_local! {
}
/// Registers the application the worker's reverse command stubs call back into.
-pub(crate) fn register_worker_reverse_application(
+fn register_worker_reverse_application(
application: std::rc::Weak<std::cell::RefCell<Application>>,
) {
WORKER_REVERSE_APPLICATION.with(|slot| *slot.borrow_mut() = Some(application));
diff --git a/crates/shirabe/src/console/github_action_error.rs b/crates/shirabe/src/console/github_action_error.rs
index 7475505c..db9800b5 100644
--- a/crates/shirabe/src/console/github_action_error.rs
+++ b/crates/shirabe/src/console/github_action_error.rs
@@ -6,7 +6,7 @@ use crate::util::Platform;
#[derive(Debug)]
pub struct GithubActionError {
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
}
impl GithubActionError {
diff --git a/crates/shirabe/src/console/input.rs b/crates/shirabe/src/console/input.rs
index 6e515e7d..84e46382 100644
--- a/crates/shirabe/src/console/input.rs
+++ b/crates/shirabe/src/console/input.rs
@@ -42,12 +42,12 @@ impl std::fmt::Debug for SuggestedValues {
impl SuggestedValues {
/// Whether PHP's `[] !== $suggestedValues` is false, i.e. no suggestions were declared.
- pub(crate) fn is_empty(&self) -> bool {
+ fn is_empty(&self) -> bool {
matches!(self, SuggestedValues::List(values) if values.is_empty())
}
/// The shared body of the `InputArgument::complete` / `InputOption::complete` backport.
- pub(crate) fn complete(
+ fn complete(
&self,
this: &dyn crate::command::BaseCommand,
input: &CompletionInput,
diff --git a/crates/shirabe/src/dependency_resolver/decisions.rs b/crates/shirabe/src/dependency_resolver/decisions.rs
index ac596054..3cf26ffb 100644
--- a/crates/shirabe/src/dependency_resolver/decisions.rs
+++ b/crates/shirabe/src/dependency_resolver/decisions.rs
@@ -8,8 +8,8 @@ use shirabe_php_shim::LogicException;
use std::fmt;
pub struct Decisions {
- pub(crate) pool: std::rc::Rc<std::cell::RefCell<Pool>>,
- pub(crate) decision_map: IndexMap<i64, i64>,
+ pool: std::rc::Rc<std::cell::RefCell<Pool>>,
+ decision_map: IndexMap<i64, i64>,
pub(crate) decision_queue: Vec<(i64, std::rc::Rc<std::cell::RefCell<Rule>>)>,
}
@@ -153,7 +153,7 @@ impl Decisions {
self.decision_queue.is_empty()
}
- pub(crate) fn add_decision(&mut self, literal: i64, level: i64) {
+ fn add_decision(&mut self, literal: i64, level: i64) {
let package_id = literal.abs();
let previous_decision = self.decision_map.get(&package_id).copied().unwrap_or(0);
diff --git a/crates/shirabe/src/dependency_resolver/default_policy.rs b/crates/shirabe/src/dependency_resolver/default_policy.rs
index 8c1a7697..f753dc48 100644
--- a/crates/shirabe/src/dependency_resolver/default_policy.rs
+++ b/crates/shirabe/src/dependency_resolver/default_policy.rs
@@ -85,11 +85,7 @@ impl DefaultPolicy {
if a.id() < b.id() { -1 } else { 1 }
}
- pub(crate) fn group_literals_by_name(
- &self,
- pool: &Pool,
- literals: &[i64],
- ) -> IndexMap<String, Vec<i64>> {
+ fn group_literals_by_name(&self, pool: &Pool, literals: &[i64]) -> IndexMap<String, Vec<i64>> {
let mut packages: IndexMap<String, Vec<i64>> = IndexMap::new();
for &literal in literals {
let package_name = pool.literal_to_package(literal).get_name().to_string();
@@ -98,7 +94,7 @@ impl DefaultPolicy {
packages
}
- pub(crate) fn prune_to_best_version(&self, pool: &Pool, literals: Vec<i64>) -> Vec<i64> {
+ fn prune_to_best_version(&self, pool: &Pool, literals: Vec<i64>) -> Vec<i64> {
if let Some(ref preferred_versions) = self.preferred_versions {
let name = pool.literal_to_package(literals[0]).get_name();
if let Some(preferred_version) = preferred_versions.get(&name) {
@@ -133,7 +129,7 @@ impl DefaultPolicy {
best_literals
}
- pub(crate) fn prune_remote_aliases(&self, pool: &Pool, literals: Vec<i64>) -> Vec<i64> {
+ fn prune_remote_aliases(&self, pool: &Pool, literals: Vec<i64>) -> Vec<i64> {
let mut has_local_alias = false;
for &literal in &literals {
@@ -162,7 +158,7 @@ impl DefaultPolicy {
selected
}
- pub(crate) fn replaces(&self, source: BasePackageHandle, target: BasePackageHandle) -> bool {
+ fn replaces(&self, source: BasePackageHandle, target: BasePackageHandle) -> bool {
for link in source.get_replaces().values() {
if link.get_target() == target.get_name().as_str() {
return true;
diff --git a/crates/shirabe/src/dependency_resolver/generic_rule.rs b/crates/shirabe/src/dependency_resolver/generic_rule.rs
index 8c702d32..b13333ed 100644
--- a/crates/shirabe/src/dependency_resolver/generic_rule.rs
+++ b/crates/shirabe/src/dependency_resolver/generic_rule.rs
@@ -7,7 +7,7 @@ use shirabe_php_shim::{RuntimeException, hash_raw};
#[derive(Debug)]
pub struct GenericRule {
inner: RuleBase,
- pub(crate) literals: Vec<i64>,
+ literals: Vec<i64>,
}
impl GenericRule {
diff --git a/crates/shirabe/src/dependency_resolver/lock_transaction.rs b/crates/shirabe/src/dependency_resolver/lock_transaction.rs
index e230801f..51917dd6 100644
--- a/crates/shirabe/src/dependency_resolver/lock_transaction.rs
+++ b/crates/shirabe/src/dependency_resolver/lock_transaction.rs
@@ -13,11 +13,11 @@ pub struct LockTransaction {
inner: Transaction,
/// packages in current lock file, platform repo or otherwise present
/// Indexed by spl_object_hash
- pub(crate) present_map: IndexMap<String, PackageInterfaceHandle>,
+ present_map: IndexMap<String, PackageInterfaceHandle>,
/// Packages which cannot be mapped, platform repo, root package, other fixed repos
/// Indexed by package id
- pub(crate) unlockable_map: IndexMap<i64, PackageInterfaceHandle>,
- pub(crate) result_packages: IndexMap<String, Vec<PackageInterfaceHandle>>,
+ unlockable_map: IndexMap<i64, PackageInterfaceHandle>,
+ result_packages: IndexMap<String, Vec<PackageInterfaceHandle>>,
}
impl LockTransaction {
diff --git a/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs b/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs
index b7f21074..dc99f5b4 100644
--- a/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs
+++ b/crates/shirabe/src/dependency_resolver/multi_conflict_rule.rs
@@ -6,7 +6,7 @@ use shirabe_php_shim::{RuntimeException, hash_raw};
#[derive(Debug)]
pub struct MultiConflictRule {
inner: RuleBase,
- pub(crate) literals: Vec<i64>,
+ literals: Vec<i64>,
}
impl MultiConflictRule {
diff --git a/crates/shirabe/src/dependency_resolver/operation/install_operation.rs b/crates/shirabe/src/dependency_resolver/operation/install_operation.rs
index 05349c2d..d2d665ac 100644
--- a/crates/shirabe/src/dependency_resolver/operation/install_operation.rs
+++ b/crates/shirabe/src/dependency_resolver/operation/install_operation.rs
@@ -5,7 +5,7 @@ use crate::package::PackageInterfaceHandle;
#[derive(Debug, Clone)]
pub struct InstallOperation {
- pub(crate) package: PackageInterfaceHandle,
+ package: PackageInterfaceHandle,
}
impl InstallOperation {
diff --git a/crates/shirabe/src/dependency_resolver/operation/mark_alias_installed_operation.rs b/crates/shirabe/src/dependency_resolver/operation/mark_alias_installed_operation.rs
index 72066204..82870816 100644
--- a/crates/shirabe/src/dependency_resolver/operation/mark_alias_installed_operation.rs
+++ b/crates/shirabe/src/dependency_resolver/operation/mark_alias_installed_operation.rs
@@ -5,7 +5,7 @@ use crate::package::AliasPackageHandle;
#[derive(Debug, Clone)]
pub struct MarkAliasInstalledOperation {
- pub(crate) package: AliasPackageHandle,
+ package: AliasPackageHandle,
}
impl MarkAliasInstalledOperation {
diff --git a/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs b/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs
index 4e4000df..902eb465 100644
--- a/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs
+++ b/crates/shirabe/src/dependency_resolver/operation/mark_alias_uninstalled_operation.rs
@@ -5,7 +5,7 @@ use crate::package::AliasPackageHandle;
#[derive(Debug, Clone)]
pub struct MarkAliasUninstalledOperation {
- pub(crate) package: AliasPackageHandle,
+ package: AliasPackageHandle,
}
impl MarkAliasUninstalledOperation {
diff --git a/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs b/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs
index 2fd35af5..aeb2e86a 100644
--- a/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs
+++ b/crates/shirabe/src/dependency_resolver/operation/uninstall_operation.rs
@@ -5,7 +5,7 @@ use crate::package::PackageInterfaceHandle;
#[derive(Debug, Clone)]
pub struct UninstallOperation {
- pub(crate) package: PackageInterfaceHandle,
+ package: PackageInterfaceHandle,
}
impl UninstallOperation {
diff --git a/crates/shirabe/src/dependency_resolver/operation/update_operation.rs b/crates/shirabe/src/dependency_resolver/operation/update_operation.rs
index a06a9cdc..67ed73c1 100644
--- a/crates/shirabe/src/dependency_resolver/operation/update_operation.rs
+++ b/crates/shirabe/src/dependency_resolver/operation/update_operation.rs
@@ -6,8 +6,8 @@ use crate::package::version::VersionParser;
#[derive(Debug, Clone)]
pub struct UpdateOperation {
- pub(crate) initial_package: PackageInterfaceHandle,
- pub(crate) target_package: PackageInterfaceHandle,
+ initial_package: PackageInterfaceHandle,
+ target_package: PackageInterfaceHandle,
}
impl UpdateOperation {
diff --git a/crates/shirabe/src/dependency_resolver/pool.rs b/crates/shirabe/src/dependency_resolver/pool.rs
index a0dfd362..c12f819d 100644
--- a/crates/shirabe/src/dependency_resolver/pool.rs
+++ b/crates/shirabe/src/dependency_resolver/pool.rs
@@ -14,19 +14,19 @@ use std::fmt;
#[derive(Debug)]
pub struct Pool {
/// @var BasePackage[]
- pub(crate) packages: Vec<BasePackageHandle>,
+ packages: Vec<BasePackageHandle>,
/// @var array<string, BasePackage[]>
- pub(crate) package_by_name: IndexMap<String, Vec<BasePackageHandle>>,
+ package_by_name: IndexMap<String, Vec<BasePackageHandle>>,
/// @var VersionParser
- pub(crate) version_parser: VersionParser,
+ version_parser: VersionParser,
/// @var array<string, array<string, BasePackage[]>>
- pub(crate) provider_cache: IndexMap<String, IndexMap<String, Vec<BasePackageHandle>>>,
+ provider_cache: IndexMap<String, IndexMap<String, Vec<BasePackageHandle>>>,
/// @var BasePackage[]
- pub(crate) unacceptable_fixed_or_locked_packages: Vec<BasePackageHandle>,
+ unacceptable_fixed_or_locked_packages: Vec<BasePackageHandle>,
/// @var array<string, array<string, string>> Map of package name => normalized version => pretty version
- pub(crate) removed_versions: IndexMap<String, IndexMap<String, String>>,
+ removed_versions: IndexMap<String, IndexMap<String, String>>,
/// @var array<string, array<string, string>> Map of package object hash => removed normalized versions => removed pretty version
- pub(crate) removed_versions_by_package: IndexMap<String, IndexMap<String, String>>,
+ removed_versions_by_package: IndexMap<String, IndexMap<String, String>>,
/// @var array<string, array<string, array<SecurityAdvisory|PartialSecurityAdvisory>>> Map of package name => normalized version => security advisories
security_removed_versions:
IndexMap<String, IndexMap<String, Vec<std::rc::Rc<AnySecurityAdvisory>>>>,
diff --git a/crates/shirabe/src/dependency_resolver/problem.rs b/crates/shirabe/src/dependency_resolver/problem.rs
index 1da6028c..cdb833bf 100644
--- a/crates/shirabe/src/dependency_resolver/problem.rs
+++ b/crates/shirabe/src/dependency_resolver/problem.rs
@@ -25,12 +25,12 @@ use shirabe_symfony_console::formatter::OutputFormatter;
#[derive(Debug)]
pub struct Problem {
/// A map containing the id of each rule part of this problem as a key
- pub(crate) reason_seen: IndexMap<String, bool>,
+ reason_seen: IndexMap<String, bool>,
/// A set of reasons for the problem, each is a rule or a root require and a rule
- pub(crate) reasons: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
+ reasons: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
- pub(crate) section: i64,
+ section: i64,
}
impl Default for Problem {
@@ -360,7 +360,7 @@ impl Problem {
}
/// Store a reason descriptor but ignore duplicates
- pub(crate) fn add_reason(&mut self, id: String, reason: std::rc::Rc<std::cell::RefCell<Rule>>) {
+ fn add_reason(&mut self, id: String, reason: std::rc::Rc<std::cell::RefCell<Rule>>) {
// TODO: if a rule is part of a problem description in two sections, isn't this going to remove a message
// that is important to understand the issue?
@@ -1377,7 +1377,7 @@ impl Problem {
}
/// Turns a constraint into text usable in a sentence describing a request
- pub(crate) fn constraint_to_text(constraint: Option<&AnyConstraint>) -> String {
+ fn constraint_to_text(constraint: Option<&AnyConstraint>) -> String {
if let Some(c) = constraint
&& c.is_constraint()
&& c.get_operator() == Some(CmpOp::Eq)
diff --git a/crates/shirabe/src/dependency_resolver/request.rs b/crates/shirabe/src/dependency_resolver/request.rs
index 410831dd..1b6925ed 100644
--- a/crates/shirabe/src/dependency_resolver/request.rs
+++ b/crates/shirabe/src/dependency_resolver/request.rs
@@ -231,12 +231,12 @@ pub enum UpdateAllowTransitiveDeps {
#[derive(Debug)]
pub struct Request {
- pub(crate) locked_repository: Option<LockArrayRepositoryHandle>,
- pub(crate) requires: IndexMap<String, AnyConstraint>,
- pub(crate) fixed_packages: IndexMap<String, BasePackageHandle>,
- pub(crate) locked_packages: IndexMap<String, BasePackageHandle>,
- pub(crate) fixed_locked_packages: IndexMap<String, BasePackageHandle>,
- pub(crate) update_allow_list: Vec<String>,
- pub(crate) update_allow_transitive_dependencies: UpdateAllowTransitiveDeps,
+ locked_repository: Option<LockArrayRepositoryHandle>,
+ requires: IndexMap<String, AnyConstraint>,
+ fixed_packages: IndexMap<String, BasePackageHandle>,
+ locked_packages: IndexMap<String, BasePackageHandle>,
+ fixed_locked_packages: IndexMap<String, BasePackageHandle>,
+ update_allow_list: Vec<String>,
+ update_allow_transitive_dependencies: UpdateAllowTransitiveDeps,
restrict_packages: Option<Vec<String>>,
}
diff --git a/crates/shirabe/src/dependency_resolver/rule.rs b/crates/shirabe/src/dependency_resolver/rule.rs
index 5e009260..6b1c2274 100644
--- a/crates/shirabe/src/dependency_resolver/rule.rs
+++ b/crates/shirabe/src/dependency_resolver/rule.rs
@@ -721,9 +721,9 @@ impl std::fmt::Display for Rule {
#[derive(Debug)]
pub struct RuleBase {
- pub(crate) bitfield: i64,
- pub(crate) request: Option<Request>,
- pub(crate) reason_data: ReasonData,
+ bitfield: i64,
+ request: Option<Request>,
+ reason_data: ReasonData,
}
impl RuleBase {
diff --git a/crates/shirabe/src/dependency_resolver/rule_set.rs b/crates/shirabe/src/dependency_resolver/rule_set.rs
index 50f7cb45..195e0953 100644
--- a/crates/shirabe/src/dependency_resolver/rule_set.rs
+++ b/crates/shirabe/src/dependency_resolver/rule_set.rs
@@ -11,9 +11,9 @@ use shirabe_php_shim::OutOfBoundsException;
#[derive(Debug)]
pub struct RuleSet {
pub rule_by_id: IndexMap<i64, std::rc::Rc<std::cell::RefCell<Rule>>>,
- pub(crate) rules: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
- pub(crate) next_rule_id: i64,
- pub(crate) rules_by_hash: IndexMap<String, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
+ rules: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
+ next_rule_id: i64,
+ rules_by_hash: IndexMap<String, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
}
impl Default for RuleSet {
diff --git a/crates/shirabe/src/dependency_resolver/rule_set_generator.rs b/crates/shirabe/src/dependency_resolver/rule_set_generator.rs
index 6f2213dc..aa9412c4 100644
--- a/crates/shirabe/src/dependency_resolver/rule_set_generator.rs
+++ b/crates/shirabe/src/dependency_resolver/rule_set_generator.rs
@@ -17,11 +17,11 @@ use std::collections::VecDeque;
#[derive(Debug)]
pub struct RuleSetGenerator {
- pub(crate) policy: std::rc::Rc<dyn PolicyInterface>,
- pub(crate) pool: std::rc::Rc<std::cell::RefCell<Pool>>,
- pub(crate) rules: RuleSet,
- pub(crate) added_map: IndexMap<i64, PackageInterfaceHandle>,
- pub(crate) added_packages_by_names: IndexMap<String, Vec<PackageInterfaceHandle>>,
+ policy: std::rc::Rc<dyn PolicyInterface>,
+ pool: std::rc::Rc<std::cell::RefCell<Pool>>,
+ rules: RuleSet,
+ added_map: IndexMap<i64, PackageInterfaceHandle>,
+ added_packages_by_names: IndexMap<String, Vec<PackageInterfaceHandle>>,
}
impl RuleSetGenerator {
@@ -132,7 +132,7 @@ impl RuleSetGenerator {
}
}
- pub(crate) fn add_rules_for_package(
+ fn add_rules_for_package(
&mut self,
package: PackageInterfaceHandle,
platform_requirement_filter: &dyn PlatformRequirementFilterInterface,
@@ -221,7 +221,7 @@ impl RuleSetGenerator {
}
}
- pub(crate) fn add_conflict_rules(
+ fn add_conflict_rules(
&mut self,
platform_requirement_filter: &dyn PlatformRequirementFilterInterface,
) {
@@ -292,7 +292,7 @@ impl RuleSetGenerator {
}
}
- pub(crate) fn add_rules_for_request(
+ fn add_rules_for_request(
&mut self,
request: &Request,
platform_requirement_filter: &dyn PlatformRequirementFilterInterface,
@@ -369,7 +369,7 @@ impl RuleSetGenerator {
Ok(())
}
- pub(crate) fn add_rules_for_root_aliases(
+ fn add_rules_for_root_aliases(
&mut self,
platform_requirement_filter: &dyn PlatformRequirementFilterInterface,
) {
diff --git a/crates/shirabe/src/dependency_resolver/rule_set_iterator.rs b/crates/shirabe/src/dependency_resolver/rule_set_iterator.rs
index b469a193..3dcd3a85 100644
--- a/crates/shirabe/src/dependency_resolver/rule_set_iterator.rs
+++ b/crates/shirabe/src/dependency_resolver/rule_set_iterator.rs
@@ -6,11 +6,11 @@ use indexmap::IndexMap;
/// Implements PHP \Iterator over a grouped rule set.
#[derive(Debug)]
pub struct RuleSetIterator {
- pub(crate) rules: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
- pub(crate) types: Vec<i64>,
- pub(crate) current_offset: i64,
- pub(crate) current_type: i64,
- pub(crate) current_type_offset: i64,
+ rules: IndexMap<i64, Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
+ types: Vec<i64>,
+ current_offset: i64,
+ current_type: i64,
+ current_type_offset: i64,
}
impl RuleSetIterator {
diff --git a/crates/shirabe/src/dependency_resolver/rule_watch_graph.rs b/crates/shirabe/src/dependency_resolver/rule_watch_graph.rs
index 6646490b..19be7a9e 100644
--- a/crates/shirabe/src/dependency_resolver/rule_watch_graph.rs
+++ b/crates/shirabe/src/dependency_resolver/rule_watch_graph.rs
@@ -8,7 +8,7 @@ use indexmap::IndexMap;
#[derive(Debug)]
pub struct RuleWatchGraph {
- pub(crate) watch_chains: IndexMap<i64, RuleWatchChain>,
+ watch_chains: IndexMap<i64, RuleWatchChain>,
}
impl Default for RuleWatchGraph {
@@ -121,7 +121,7 @@ impl RuleWatchGraph {
None
}
- pub(crate) fn move_watch(
+ fn move_watch(
&mut self,
from_literal: i64,
to_literal: i64,
diff --git a/crates/shirabe/src/dependency_resolver/rule_watch_node.rs b/crates/shirabe/src/dependency_resolver/rule_watch_node.rs
index b11c1771..fae7fa91 100644
--- a/crates/shirabe/src/dependency_resolver/rule_watch_node.rs
+++ b/crates/shirabe/src/dependency_resolver/rule_watch_node.rs
@@ -6,7 +6,7 @@ use crate::dependency_resolver::Rule;
pub struct RuleWatchNode {
pub watch1: i64,
pub watch2: i64,
- pub(crate) rule: std::rc::Rc<std::cell::RefCell<Rule>>,
+ rule: std::rc::Rc<std::cell::RefCell<Rule>>,
}
impl std::fmt::Debug for RuleWatchNode {
diff --git a/crates/shirabe/src/dependency_resolver/solver.rs b/crates/shirabe/src/dependency_resolver/solver.rs
index a9453a3e..cb398a0c 100644
--- a/crates/shirabe/src/dependency_resolver/solver.rs
+++ b/crates/shirabe/src/dependency_resolver/solver.rs
@@ -26,25 +26,25 @@ use shirabe_semver::constraint::AnyConstraint;
#[derive(Debug)]
pub struct Solver {
- pub(crate) policy: std::rc::Rc<dyn PolicyInterface>,
- pub(crate) pool: std::rc::Rc<std::cell::RefCell<Pool>>,
+ policy: std::rc::Rc<dyn PolicyInterface>,
+ pool: std::rc::Rc<std::cell::RefCell<Pool>>,
- pub(crate) rules: RuleSet,
+ rules: RuleSet,
- pub(crate) watch_graph: RuleWatchGraph,
- pub(crate) decisions: Decisions,
- pub(crate) fixed_map: IndexMap<i64, BasePackageHandle>,
+ watch_graph: RuleWatchGraph,
+ decisions: Decisions,
+ fixed_map: IndexMap<i64, BasePackageHandle>,
- pub(crate) propagate_index: i64,
+ propagate_index: i64,
/// Pairs of `(literals, level)` — PHP indexes into these with the BRANCH_* constants.
- pub(crate) branches: Vec<(Vec<i64>, i64)>,
- pub(crate) problems: Vec<Problem>,
- pub(crate) learned_pool: Vec<Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
- pub(crate) learned_why: IndexMap<String, i64>,
+ branches: Vec<(Vec<i64>, i64)>,
+ problems: Vec<Problem>,
+ learned_pool: Vec<Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
+ learned_why: IndexMap<String, i64>,
pub test_flag_learned_positive_literal: bool,
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
}
impl Solver {
diff --git a/crates/shirabe/src/dependency_resolver/solver_problems_exception.rs b/crates/shirabe/src/dependency_resolver/solver_problems_exception.rs
index 4c948608..fe78dae5 100644
--- a/crates/shirabe/src/dependency_resolver/solver_problems_exception.rs
+++ b/crates/shirabe/src/dependency_resolver/solver_problems_exception.rs
@@ -11,8 +11,8 @@ use shirabe_php_shim::RuntimeException;
#[derive(Debug)]
pub struct SolverProblemsException {
inner: RuntimeException,
- pub(crate) problems: Vec<Problem>,
- pub(crate) learned_pool: Vec<Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
+ problems: Vec<Problem>,
+ learned_pool: Vec<Vec<std::rc::Rc<std::cell::RefCell<Rule>>>>,
}
impl SolverProblemsException {
diff --git a/crates/shirabe/src/dependency_resolver/transaction.rs b/crates/shirabe/src/dependency_resolver/transaction.rs
index 78037338..84879a41 100644
--- a/crates/shirabe/src/dependency_resolver/transaction.rs
+++ b/crates/shirabe/src/dependency_resolver/transaction.rs
@@ -21,18 +21,18 @@ use shirabe_php_shim::{
#[derive(Debug, Clone)]
pub struct Transaction {
/// @var OperationInterface[]
- pub(crate) operations: Vec<AnyOperation>,
+ operations: Vec<AnyOperation>,
/// Packages present at the beginning of the transaction
/// @var PackageInterface[]
- pub(crate) present_packages: Vec<PackageInterfaceHandle>,
+ present_packages: Vec<PackageInterfaceHandle>,
/// Package set resulting from this transaction
/// @var array<string, PackageInterface>
- pub(crate) result_package_map: IndexMap<String, PackageInterfaceHandle>,
+ result_package_map: IndexMap<String, PackageInterfaceHandle>,
/// @var array<string, PackageInterface[]>
- pub(crate) result_packages_by_name: IndexMap<String, Vec<PackageInterfaceHandle>>,
+ result_packages_by_name: IndexMap<String, Vec<PackageInterfaceHandle>>,
}
impl Default for Transaction {
@@ -104,7 +104,7 @@ impl Transaction {
}
}
- pub(crate) fn calculate_operations(&mut self) -> Vec<AnyOperation> {
+ fn calculate_operations(&mut self) -> Vec<AnyOperation> {
let mut operations: Vec<AnyOperation> = vec![];
let mut present_package_map: IndexMap<String, PackageInterfaceHandle> = IndexMap::new();
@@ -218,7 +218,7 @@ impl Transaction {
///
/// These serve as a starting point to enumerate packages in a topological order despite potential cycles.
/// If there are packages with a cycle on the top level the package with the lowest name gets picked
- pub(crate) fn get_root_packages(&self) -> IndexMap<String, PackageInterfaceHandle> {
+ fn get_root_packages(&self) -> IndexMap<String, PackageInterfaceHandle> {
let mut roots: IndexMap<String, PackageInterfaceHandle> = self
.result_package_map
.iter()
@@ -245,7 +245,7 @@ impl Transaction {
roots
}
- pub(crate) fn get_providers_in_result(&self, link: &Link) -> Vec<PackageInterfaceHandle> {
+ fn get_providers_in_result(&self, link: &Link) -> Vec<PackageInterfaceHandle> {
let Some(packages) = self.result_packages_by_name.get(link.get_target()) else {
return vec![];
};
diff --git a/crates/shirabe/src/downloader/download_manager.rs b/crates/shirabe/src/downloader/download_manager.rs
index c8fb86a7..15b009e6 100644
--- a/crates/shirabe/src/downloader/download_manager.rs
+++ b/crates/shirabe/src/downloader/download_manager.rs
@@ -20,7 +20,7 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct DownloadManager {
/// @var IOInterface
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
/// @var bool
prefer_dist: bool,
/// @var bool
@@ -425,10 +425,7 @@ impl DownloadManager {
/// Determines the install preference of a package
///
/// @param PackageInterface $package package instance
- pub(crate) fn resolve_package_install_preference(
- &self,
- package: PackageInterfaceHandle,
- ) -> String {
+ fn resolve_package_install_preference(&self, package: PackageInterfaceHandle) -> String {
for (pattern, preference) in &self.package_preferences {
let pattern_regex = format!(
"{{^{}$}}i",
diff --git a/crates/shirabe/src/downloader/file_downloader.rs b/crates/shirabe/src/downloader/file_downloader.rs
index ab9c3672..64b348e1 100644
--- a/crates/shirabe/src/downloader/file_downloader.rs
+++ b/crates/shirabe/src/downloader/file_downloader.rs
@@ -59,13 +59,13 @@ pub struct FileDownloader {
/// @var Config
pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
/// @var HttpDownloader
- pub(crate) http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>,
+ http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>,
/// @var Filesystem
pub(crate) filesystem: std::rc::Rc<std::cell::RefCell<Filesystem>>,
/// @var ?Cache
- pub(crate) cache: Option<std::rc::Rc<std::cell::RefCell<Cache>>>,
+ cache: Option<std::rc::Rc<std::cell::RefCell<Cache>>>,
/// @var ?EventDispatcher
- pub(crate) event_dispatcher: Option<std::rc::Rc<std::cell::RefCell<EventDispatcher>>>,
+ event_dispatcher: Option<std::rc::Rc<std::cell::RefCell<EventDispatcher>>>,
/// @var ProcessExecutor
pub(crate) process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
/// @var array<string, string> Map of package name to cache key
diff --git a/crates/shirabe/src/downloader/git_downloader.rs b/crates/shirabe/src/downloader/git_downloader.rs
index 9e468a44..4394cc95 100644
--- a/crates/shirabe/src/downloader/git_downloader.rs
+++ b/crates/shirabe/src/downloader/git_downloader.rs
@@ -249,7 +249,7 @@ impl GitDownloader {
///
/// @throws \RuntimeException
/// @return null|string if a string is returned, it is the commit reference that was checked out if the original could not be found
- pub(crate) fn update_to_commit(
+ fn update_to_commit(
&self,
package: PackageInterfaceHandle,
path: &str,
@@ -486,7 +486,7 @@ impl GitDownloader {
.into())
}
- pub(crate) fn update_origin_url(&self, path: &str, url: &str) {
+ fn update_origin_url(&self, path: &str, url: &str) {
let mut output = String::new();
self.inner.process.borrow_mut().execute_args(
&[
@@ -503,7 +503,7 @@ impl GitDownloader {
self.set_push_url(path, url);
}
- pub(crate) fn set_push_url(&self, path: &str, url: &str) {
+ fn set_push_url(&self, path: &str, url: &str) {
// set push url for github projects
let mut match_: IndexMap<CaptureKey, String> = IndexMap::new();
if Preg::is_match3(
@@ -549,7 +549,7 @@ impl GitDownloader {
}
/// @throws \RuntimeException
- pub(crate) async fn discard_changes(&self, path: &str) -> anyhow::Result<Option<PhpMixed>> {
+ async fn discard_changes(&self, path: &str) -> anyhow::Result<Option<PhpMixed>> {
let path = self.normalize_path(path);
let mut output = String::new();
if self.inner.process.borrow_mut().execute_args(
@@ -580,7 +580,7 @@ impl GitDownloader {
}
/// @throws \RuntimeException
- pub(crate) async fn stash_changes(&self, path: &str) -> anyhow::Result<Option<PhpMixed>> {
+ async fn stash_changes(&self, path: &str) -> anyhow::Result<Option<PhpMixed>> {
let path = self.normalize_path(path);
let mut output = String::new();
if self.inner.process.borrow_mut().execute_args(
@@ -604,7 +604,7 @@ impl GitDownloader {
}
/// @throws \RuntimeException
- pub(crate) fn view_diff(&self, path: &str) -> anyhow::Result<()> {
+ fn view_diff(&self, path: &str) -> anyhow::Result<()> {
let path = self.normalize_path(path);
let mut output = String::new();
if self.inner.process.borrow_mut().execute_args(
@@ -625,7 +625,7 @@ impl GitDownloader {
Ok(())
}
- pub(crate) fn normalize_path(&self, path: &str) -> String {
+ fn normalize_path(&self, path: &str) -> String {
let mut path = path.to_string();
if Platform::is_windows() && strlen(&path) > 0 {
let mut base_path = path.clone();
@@ -655,7 +655,7 @@ impl GitDownloader {
path
}
- pub(crate) fn get_short_hash(&self, reference: &str) -> String {
+ fn get_short_hash(&self, reference: &str) -> String {
if !self.inner.io.is_verbose() && Preg::is_match(php_regex!(r"{^[0-9a-f]{40}$}"), reference)
{
return substr(reference, 0, Some(10));
diff --git a/crates/shirabe/src/downloader/path_downloader.rs b/crates/shirabe/src/downloader/path_downloader.rs
index 44940fef..6b3531f4 100644
--- a/crates/shirabe/src/downloader/path_downloader.rs
+++ b/crates/shirabe/src/downloader/path_downloader.rs
@@ -28,7 +28,7 @@ use shirabe_symfony_filesystem::Filesystem as SymfonyFilesystem;
#[derive(Debug)]
pub struct PathDownloader {
- pub(crate) inner: FileDownloader,
+ inner: FileDownloader,
}
impl_php_class!(PathDownloader, r"Composer\Downloader\PathDownloader");
@@ -79,7 +79,7 @@ impl PathDownloader {
None
}
- pub(crate) fn get_install_operation_appendix(
+ fn get_install_operation_appendix(
&self,
package: PackageInterfaceHandle,
path: &str,
diff --git a/crates/shirabe/src/downloader/perforce_downloader.rs b/crates/shirabe/src/downloader/perforce_downloader.rs
index 9d4ff2a3..f61660be 100644
--- a/crates/shirabe/src/downloader/perforce_downloader.rs
+++ b/crates/shirabe/src/downloader/perforce_downloader.rs
@@ -20,7 +20,7 @@ use shirabe_php_shim::{PhpMixed, impl_php_class};
#[derive(Debug)]
pub struct PerforceDownloader {
inner: VcsDownloaderBase,
- pub(crate) perforce: std::cell::RefCell<Option<Box<dyn PerforceInterface>>>,
+ perforce: std::cell::RefCell<Option<Box<dyn PerforceInterface>>>,
}
impl_php_class!(
diff --git a/crates/shirabe/src/downloader/svn_downloader.rs b/crates/shirabe/src/downloader/svn_downloader.rs
index 59916aa2..1487a710 100644
--- a/crates/shirabe/src/downloader/svn_downloader.rs
+++ b/crates/shirabe/src/downloader/svn_downloader.rs
@@ -23,7 +23,7 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct SvnDownloader {
inner: VcsDownloaderBase,
- pub(crate) cache_credentials: std::cell::Cell<bool>,
+ cache_credentials: std::cell::Cell<bool>,
}
impl_php_class!(SvnDownloader, r"Composer\Downloader\SvnDownloader");
@@ -41,7 +41,7 @@ impl SvnDownloader {
}
}
- pub(crate) fn execute(
+ fn execute(
&self,
package: PackageInterfaceHandle,
base_url: &str,
@@ -67,7 +67,7 @@ impl SvnDownloader {
})
}
- pub(crate) async fn discard_changes(&self, path: &str) -> anyhow::Result<Option<PhpMixed>> {
+ async fn discard_changes(&self, path: &str) -> anyhow::Result<Option<PhpMixed>> {
let mut output = String::new();
if self.inner.process.borrow_mut().execute_args(
["svn", "revert", "-R", "."].map(|s| s.to_string()).as_ref(),
diff --git a/crates/shirabe/src/downloader/transport_exception.rs b/crates/shirabe/src/downloader/transport_exception.rs
index da8b4c50..c9e1a092 100644
--- a/crates/shirabe/src/downloader/transport_exception.rs
+++ b/crates/shirabe/src/downloader/transport_exception.rs
@@ -5,10 +5,10 @@ use shirabe_php_shim::{PhpMixed, RuntimeException};
#[derive(Debug, Clone)]
pub struct TransportException {
inner: RuntimeException,
- pub(crate) headers: Option<Vec<String>>,
- pub(crate) response: Option<String>,
- pub(crate) status_code: Option<i64>,
- pub(crate) response_info: Vec<PhpMixed>,
+ headers: Option<Vec<String>>,
+ response: Option<String>,
+ status_code: Option<i64>,
+ response_info: Vec<PhpMixed>,
}
impl TransportException {
diff --git a/crates/shirabe/src/event_dispatcher/event.rs b/crates/shirabe/src/event_dispatcher/event.rs
index 7075ada0..3adb7405 100644
--- a/crates/shirabe/src/event_dispatcher/event.rs
+++ b/crates/shirabe/src/event_dispatcher/event.rs
@@ -5,9 +5,9 @@ use shirabe_php_shim::PhpMixed;
#[derive(Debug)]
pub struct Event {
- pub(crate) name: String,
- pub(crate) args: Vec<String>,
- pub(crate) flags: IndexMap<String, PhpMixed>,
+ name: String,
+ args: Vec<String>,
+ flags: IndexMap<String, PhpMixed>,
propagation_stopped: bool,
}
diff --git a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs
index 55d867b6..8aa75491 100644
--- a/crates/shirabe/src/event_dispatcher/event_dispatcher.rs
+++ b/crates/shirabe/src/event_dispatcher/event_dispatcher.rs
@@ -87,12 +87,12 @@ impl std::fmt::Debug for Callable {
/// `$dispatcher->dispatch(ScriptEvents::POST_INSTALL_CMD);`
#[derive(Debug)]
pub struct EventDispatcher {
- pub(crate) composer: PartialComposerWeakHandle,
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) loader: Option<ClassLoader>,
- pub(crate) process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
- pub(crate) listeners: IndexMap<String, IndexMap<i64, Vec<Callable>>>,
- pub(crate) run_scripts: bool,
+ composer: PartialComposerWeakHandle,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ loader: Option<ClassLoader>,
+ process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
+ listeners: IndexMap<String, IndexMap<i64, Vec<Callable>>>,
+ run_scripts: bool,
event_stack: Vec<String>,
skip_scripts: Vec<String>,
previous_hash: Option<String>,
diff --git a/crates/shirabe/src/installer.rs b/crates/shirabe/src/installer.rs
index 4ff6af3d..9b4a84e8 100644
--- a/crates/shirabe/src/installer.rs
+++ b/crates/shirabe/src/installer.rs
@@ -94,51 +94,49 @@ use shirabe_semver::constraint::SimpleConstraint;
#[derive(Debug)]
pub struct Installer {
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
- pub(crate) package: RootPackageInterfaceHandle,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
+ package: RootPackageInterfaceHandle,
// TODO can we get rid of the below and just use the package itself?
- pub(crate) fixed_root_package: RootPackageInterfaceHandle,
- pub(crate) download_manager: std::rc::Rc<std::cell::RefCell<dyn DownloadManagerInterface>>,
- pub(crate) repository_manager: std::rc::Rc<std::cell::RefCell<dyn RepositoryManagerInterface>>,
- pub(crate) locker: std::rc::Rc<std::cell::RefCell<dyn LockerInterface>>,
- pub(crate) installation_manager:
- std::rc::Rc<std::cell::RefCell<dyn InstallationManagerInterface>>,
- pub(crate) event_dispatcher: std::rc::Rc<std::cell::RefCell<dyn EventDispatcherInterface>>,
- pub(crate) autoload_generator: std::rc::Rc<std::cell::RefCell<dyn AutoloadGeneratorInterface>>,
- pub(crate) prefer_source: bool,
- pub(crate) prefer_dist: bool,
- pub(crate) optimize_autoloader: bool,
- pub(crate) class_map_authoritative: bool,
- pub(crate) apcu_autoloader: bool,
- pub(crate) apcu_autoloader_prefix: Option<String>,
- pub(crate) dev_mode: bool,
- pub(crate) dry_run: bool,
- pub(crate) download_only: bool,
- pub(crate) verbose: bool,
- pub(crate) update: bool,
- pub(crate) install: bool,
- pub(crate) dump_autoloader: bool,
- pub(crate) run_scripts: bool,
- pub(crate) prefer_stable: bool,
- pub(crate) prefer_lowest: bool,
- pub(crate) minimal_update: bool,
- pub(crate) write_lock: bool,
- pub(crate) execute_operations: bool,
- pub(crate) audit: bool,
- pub(crate) error_on_audit: bool,
- pub(crate) audit_format: String,
+ fixed_root_package: RootPackageInterfaceHandle,
+ download_manager: std::rc::Rc<std::cell::RefCell<dyn DownloadManagerInterface>>,
+ repository_manager: std::rc::Rc<std::cell::RefCell<dyn RepositoryManagerInterface>>,
+ locker: std::rc::Rc<std::cell::RefCell<dyn LockerInterface>>,
+ installation_manager: std::rc::Rc<std::cell::RefCell<dyn InstallationManagerInterface>>,
+ event_dispatcher: std::rc::Rc<std::cell::RefCell<dyn EventDispatcherInterface>>,
+ autoload_generator: std::rc::Rc<std::cell::RefCell<dyn AutoloadGeneratorInterface>>,
+ prefer_source: bool,
+ prefer_dist: bool,
+ optimize_autoloader: bool,
+ class_map_authoritative: bool,
+ apcu_autoloader: bool,
+ apcu_autoloader_prefix: Option<String>,
+ dev_mode: bool,
+ dry_run: bool,
+ download_only: bool,
+ verbose: bool,
+ update: bool,
+ install: bool,
+ dump_autoloader: bool,
+ run_scripts: bool,
+ prefer_stable: bool,
+ prefer_lowest: bool,
+ minimal_update: bool,
+ write_lock: bool,
+ execute_operations: bool,
+ audit: bool,
+ error_on_audit: bool,
+ audit_format: String,
audit_config: Option<AuditConfig>,
ignored_types: Vec<String>,
allowed_types: Option<Vec<String>>,
- pub(crate) update_mirrors: bool,
- pub(crate) update_allow_list: Option<Vec<String>>,
- pub(crate) update_allow_transitive_dependencies: UpdateAllowTransitiveDeps,
- pub(crate) suggested_packages_reporter:
- std::rc::Rc<std::cell::RefCell<SuggestedPackagesReporter>>,
- pub(crate) platform_requirement_filter: std::rc::Rc<dyn PlatformRequirementFilterInterface>,
- pub(crate) additional_fixed_repository: Option<crate::repository::RepositoryInterfaceHandle>,
- pub(crate) temporary_constraints: IndexMap<String, AnyConstraint>,
+ update_mirrors: bool,
+ update_allow_list: Option<Vec<String>>,
+ update_allow_transitive_dependencies: UpdateAllowTransitiveDeps,
+ suggested_packages_reporter: std::rc::Rc<std::cell::RefCell<SuggestedPackagesReporter>>,
+ platform_requirement_filter: std::rc::Rc<dyn PlatformRequirementFilterInterface>,
+ additional_fixed_repository: Option<crate::repository::RepositoryInterfaceHandle>,
+ temporary_constraints: IndexMap<String, AnyConstraint>,
}
impl Installer {
@@ -552,7 +550,7 @@ impl Installer {
}
#[tracing::instrument(skip_all)]
- pub(crate) fn do_update(
+ fn do_update(
&mut self,
local_repo: crate::repository::RepositoryInterfaceHandle,
do_install: bool,
@@ -915,7 +913,7 @@ impl Installer {
/// Run the solver a second time on top of the existing update result with only the current result set in the pool
/// and see what packages would get removed if we only had the non-dev packages in the solver request
- pub(crate) fn extract_dev_packages(
+ fn extract_dev_packages(
&mut self,
lock_transaction: &mut LockTransaction,
platform_repo: &PlatformRepositoryHandle,
@@ -999,7 +997,7 @@ impl Installer {
}
/// Whether the function is called as part of an update command or independently
- pub(crate) fn do_install(
+ fn do_install(
&mut self,
local_repo: crate::repository::RepositoryInterfaceHandle,
already_solved: bool,
@@ -1285,7 +1283,7 @@ impl Installer {
Ok(0)
}
- pub(crate) fn create_platform_repo(
+ fn create_platform_repo(
&mut self,
for_update: bool,
) -> anyhow::Result<PlatformRepositoryHandle> {
diff --git a/crates/shirabe/src/installer/binary_installer.rs b/crates/shirabe/src/installer/binary_installer.rs
index 8cd4fe5a..32e4c071 100644
--- a/crates/shirabe/src/installer/binary_installer.rs
+++ b/crates/shirabe/src/installer/binary_installer.rs
@@ -47,10 +47,10 @@ impl BinaryInstallerInterface for BinaryInstaller {
/// Utility to handle installation of package "bin"/binaries
#[derive(Debug)]
pub struct BinaryInstaller {
- pub(crate) bin_dir: String,
- pub(crate) bin_compat: String,
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) filesystem: std::rc::Rc<std::cell::RefCell<Filesystem>>,
+ bin_dir: String,
+ bin_compat: String,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ filesystem: std::rc::Rc<std::cell::RefCell<Filesystem>>,
vendor_dir: Option<String>,
}
@@ -219,11 +219,11 @@ impl BinaryInstaller {
"php".to_string()
}
- pub(crate) fn get_binaries(&self, package: PackageInterfaceHandle) -> Vec<String> {
+ fn get_binaries(&self, package: PackageInterfaceHandle) -> Vec<String> {
package.get_binaries()
}
- pub(crate) fn install_full_binaries(
+ fn install_full_binaries(
&mut self,
bin_path: &str,
link: &str,
@@ -258,7 +258,7 @@ impl BinaryInstaller {
}
}
- pub(crate) fn install_unixy_proxy_binaries(&self, bin_path: &str, link: &str) {
+ fn install_unixy_proxy_binaries(&self, bin_path: &str, link: &str) {
let code = self.generate_unixy_proxy_code(bin_path, link);
file_put_contents(link, code.as_bytes());
let link_owned = link.to_string();
@@ -268,14 +268,14 @@ impl BinaryInstaller {
});
}
- pub(crate) fn initialize_bin_dir(&mut self) {
+ fn initialize_bin_dir(&mut self) {
self.filesystem
.borrow_mut()
.ensure_directory_exists(&self.bin_dir);
self.bin_dir = realpath(&self.bin_dir).unwrap_or_default();
}
- pub(crate) fn generate_windows_proxy_code(&self, bin: &str, link: &str) -> String {
+ fn generate_windows_proxy_code(&self, bin: &str, link: &str) -> String {
let bin_path = self
.filesystem
.borrow_mut()
@@ -311,7 +311,7 @@ impl BinaryInstaller {
)
}
- pub(crate) fn generate_unixy_proxy_code(&self, bin: &str, link: &str) -> String {
+ fn generate_unixy_proxy_code(&self, bin: &str, link: &str) -> String {
let bin_path = self
.filesystem
.borrow_mut()
diff --git a/crates/shirabe/src/installer/library_installer.rs b/crates/shirabe/src/installer/library_installer.rs
index cab1e206..5f3b2054 100644
--- a/crates/shirabe/src/installer/library_installer.rs
+++ b/crates/shirabe/src/installer/library_installer.rs
@@ -24,13 +24,12 @@ pub struct LibraryInstaller {
pub(crate) composer: PartialComposerWeakHandle,
/// Behind a RefCell so initialize_vendor_dir can canonicalize it through `&self` (the
/// installer instance is shared between concurrent package operations).
- pub(crate) vendor_dir: std::cell::RefCell<String>,
- pub(crate) download_manager:
- Option<std::rc::Rc<std::cell::RefCell<dyn DownloadManagerInterface>>>,
+ vendor_dir: std::cell::RefCell<String>,
+ download_manager: Option<std::rc::Rc<std::cell::RefCell<dyn DownloadManagerInterface>>>,
pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) r#type: Option<String>,
- pub(crate) filesystem: std::rc::Rc<std::cell::RefCell<Filesystem>>,
- pub(crate) binary_installer: std::rc::Rc<std::cell::RefCell<dyn BinaryInstallerInterface>>,
+ r#type: Option<String>,
+ filesystem: std::rc::Rc<std::cell::RefCell<Filesystem>>,
+ binary_installer: std::rc::Rc<std::cell::RefCell<dyn BinaryInstallerInterface>>,
}
impl LibraryInstaller {
@@ -121,7 +120,7 @@ impl LibraryInstaller {
///
/// It is used for BC as getInstallPath tends to be overridden by
/// installer plugins but not getPackageBasePath
- pub(crate) fn get_package_base_path(&self, package: PackageInterfaceHandle) -> String {
+ fn get_package_base_path(&self, package: PackageInterfaceHandle) -> String {
let install_path = self.get_install_path(package.clone()).unwrap();
let target_dir = package.get_target_dir();
@@ -142,7 +141,7 @@ impl LibraryInstaller {
install_path
}
- pub(crate) async fn install_code(
+ async fn install_code(
&self,
package: PackageInterfaceHandle,
) -> anyhow::Result<Option<PhpMixed>> {
@@ -154,7 +153,7 @@ impl LibraryInstaller {
.await
}
- pub(crate) async fn update_code(
+ async fn update_code(
&self,
initial: PackageInterfaceHandle,
target: PackageInterfaceHandle,
@@ -183,7 +182,7 @@ impl LibraryInstaller {
.await
}
- pub(crate) async fn remove_code(
+ async fn remove_code(
&self,
package: PackageInterfaceHandle,
) -> anyhow::Result<Option<PhpMixed>> {
@@ -195,7 +194,7 @@ impl LibraryInstaller {
.await
}
- pub(crate) fn initialize_vendor_dir(&self) {
+ fn initialize_vendor_dir(&self) {
self.filesystem
.borrow_mut()
.ensure_directory_exists(&self.vendor_dir.borrow());
@@ -203,7 +202,7 @@ impl LibraryInstaller {
*self.vendor_dir.borrow_mut() = realpath;
}
- pub(crate) fn get_download_manager(
+ fn get_download_manager(
&self,
) -> &std::rc::Rc<std::cell::RefCell<dyn DownloadManagerInterface>> {
// PHP: assert($this->downloadManager instanceof DownloadManager, new \LogicException(...))
diff --git a/crates/shirabe/src/io/console_io.rs b/crates/shirabe/src/io/console_io.rs
index 6e78a105..00286aba 100644
--- a/crates/shirabe/src/io/console_io.rs
+++ b/crates/shirabe/src/io/console_io.rs
@@ -40,8 +40,8 @@ pub struct ConsoleIO {
/// directly instead of a `HelperSet`.
question_helper: std::cell::RefCell<QuestionHelper>,
- pub(crate) last_message: std::cell::RefCell<String>,
- pub(crate) last_message_err: std::cell::RefCell<String>,
+ last_message: std::cell::RefCell<String>,
+ last_message_err: std::cell::RefCell<String>,
start_time: Option<f64>,
verbosity_map: IndexMap<i64, i64>,
diff --git a/crates/shirabe/src/json.rs b/crates/shirabe/src/json.rs
index e5c34063..2f6068d3 100644
--- a/crates/shirabe/src/json.rs
+++ b/crates/shirabe/src/json.rs
@@ -1,5 +1,5 @@
pub mod json_file;
-pub(crate) mod json_grammar;
+mod json_grammar;
pub mod json_manipulator;
pub mod json_validation_exception;
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs
index 652f1d89..78ed76d7 100644
--- a/crates/shirabe/src/json/json_file.rs
+++ b/crates/shirabe/src/json/json_file.rs
@@ -516,7 +516,7 @@ impl JsonFile {
/// @throws \UnexpectedValueException
/// @throws ParsingException
/// @return bool true on success
- pub(crate) fn validate_syntax(json: &str, file: Option<&str>) -> anyhow::Result<bool> {
+ fn validate_syntax(json: &str, file: Option<&str>) -> anyhow::Result<bool> {
// TODO(php-semantics): make json_decode() returns an error object with details.
let error = match serde_json::from_str::<serde_json::Value>(json) {
Ok(_) => {
diff --git a/crates/shirabe/src/json/json_manipulator.rs b/crates/shirabe/src/json/json_manipulator.rs
index 2fa4fe8f..766137ca 100644
--- a/crates/shirabe/src/json/json_manipulator.rs
+++ b/crates/shirabe/src/json/json_manipulator.rs
@@ -1546,7 +1546,7 @@ impl JsonManipulator {
JsonFile::encode(&data)
}
- pub(crate) fn detect_indenting(&mut self) {
+ fn detect_indenting(&mut self) {
self.indent = JsonFile::detect_indenting(Some(&self.contents));
}
}
diff --git a/crates/shirabe/src/json/json_validation_exception.rs b/crates/shirabe/src/json/json_validation_exception.rs
index cb7370d2..27661e38 100644
--- a/crates/shirabe/src/json/json_validation_exception.rs
+++ b/crates/shirabe/src/json/json_validation_exception.rs
@@ -5,7 +5,7 @@ use shirabe_php_shim::Exception;
#[derive(Debug)]
pub struct JsonValidationException {
inner: Exception,
- pub(crate) errors: Vec<String>,
+ errors: Vec<String>,
}
impl JsonValidationException {
diff --git a/crates/shirabe/src/package/alias_package.rs b/crates/shirabe/src/package/alias_package.rs
index 52b6efa4..9df804f1 100644
--- a/crates/shirabe/src/package/alias_package.rs
+++ b/crates/shirabe/src/package/alias_package.rs
@@ -23,18 +23,18 @@ pub struct AliasPackage {
repository: Option<RepositoryInterfaceWeakHandle>,
/// @var string
- pub(crate) version: String,
+ version: String,
/// @var string
- pub(crate) pretty_version: String,
+ pretty_version: String,
/// @var bool
- pub(crate) dev: bool,
+ dev: bool,
/// @var bool
- pub(crate) root_package_alias: bool,
+ root_package_alias: bool,
/// @var string
/// @phpstan-var 'stable'|'RC'|'beta'|'alpha'|'dev'
- pub(crate) stability: String,
+ stability: String,
/// @var bool
- pub(crate) has_self_version_requires: bool,
+ has_self_version_requires: bool,
/// @var BasePackage
pub(crate) alias_of: PackageHandle,
diff --git a/crates/shirabe/src/package/archiver/archivable_files_finder.rs b/crates/shirabe/src/package/archiver/archivable_files_finder.rs
index 72fe0646..8fba18cb 100644
--- a/crates/shirabe/src/package/archiver/archivable_files_finder.rs
+++ b/crates/shirabe/src/package/archiver/archivable_files_finder.rs
@@ -10,7 +10,7 @@ use shirabe_symfony_finder::Finder;
use std::path::{Path, PathBuf};
pub struct ArchivableFilesFinder {
- pub(crate) finder: Finder,
+ finder: Finder,
inner_iter: Box<dyn Iterator<Item = PathBuf>>,
}
diff --git a/crates/shirabe/src/package/archiver/archive_manager.rs b/crates/shirabe/src/package/archiver/archive_manager.rs
index 0d99d301..a0216d88 100644
--- a/crates/shirabe/src/package/archiver/archive_manager.rs
+++ b/crates/shirabe/src/package/archiver/archive_manager.rs
@@ -17,10 +17,10 @@ use shirabe_php_shim::{
};
pub struct ArchiveManager {
- pub(crate) download_manager: std::rc::Rc<std::cell::RefCell<DownloadManager>>,
- pub(crate) r#loop: std::rc::Rc<std::cell::RefCell<Loop>>,
- pub(crate) archivers: Vec<Box<dyn ArchiverInterface>>,
- pub(crate) overwrite_files: bool,
+ download_manager: std::rc::Rc<std::cell::RefCell<DownloadManager>>,
+ r#loop: std::rc::Rc<std::cell::RefCell<Loop>>,
+ archivers: Vec<Box<dyn ArchiverInterface>>,
+ overwrite_files: bool,
}
impl std::fmt::Debug for ArchiveManager {
diff --git a/crates/shirabe/src/package/complete_package.rs b/crates/shirabe/src/package/complete_package.rs
index b2c3978c..00b4a67c 100644
--- a/crates/shirabe/src/package/complete_package.rs
+++ b/crates/shirabe/src/package/complete_package.rs
@@ -11,18 +11,18 @@ use shirabe_php_shim::PhpMixed;
#[derive(Debug, Clone)]
pub struct CompletePackage {
pub(crate) inner: Package,
- pub(crate) repositories: IndexMap<String, PhpMixed>,
- pub(crate) license: Vec<String>,
- pub(crate) keywords: Vec<String>,
- pub(crate) authors: Vec<IndexMap<String, String>>,
- pub(crate) description: Option<String>,
- pub(crate) homepage: Option<String>,
- pub(crate) scripts: IndexMap<String, Vec<String>>,
- pub(crate) support: IndexMap<String, String>,
- pub(crate) funding: Vec<IndexMap<String, PhpMixed>>,
- pub(crate) abandoned: PhpMixed,
- pub(crate) archive_name: Option<String>,
- pub(crate) archive_excludes: Vec<String>,
+ repositories: IndexMap<String, PhpMixed>,
+ license: Vec<String>,
+ keywords: Vec<String>,
+ authors: Vec<IndexMap<String, String>>,
+ description: Option<String>,
+ homepage: Option<String>,
+ scripts: IndexMap<String, Vec<String>>,
+ support: IndexMap<String, String>,
+ funding: Vec<IndexMap<String, PhpMixed>>,
+ abandoned: PhpMixed,
+ archive_name: Option<String>,
+ archive_excludes: Vec<String>,
}
impl CompletePackage {
diff --git a/crates/shirabe/src/package/link.rs b/crates/shirabe/src/package/link.rs
index 027fa009..fc0a8063 100644
--- a/crates/shirabe/src/package/link.rs
+++ b/crates/shirabe/src/package/link.rs
@@ -5,11 +5,11 @@ use shirabe_semver::constraint::AnyConstraint;
#[derive(Clone, Debug)]
pub struct Link {
- pub(crate) source: String,
- pub(crate) target: String,
- pub(crate) constraint: AnyConstraint,
- pub(crate) description: String,
- pub(crate) pretty_constraint: String,
+ source: String,
+ target: String,
+ constraint: AnyConstraint,
+ description: String,
+ pretty_constraint: String,
}
impl Link {
diff --git a/crates/shirabe/src/package/loader/array_loader.rs b/crates/shirabe/src/package/loader/array_loader.rs
index df588cf9..21811f14 100644
--- a/crates/shirabe/src/package/loader/array_loader.rs
+++ b/crates/shirabe/src/package/loader/array_loader.rs
@@ -29,7 +29,7 @@ pub struct ArrayLoader {
/// @var VersionParser
pub(crate) version_parser: VersionParser,
/// @var bool
- pub(crate) load_options: bool,
+ load_options: bool,
}
impl ArrayLoader {
diff --git a/crates/shirabe/src/package/package.rs b/crates/shirabe/src/package/package.rs
index ee1a5e10..4e35ee55 100644
--- a/crates/shirabe/src/package/package.rs
+++ b/crates/shirabe/src/package/package.rs
@@ -31,41 +31,41 @@ pub struct Package {
/// Back-reference to the owning repository. `Weak` breaks the repository -> packages cycle.
repository: Option<RepositoryInterfaceWeakHandle>,
- pub(crate) r#type: Option<String>,
- pub(crate) target_dir: Option<String>,
+ r#type: Option<String>,
+ target_dir: Option<String>,
/// `'source'` | `'dist'` | `null`
- pub(crate) installation_source: Option<String>,
- pub(crate) source_type: Option<String>,
- pub(crate) source_url: Option<String>,
- pub(crate) source_reference: Option<String>,
- pub(crate) source_mirrors: Option<Vec<Mirror>>,
- pub(crate) dist_type: Option<String>,
- pub(crate) dist_url: Option<String>,
- pub(crate) dist_reference: Option<String>,
- pub(crate) dist_sha1_checksum: Option<String>,
- pub(crate) dist_mirrors: Option<Vec<Mirror>>,
- pub(crate) version: String,
- pub(crate) pretty_version: String,
- pub(crate) release_date: Option<chrono::DateTime<chrono::Utc>>,
- pub(crate) extra: IndexMap<String, PhpMixed>,
- pub(crate) binaries: Vec<String>,
- pub(crate) dev: bool,
+ installation_source: Option<String>,
+ source_type: Option<String>,
+ source_url: Option<String>,
+ source_reference: Option<String>,
+ source_mirrors: Option<Vec<Mirror>>,
+ dist_type: Option<String>,
+ dist_url: Option<String>,
+ dist_reference: Option<String>,
+ dist_sha1_checksum: Option<String>,
+ dist_mirrors: Option<Vec<Mirror>>,
+ version: String,
+ pretty_version: String,
+ release_date: Option<chrono::DateTime<chrono::Utc>>,
+ extra: IndexMap<String, PhpMixed>,
+ binaries: Vec<String>,
+ dev: bool,
/// `'stable'` | `'RC'` | `'beta'` | `'alpha'` | `'dev'`
- pub(crate) stability: String,
- pub(crate) notification_url: Option<String>,
+ stability: String,
+ notification_url: Option<String>,
- pub(crate) requires: IndexMap<String, Link>,
- pub(crate) conflicts: IndexMap<String, Link>,
- pub(crate) provides: IndexMap<String, Link>,
- pub(crate) replaces: IndexMap<String, Link>,
- pub(crate) dev_requires: IndexMap<String, Link>,
- pub(crate) suggests: IndexMap<String, String>,
- pub(crate) autoload: IndexMap<String, PhpMixed>,
- pub(crate) dev_autoload: IndexMap<String, PhpMixed>,
- pub(crate) include_paths: Vec<String>,
- pub(crate) is_default_branch: bool,
- pub(crate) transport_options: IndexMap<String, PhpMixed>,
- pub(crate) php_ext: Option<IndexMap<String, PhpMixed>>,
+ requires: IndexMap<String, Link>,
+ conflicts: IndexMap<String, Link>,
+ provides: IndexMap<String, Link>,
+ replaces: IndexMap<String, Link>,
+ dev_requires: IndexMap<String, Link>,
+ suggests: IndexMap<String, String>,
+ autoload: IndexMap<String, PhpMixed>,
+ dev_autoload: IndexMap<String, PhpMixed>,
+ include_paths: Vec<String>,
+ is_default_branch: bool,
+ transport_options: IndexMap<String, PhpMixed>,
+ php_ext: Option<IndexMap<String, PhpMixed>>,
}
impl Package {
diff --git a/crates/shirabe/src/package/root_package.rs b/crates/shirabe/src/package/root_package.rs
index 2c2b87ea..0807d15b 100644
--- a/crates/shirabe/src/package/root_package.rs
+++ b/crates/shirabe/src/package/root_package.rs
@@ -15,12 +15,12 @@ use shirabe_php_shim::PhpMixed;
#[derive(Debug, Clone)]
pub struct RootPackage {
pub(crate) inner: CompletePackage,
- pub(crate) minimum_stability: String,
- pub(crate) prefer_stable: bool,
- pub(crate) stability_flags: IndexMap<String, i64>,
- pub(crate) config: IndexMap<String, PhpMixed>,
- pub(crate) references: IndexMap<String, String>,
- pub(crate) aliases: Vec<IndexMap<String, String>>,
+ minimum_stability: String,
+ prefer_stable: bool,
+ stability_flags: IndexMap<String, i64>,
+ config: IndexMap<String, PhpMixed>,
+ references: IndexMap<String, String>,
+ aliases: Vec<IndexMap<String, String>>,
}
impl RootPackage {
diff --git a/crates/shirabe/src/plugin/php_plugin_proxy.rs b/crates/shirabe/src/plugin/php_plugin_proxy.rs
index 9a93ef72..967faa1b 100644
--- a/crates/shirabe/src/plugin/php_plugin_proxy.rs
+++ b/crates/shirabe/src/plugin/php_plugin_proxy.rs
@@ -190,9 +190,7 @@ fn operation_stub_class(operation: &AnyOperation) -> &'static str {
}
/// Registers a package and returns its wire descriptor.
-pub(crate) fn package_handle_value(
- package: &std::rc::Rc<std::cell::RefCell<AnyPackage>>,
-) -> PluginValue {
+fn package_handle_value(package: &std::rc::Rc<std::cell::RefCell<AnyPackage>>) -> PluginValue {
let class = package_stub_class(package);
let rhandle = register_entity(RustEntity::Package(package.clone()));
rust_handle_value(rhandle, class)
@@ -2442,11 +2440,11 @@ pub(crate) fn repository_handle_value(
/// `composer-installer` package names. Every call is forwarded as a `CallPhpMethod` RPC.
#[derive(Debug)]
pub struct PhpInstallerProxy {
- pub(crate) handle: PhpObjHandle,
+ handle: PhpObjHandle,
}
impl PhpInstallerProxy {
- pub(crate) fn new(handle: PhpObjHandle) -> Self {
+ fn new(handle: PhpObjHandle) -> Self {
Self { handle }
}
@@ -2674,7 +2672,7 @@ fn forget_php_installer_proxy(phandle: u64) {
/// `Composer\Plugin\Capability\Capability` marker).
#[derive(Debug)]
pub struct PhpCapabilityProxy {
- pub(crate) handle: PhpObjHandle,
+ handle: PhpObjHandle,
}
impl PhpCapabilityProxy {
@@ -2831,7 +2829,7 @@ impl RustCommandMetadata {
/// `Application::register_worker_console_commands` as worker-hosted commands are registered,
/// booted in the worker the first time one of them actually runs.
#[derive(Debug)]
-pub(crate) struct PhpConsoleApplicationContext {
+struct PhpConsoleApplicationContext {
composer: Option<ComposerHandle>,
io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
initial_working_directory: Option<String>,
@@ -2995,7 +2993,7 @@ pub struct PhpCommandProxy {
}
impl PhpCommandProxy {
- pub(crate) fn new(handle: PhpObjHandle) -> anyhow::Result<Self> {
+ fn new(handle: PhpObjHandle) -> anyhow::Result<Self> {
let proxy_command = match Self::call_metadata_getter(&handle, "isProxyCommand")? {
PluginValue::Bool(proxy_command) => proxy_command,
other => return Err(Self::unsupported_shape(&handle, "isProxyCommand", &other)),
diff --git a/crates/shirabe/src/plugin/plugin_manager.rs b/crates/shirabe/src/plugin/plugin_manager.rs
index 9f569af7..b02a702d 100644
--- a/crates/shirabe/src/plugin/plugin_manager.rs
+++ b/crates/shirabe/src/plugin/plugin_manager.rs
@@ -36,15 +36,15 @@ use shirabe_semver::constraint::SimpleConstraint;
#[derive(Debug)]
pub struct PluginManager {
- pub(crate) composer: ComposerWeakHandle,
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) global_composer: Option<PartialComposerHandle>,
- pub(crate) version_parser: VersionParser,
- pub(crate) disable_plugins: DisablePlugins,
+ composer: ComposerWeakHandle,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ global_composer: Option<PartialComposerHandle>,
+ version_parser: VersionParser,
+ disable_plugins: DisablePlugins,
// PHP stores the same plugin instance in both $plugins and $registeredPlugins (reference
// semantics); shared handles preserve the identity comparisons that relies on.
- pub(crate) plugins: Vec<std::rc::Rc<std::cell::RefCell<dyn PluginInterface>>>,
- pub(crate) registered_plugins: IndexMap<String, Vec<PluginOrInstaller>>,
+ plugins: Vec<std::rc::Rc<std::cell::RefCell<dyn PluginInterface>>>,
+ registered_plugins: IndexMap<String, Vec<PluginOrInstaller>>,
allow_plugin_rules: Option<IndexMap<String, bool>>,
allow_global_plugin_rules: Option<IndexMap<String, bool>>,
running_in_global_dir: bool,
@@ -696,7 +696,7 @@ impl PluginManager {
}
/// Returns the version of the internal composer-plugin-api package.
- pub(crate) fn get_plugin_api_version(&self) -> String {
+ fn get_plugin_api_version(&self) -> String {
match &self.plugin_api_version_override {
Some(version) => version.clone(),
None => plugin_interface::PLUGIN_API_VERSION.to_string(),
@@ -996,7 +996,7 @@ impl PluginManager {
.get_install_path(package)
}
- pub(crate) fn get_capability_implementation_class_name(
+ fn get_capability_implementation_class_name(
&self,
plugin: &dyn PluginInterface,
capability: &str,
diff --git a/crates/shirabe/src/repository/array_repository.rs b/crates/shirabe/src/repository/array_repository.rs
index e5ed607d..b28cccdc 100644
--- a/crates/shirabe/src/repository/array_repository.rs
+++ b/crates/shirabe/src/repository/array_repository.rs
@@ -79,7 +79,7 @@ impl ArrayRepository {
Ok(None)
}
- pub(crate) fn find_packages_internal(
+ fn find_packages_internal(
&self,
name: &str,
constraint: Option<FindPackageConstraint>,
@@ -157,7 +157,7 @@ impl ArrayRepository {
Ok(())
}
- pub(crate) fn create_alias_package(
+ fn create_alias_package(
&self,
package: BasePackageHandle,
alias: String,
diff --git a/crates/shirabe/src/repository/artifact_repository.rs b/crates/shirabe/src/repository/artifact_repository.rs
index 75ad134b..c225e84d 100644
--- a/crates/shirabe/src/repository/artifact_repository.rs
+++ b/crates/shirabe/src/repository/artifact_repository.rs
@@ -26,9 +26,9 @@ use std::path::Path;
pub struct ArtifactRepository {
inner: ArrayRepository,
- pub(crate) loader: Box<dyn LoaderInterface>,
- pub(crate) lookup: String,
- pub(crate) repo_config: IndexMap<String, PhpMixed>,
+ loader: Box<dyn LoaderInterface>,
+ lookup: String,
+ repo_config: IndexMap<String, PhpMixed>,
io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
}
diff --git a/crates/shirabe/src/repository/composer_repository.rs b/crates/shirabe/src/repository/composer_repository.rs
index 33944c8f..03439a7b 100644
--- a/crates/shirabe/src/repository/composer_repository.rs
+++ b/crates/shirabe/src/repository/composer_repository.rs
@@ -94,19 +94,19 @@ pub struct ComposerRepository {
io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>,
r#loop: std::rc::Rc<std::cell::RefCell<Loop>>,
- pub(crate) cache: std::cell::RefCell<Cache>,
- pub(crate) notify_url: Option<String>,
- pub(crate) search_url: Option<String>,
- pub(crate) providers_api_url: Option<String>,
- pub(crate) has_providers: bool,
- pub(crate) providers_url: Option<String>,
- pub(crate) list_url: Option<String>,
- pub(crate) has_available_package_list: bool,
- pub(crate) available_packages: Option<IndexMap<String, String>>,
- pub(crate) available_package_patterns: Option<Vec<String>>,
- pub(crate) lazy_providers_url: Option<String>,
- pub(crate) provider_listing: Option<IndexMap<String, ProviderListingEntry>>,
- pub(crate) loader: ArrayLoader,
+ cache: std::cell::RefCell<Cache>,
+ notify_url: Option<String>,
+ search_url: Option<String>,
+ providers_api_url: Option<String>,
+ has_providers: bool,
+ providers_url: Option<String>,
+ list_url: Option<String>,
+ has_available_package_list: bool,
+ available_packages: Option<IndexMap<String, String>>,
+ available_package_patterns: Option<Vec<String>>,
+ lazy_providers_url: Option<String>,
+ provider_listing: Option<IndexMap<String, ProviderListingEntry>>,
+ loader: ArrayLoader,
allow_ssl_downgrade: bool,
event_dispatcher: Option<std::rc::Rc<std::cell::RefCell<EventDispatcher>>>,
source_mirrors: Option<IndexMap<String, Vec<SourceMirror>>>,
@@ -3324,7 +3324,7 @@ impl ComposerRepository {
/// Checks if the package name is present in this lazy providers repo
///
/// @return true if the package name is present in availablePackages or matched by availablePackagePatterns
- pub(crate) fn lazy_providers_repo_contains(&self, name: &str) -> anyhow::Result<bool> {
+ fn lazy_providers_repo_contains(&self, name: &str) -> anyhow::Result<bool> {
if !self.has_available_package_list {
return Err(LogicException::new("lazyProvidersRepoContains should not be called unless hasAvailablePackageList is true".to_string()).into());
}
diff --git a/crates/shirabe/src/repository/filesystem_repository.rs b/crates/shirabe/src/repository/filesystem_repository.rs
index b39fe829..54c2fa1f 100644
--- a/crates/shirabe/src/repository/filesystem_repository.rs
+++ b/crates/shirabe/src/repository/filesystem_repository.rs
@@ -95,7 +95,7 @@ impl FilesystemRepository {
}
/// Initializes repository (reads file, or remote address).
- pub(crate) fn initialize(&self) -> anyhow::Result<()> {
+ fn initialize(&self) -> anyhow::Result<()> {
self.inner.initialize();
if !self.file.exists() {
diff --git a/crates/shirabe/src/repository/path_repository.rs b/crates/shirabe/src/repository/path_repository.rs
index 828474e6..680911eb 100644
--- a/crates/shirabe/src/repository/path_repository.rs
+++ b/crates/shirabe/src/repository/path_repository.rs
@@ -153,7 +153,7 @@ impl PathRepository {
Ok(())
}
- pub(crate) fn initialize(&self) -> anyhow::Result<()> {
+ fn initialize(&self) -> anyhow::Result<()> {
self.inner.initialize();
let url_matches = self.get_url_matches()?;
diff --git a/crates/shirabe/src/repository/platform_repository.rs b/crates/shirabe/src/repository/platform_repository.rs
index e43892a0..7c7030f0 100644
--- a/crates/shirabe/src/repository/platform_repository.rs
+++ b/crates/shirabe/src/repository/platform_repository.rs
@@ -40,12 +40,12 @@ pub struct PlatformOverride {
#[derive(Debug)]
pub struct PlatformRepository {
- pub(crate) inner: ArrayRepository,
- pub(crate) version_parser: Option<VersionParser>,
- pub(crate) overrides: IndexMap<String, PlatformOverride>,
- pub(crate) disabled_packages: IndexMap<String, CompletePackageInterfaceHandle>,
- pub(crate) platform_info: Option<PlatformInfo>,
- pub(crate) hhvm_detector: Box<dyn HhvmDetectorInterface>,
+ inner: ArrayRepository,
+ version_parser: Option<VersionParser>,
+ overrides: IndexMap<String, PlatformOverride>,
+ disabled_packages: IndexMap<String, CompletePackageInterfaceHandle>,
+ platform_info: Option<PlatformInfo>,
+ hhvm_detector: Box<dyn HhvmDetectorInterface>,
}
impl PlatformRepository {
@@ -123,7 +123,7 @@ impl PlatformRepository {
}
#[tracing::instrument(skip_all)]
- pub(crate) fn initialize(&mut self) -> anyhow::Result<()> {
+ fn initialize(&mut self) -> anyhow::Result<()> {
self.inner.initialize();
let platform_info = self
diff --git a/crates/shirabe/src/repository/repository_set.rs b/crates/shirabe/src/repository/repository_set.rs
index bd57ec20..24b11d51 100644
--- a/crates/shirabe/src/repository/repository_set.rs
+++ b/crates/shirabe/src/repository/repository_set.rs
@@ -50,29 +50,29 @@ pub struct RepositorySet {
/// @var array[]
/// @phpstan-var array<string, array<string, array{alias: string, alias_normalized: string}>>
- pub(crate) root_aliases: IndexMap<String, IndexMap<String, RootAliasEntry>>,
+ root_aliases: IndexMap<String, IndexMap<String, RootAliasEntry>>,
/// @var string[]
/// @phpstan-var array<string, string>
- pub(crate) root_references: IndexMap<String, String>,
+ root_references: IndexMap<String, String>,
/// @var RepositoryInterface[]
- pub(crate) repositories: Vec<RepositoryInterfaceHandle>,
+ repositories: Vec<RepositoryInterfaceHandle>,
/// @var int[] array of stability => BasePackage::STABILITY_* value
/// @phpstan-var array<key-of<BasePackage::STABILITIES>, BasePackage::STABILITY_*>
- pub(crate) acceptable_stabilities: IndexMap<String, i64>,
+ acceptable_stabilities: IndexMap<String, i64>,
/// @var int[] array of package name => BasePackage::STABILITY_* value
/// @phpstan-var array<string, BasePackage::STABILITY_*>
- pub(crate) stability_flags: IndexMap<String, i64>,
+ stability_flags: IndexMap<String, i64>,
/// @var ConstraintInterface[]
/// @phpstan-var array<string, ConstraintInterface>
- pub(crate) root_requires: IndexMap<String, AnyConstraint>,
+ root_requires: IndexMap<String, AnyConstraint>,
/// @var array<string, ConstraintInterface>
- pub(crate) temporary_constraints: IndexMap<String, AnyConstraint>,
+ temporary_constraints: IndexMap<String, AnyConstraint>,
/// @var bool
locked: bool,
diff --git a/crates/shirabe/src/repository/vcs/forgejo_driver.rs b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
index 54f5dddd..7687db0d 100644
--- a/crates/shirabe/src/repository/vcs/forgejo_driver.rs
+++ b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
@@ -23,12 +23,12 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct ForgejoDriver {
- pub(crate) inner: VcsDriverBase,
- pub(crate) forgejo_url: Option<ForgejoUrl>,
- pub(crate) repository_data: Option<ForgejoRepositoryData>,
- pub(crate) git_driver: Option<GitDriver>,
- pub(crate) tags: Option<IndexMap<String, String>>,
- pub(crate) branches: Option<IndexMap<String, String>>,
+ inner: VcsDriverBase,
+ forgejo_url: Option<ForgejoUrl>,
+ repository_data: Option<ForgejoRepositoryData>,
+ git_driver: Option<GitDriver>,
+ tags: Option<IndexMap<String, String>>,
+ branches: Option<IndexMap<String, String>>,
}
impl ForgejoDriver {
@@ -595,7 +595,7 @@ impl ForgejoDriver {
None
}
- pub(crate) fn get_contents(
+ fn get_contents(
&mut self,
url: &str,
fetching_repo_data: bool,
diff --git a/crates/shirabe/src/repository/vcs/fossil_driver.rs b/crates/shirabe/src/repository/vcs/fossil_driver.rs
index 9a0c4b2e..8ce479fd 100644
--- a/crates/shirabe/src/repository/vcs/fossil_driver.rs
+++ b/crates/shirabe/src/repository/vcs/fossil_driver.rs
@@ -19,12 +19,12 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct FossilDriver {
- pub(crate) inner: VcsDriverBase,
- pub(crate) tags: Option<IndexMap<String, String>>,
- pub(crate) branches: Option<IndexMap<String, String>>,
- pub(crate) root_identifier: Option<String>,
- pub(crate) repo_file: Option<String>,
- pub(crate) checkout_dir: String,
+ inner: VcsDriverBase,
+ tags: Option<IndexMap<String, String>>,
+ branches: Option<IndexMap<String, String>>,
+ root_identifier: Option<String>,
+ repo_file: Option<String>,
+ checkout_dir: String,
}
impl FossilDriver {
@@ -95,7 +95,7 @@ impl FossilDriver {
Ok(())
}
- pub(crate) fn check_fossil(&self) -> anyhow::Result<()> {
+ fn check_fossil(&self) -> anyhow::Result<()> {
let mut ignored_output = String::new();
if self.inner.process.borrow_mut().execute_args(
["fossil", "version"].map(|s| s.to_string()).as_ref(),
@@ -112,7 +112,7 @@ impl FossilDriver {
Ok(())
}
- pub(crate) fn update_local_repo(&mut self) -> anyhow::Result<()> {
+ fn update_local_repo(&mut self) -> anyhow::Result<()> {
assert!(self.repo_file.is_some());
let mut fs = Filesystem::new(None);
diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
index c3da08ff..9558e3b2 100644
--- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
+++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
@@ -24,11 +24,11 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct GitBitbucketDriver {
- pub(crate) inner: VcsDriverBase,
+ inner: VcsDriverBase,
/// @var string
- pub(crate) owner: String,
+ owner: String,
/// @var string
- pub(crate) repository: String,
+ repository: String,
/// @var bool
has_issues: bool,
/// @var ?string
@@ -50,7 +50,7 @@ pub struct GitBitbucketDriver {
/// @var array<string, mixed>
repo_data: IndexMap<String, PhpMixed>,
/// @var ?VcsDriver
- pub(crate) fallback_driver: Option<Box<dyn VcsDriverInterface>>,
+ fallback_driver: Option<Box<dyn VcsDriverInterface>>,
/// @var string|null if set either git or hg
vcs_type: Option<String>,
}
diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs
index 9dbb8513..56ff3853 100644
--- a/crates/shirabe/src/repository/vcs/github_driver.rs
+++ b/crates/shirabe/src/repository/vcs/github_driver.rs
@@ -24,24 +24,24 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct GitHubDriver {
- pub(crate) inner: VcsDriverBase,
- pub(crate) owner: String,
- pub(crate) repository: String,
+ inner: VcsDriverBase,
+ owner: String,
+ repository: String,
/// @var array<int|string, string> Map of tag name to identifier
- pub(crate) tags: Option<IndexMap<String, String>>,
+ tags: Option<IndexMap<String, String>>,
/// @var array<int|string, string> Map of branch name to identifier
- pub(crate) branches: Option<IndexMap<String, String>>,
- pub(crate) root_identifier: String,
+ branches: Option<IndexMap<String, String>>,
+ root_identifier: String,
/// @var mixed[]
- pub(crate) repo_data: Option<IndexMap<String, PhpMixed>>,
- pub(crate) has_issues: bool,
- pub(crate) is_private: bool,
+ repo_data: Option<IndexMap<String, PhpMixed>>,
+ has_issues: bool,
+ is_private: bool,
is_archived: bool,
/// @var array<int, array{type: string, url: string}>|false|null
funding_info: Option<PhpMixed>,
allow_git_fallback: bool,
/// Git Driver
- pub(crate) git_driver: Option<GitDriver>,
+ git_driver: Option<GitDriver>,
}
impl GitHubDriver {
@@ -194,7 +194,7 @@ impl GitHubDriver {
)
}
- pub(crate) fn get_api_url(&self) -> String {
+ fn get_api_url(&self) -> String {
let api_url = if self.inner.origin_url == "github.com" {
"api.github.com".to_string()
} else {
@@ -995,7 +995,7 @@ impl GitHubDriver {
}
/// Generate an SSH URL
- pub(crate) fn generate_ssh_url(&self) -> String {
+ fn generate_ssh_url(&self) -> String {
if strpos(&self.inner.origin_url, ":").is_some() {
return format!(
"ssh://git@{}/{}/{}.git",
@@ -1009,7 +1009,7 @@ impl GitHubDriver {
)
}
- pub(crate) fn get_contents(
+ fn get_contents(
&mut self,
url: &str,
fetching_repo_data: bool,
@@ -1154,7 +1154,7 @@ impl GitHubDriver {
/// Fetch root identifier from GitHub
///
/// @throws TransportException
- pub(crate) fn fetch_root_identifier(&mut self) -> anyhow::Result<()> {
+ fn fetch_root_identifier(&mut self) -> anyhow::Result<()> {
if self.repo_data.is_some() {
return Ok(());
}
@@ -1225,7 +1225,7 @@ impl GitHubDriver {
/// @phpstan-impure
///
/// @throws \RuntimeException
- pub(crate) fn attempt_clone_fallback(
+ fn attempt_clone_fallback(
&mut self,
e: Option<std::sync::Arc<anyhow::Error>>,
) -> anyhow::Result<bool> {
@@ -1263,7 +1263,7 @@ impl GitHubDriver {
}
}
- pub(crate) fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> {
+ fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> {
if !self.allow_git_fallback {
return Err(
RuntimeException::new("Fallback to git driver disabled".to_string()).into(),
@@ -1283,7 +1283,7 @@ impl GitHubDriver {
Ok(())
}
- pub(crate) fn get_next_page(&self, response: &Response) -> Option<String> {
+ fn get_next_page(&self, response: &Response) -> Option<String> {
let header = response.get_header("link")?;
if header.is_empty() {
return None;
diff --git a/crates/shirabe/src/repository/vcs/gitlab_driver.rs b/crates/shirabe/src/repository/vcs/gitlab_driver.rs
index 669f1376..df1ad686 100644
--- a/crates/shirabe/src/repository/vcs/gitlab_driver.rs
+++ b/crates/shirabe/src/repository/vcs/gitlab_driver.rs
@@ -26,7 +26,7 @@ use shirabe_php_shim::{
/// Driver for GitLab API, use the Git driver for local checkouts.
#[derive(Debug)]
pub struct GitLabDriver {
- pub(crate) inner: VcsDriverBase,
+ inner: VcsDriverBase,
/// @phpstan-var 'https'|'http'
scheme: String,
namespace: String,
@@ -40,10 +40,10 @@ pub struct GitLabDriver {
/// @var array<int|string, string> Map of branch name to identifier
branches: Option<IndexMap<String, String>>,
/// Git Driver
- pub(crate) git_driver: Option<GitDriver>,
+ git_driver: Option<GitDriver>,
/// Protocol to force use of for repository URLs.
/// @var string One of ssh, http
- pub(crate) protocol: String,
+ protocol: String,
/// Defaults to true unless we can make sure it is public
/// @var bool defines whether the repo is private or not
is_private: bool,
@@ -595,10 +595,7 @@ impl GitLabDriver {
}
/// @return string[] where keys are named references like tags or branches and the value a sha
- pub(crate) fn get_references(
- &mut self,
- r#type: &str,
- ) -> anyhow::Result<IndexMap<String, String>> {
+ fn get_references(&mut self, r#type: &str) -> anyhow::Result<IndexMap<String, String>> {
let per_page = 100;
let mut resource: Option<String> = Some(format!(
"{}/repository/{}?per_page={}",
@@ -661,7 +658,7 @@ impl GitLabDriver {
Ok(references)
}
- pub(crate) fn fetch_project(&mut self) -> anyhow::Result<()> {
+ fn fetch_project(&mut self) -> anyhow::Result<()> {
if self.project.is_some() {
return Ok(());
}
@@ -694,7 +691,7 @@ impl GitLabDriver {
/// @phpstan-impure
///
/// @throws \RuntimeException
- pub(crate) fn attempt_clone_fallback(&mut self) -> anyhow::Result<bool> {
+ fn attempt_clone_fallback(&mut self) -> anyhow::Result<bool> {
let url = if !self.is_private {
self.generate_public_url()
} else {
@@ -723,7 +720,7 @@ impl GitLabDriver {
}
/// Generate an SSH URL
- pub(crate) fn generate_ssh_url(&self) -> String {
+ fn generate_ssh_url(&self) -> String {
if self.has_nonstandard_origin {
return format!(
"ssh://git@{}/{}/{}.git",
@@ -737,14 +734,14 @@ impl GitLabDriver {
)
}
- pub(crate) fn generate_public_url(&self) -> String {
+ fn generate_public_url(&self) -> String {
format!(
"{}://{}/{}/{}.git",
self.scheme, self.inner.origin_url, self.namespace, self.repository
)
}
- pub(crate) fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> {
+ fn setup_git_driver(&mut self, url: &str) -> anyhow::Result<()> {
let mut repo_config: IndexMap<String, PhpMixed> = IndexMap::new();
repo_config.insert("url".to_string(), PhpMixed::String(url.to_string()));
let mut git_driver = GitDriver::new(
@@ -759,7 +756,7 @@ impl GitLabDriver {
Ok(())
}
- pub(crate) fn get_contents(
+ fn get_contents(
&mut self,
url: &str,
fetching_repo_data: bool,
@@ -1009,7 +1006,7 @@ impl GitLabDriver {
Ok(self.project.clone())
}
- pub(crate) fn get_next_page(&self, response: &Response) -> Option<String> {
+ fn get_next_page(&self, response: &Response) -> Option<String> {
let header = response.get_header("link").unwrap_or_default();
let links = explode(",", &header);
diff --git a/crates/shirabe/src/repository/vcs/hg_driver.rs b/crates/shirabe/src/repository/vcs/hg_driver.rs
index 56efd514..f4e02685 100644
--- a/crates/shirabe/src/repository/vcs/hg_driver.rs
+++ b/crates/shirabe/src/repository/vcs/hg_driver.rs
@@ -17,11 +17,11 @@ use shirabe_php_shim::{PhpMixed, RuntimeException, dirname, is_dir, is_writable,
#[derive(Debug)]
pub struct HgDriver {
- pub(crate) inner: VcsDriverBase,
- pub(crate) tags: Option<IndexMap<String, String>>,
- pub(crate) branches: Option<IndexMap<String, String>>,
- pub(crate) root_identifier: Option<String>,
- pub(crate) repo_dir: String,
+ inner: VcsDriverBase,
+ tags: Option<IndexMap<String, String>>,
+ branches: Option<IndexMap<String, String>>,
+ root_identifier: Option<String>,
+ repo_dir: String,
}
impl HgDriver {
diff --git a/crates/shirabe/src/repository/vcs/perforce_driver.rs b/crates/shirabe/src/repository/vcs/perforce_driver.rs
index 7425c7d4..ce9ffb49 100644
--- a/crates/shirabe/src/repository/vcs/perforce_driver.rs
+++ b/crates/shirabe/src/repository/vcs/perforce_driver.rs
@@ -15,9 +15,9 @@ use shirabe_php_shim::{BadMethodCallException, PhpMixed, RuntimeException, php_r
#[derive(Debug)]
pub struct PerforceDriver {
inner: VcsDriverBase,
- pub(crate) depot: String,
- pub(crate) branch: String,
- pub(crate) perforce: Option<Box<dyn PerforceInterface>>,
+ depot: String,
+ branch: String,
+ perforce: Option<Box<dyn PerforceInterface>>,
}
impl PerforceDriver {
diff --git a/crates/shirabe/src/repository/vcs/svn_driver.rs b/crates/shirabe/src/repository/vcs/svn_driver.rs
index 6d767af5..dd74400d 100644
--- a/crates/shirabe/src/repository/vcs/svn_driver.rs
+++ b/crates/shirabe/src/repository/vcs/svn_driver.rs
@@ -21,25 +21,25 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct SvnDriver {
- pub(crate) inner: VcsDriverBase,
+ inner: VcsDriverBase,
/// @var string
- pub(crate) base_url: String,
+ base_url: String,
/// @var array<int|string, string> Map of tag name to identifier
- pub(crate) tags: Option<IndexMap<String, String>>,
+ tags: Option<IndexMap<String, String>>,
/// @var array<int|string, string> Map of branch name to identifier
- pub(crate) branches: Option<IndexMap<String, String>>,
+ branches: Option<IndexMap<String, String>>,
/// @var ?string
- pub(crate) root_identifier: Option<String>,
+ root_identifier: Option<String>,
- pub(crate) trunk_path: Option<String>,
+ trunk_path: Option<String>,
/// @var string
- pub(crate) branches_path: String,
+ branches_path: String,
/// @var string
- pub(crate) tags_path: String,
+ tags_path: String,
/// @var string
- pub(crate) package_path: String,
+ package_path: String,
/// @var bool
- pub(crate) cache_credentials: bool,
+ cache_credentials: bool,
/// @var SvnUtil
util: Option<SvnUtil>,
@@ -152,7 +152,7 @@ impl SvnDriver {
None
}
- pub(crate) fn should_cache(&self, identifier: &str) -> bool {
+ fn should_cache(&self, identifier: &str) -> bool {
self.inner.cache.is_some() && Preg::is_match(php_regex!(r"{@\d+$}"), identifier)
}
@@ -530,7 +530,7 @@ impl SvnDriver {
}
/// An absolute path (leading '/') is converted to a file:// url.
- pub(crate) fn normalize_url(url: &str) -> String {
+ fn normalize_url(url: &str) -> String {
let fs = Filesystem::new(None);
if fs.is_absolute_path(url) {
return format!("file://{}", strtr(url, "\\", "/"));
@@ -545,7 +545,7 @@ impl SvnDriver {
/// @param non-empty-list<string> $command The svn command to run.
/// @param string $url The SVN URL.
/// @throws \RuntimeException
- pub(crate) fn execute(&mut self, command: Vec<String>, url: &str) -> anyhow::Result<String> {
+ fn execute(&mut self, command: Vec<String>, url: &str) -> anyhow::Result<String> {
if self.util.is_none() {
self.util = Some(SvnUtil::new(
self.base_url.clone(),
@@ -589,7 +589,7 @@ impl SvnDriver {
///
/// @param string $baseDir The path to trunk/branch/tag
/// @param int $revision The revision mark to add to identifier
- pub(crate) fn build_identifier(&self, base_dir: &str, revision: i64) -> String {
+ fn build_identifier(&self, base_dir: &str, revision: i64) -> String {
format!(
"{}{}/@{}",
base_dir.trim_end_matches('/'),
diff --git a/crates/shirabe/src/repository/vcs_repository.rs b/crates/shirabe/src/repository/vcs_repository.rs
index 4da3f0ad..4066ac44 100644
--- a/crates/shirabe/src/repository/vcs_repository.rs
+++ b/crates/shirabe/src/repository/vcs_repository.rs
@@ -37,36 +37,36 @@ use shirabe_semver::constraint::SimpleConstraint;
// TODO(port): the driver registration should be refactored later.
#[derive(Debug)]
pub struct VcsRepository {
- pub(crate) inner: ArrayRepository,
+ inner: ArrayRepository,
/// @var string
- pub(crate) url: String,
+ url: String,
/// @var ?string
///
/// Interior mutability: set lazily by the (now `&self`) `initialize`, mirroring how PHP's
/// inherited ArrayRepository methods drive the overridden `initialize()` on first access.
- pub(crate) package_name: std::cell::RefCell<Option<String>>,
+ package_name: std::cell::RefCell<Option<String>>,
/// @var bool
- pub(crate) is_verbose: bool,
+ is_verbose: bool,
/// @var bool
- pub(crate) is_very_verbose: bool,
+ is_very_verbose: bool,
/// @var IOInterface
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
/// @var Config
- pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
/// @var VersionParser
- pub(crate) version_parser: std::cell::RefCell<Option<VersionParser>>,
+ version_parser: std::cell::RefCell<Option<VersionParser>>,
/// @var string
- pub(crate) r#type: String,
+ r#type: String,
/// @var ?LoaderInterface
- pub(crate) loader: std::cell::RefCell<Option<Box<dyn LoaderInterface>>>,
+ loader: std::cell::RefCell<Option<Box<dyn LoaderInterface>>>,
/// @var array<string, mixed>
- pub(crate) repo_config: IndexMap<String, PhpMixed>,
+ repo_config: IndexMap<String, PhpMixed>,
/// @var HttpDownloader
- pub(crate) http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>,
+ http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>,
/// @var ProcessExecutor
- pub(crate) process_executor: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
+ process_executor: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
/// @var bool
- pub(crate) branch_error_occurred: std::cell::Cell<bool>,
+ branch_error_occurred: std::cell::Cell<bool>,
/// @var array<string, class-string<VcsDriverInterface>>
drivers: IndexMap<String, VcsDriverKind>,
/// @var ?VcsDriverInterface
diff --git a/crates/shirabe/src/util/auth_helper.rs b/crates/shirabe/src/util/auth_helper.rs
index ac7caa35..2c2ee725 100644
--- a/crates/shirabe/src/util/auth_helper.rs
+++ b/crates/shirabe/src/util/auth_helper.rs
@@ -18,8 +18,8 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct AuthHelper {
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
/// @var array<string, string> Map of origins to message displayed
displayed_origin_authentications: IndexMap<String, String>,
/// @var array<string, bool> Map of URLs and whether they already retried with authentication from Bitbucket
diff --git a/crates/shirabe/src/util/filesystem.rs b/crates/shirabe/src/util/filesystem.rs
index 066b1981..532c96dd 100644
--- a/crates/shirabe/src/util/filesystem.rs
+++ b/crates/shirabe/src/util/filesystem.rs
@@ -848,7 +848,7 @@ impl Filesystem {
false
}
- pub(crate) fn directory_size(&self, directory: &Path) -> anyhow::Result<i64> {
+ fn directory_size(&self, directory: &Path) -> anyhow::Result<i64> {
let it =
shirabe_php_shim::recursive_directory_iterator(directory, shirabe_php_shim::SKIP_DOTS)?;
let ri = shirabe_php_shim::recursive_iterator_iterator(it, shirabe_php_shim::CHILD_FIRST);
@@ -863,7 +863,7 @@ impl Filesystem {
Ok(size)
}
- pub(crate) fn get_process(&mut self) -> std::cell::RefMut<'_, ProcessExecutor> {
+ fn get_process(&mut self) -> std::cell::RefMut<'_, ProcessExecutor> {
self.get_process_handle();
self.process_executor.as_ref().unwrap().borrow_mut()
@@ -871,9 +871,7 @@ impl Filesystem {
/// Hands out the executor handle itself so async callers can hold only a shared borrow
/// across their awaits (a RefMut held across an await panics once calls overlap).
- pub(crate) fn get_process_handle(
- &mut self,
- ) -> std::rc::Rc<std::cell::RefCell<ProcessExecutor>> {
+ fn get_process_handle(&mut self) -> std::rc::Rc<std::cell::RefCell<ProcessExecutor>> {
if self.process_executor.is_none() {
self.process_executor = Some(std::rc::Rc::new(std::cell::RefCell::new(
ProcessExecutor::new(None),
diff --git a/crates/shirabe/src/util/git.rs b/crates/shirabe/src/util/git.rs
index 26ea1898..f8fea562 100644
--- a/crates/shirabe/src/util/git.rs
+++ b/crates/shirabe/src/util/git.rs
@@ -25,11 +25,11 @@ use std::sync::Mutex;
#[derive(Debug)]
pub struct Git {
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
- pub(crate) process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
- pub(crate) filesystem: std::rc::Rc<std::cell::RefCell<Filesystem>>,
- pub(crate) http_downloader: Option<std::rc::Rc<std::cell::RefCell<HttpDownloader>>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
+ process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
+ filesystem: std::rc::Rc<std::cell::RefCell<Filesystem>>,
+ http_downloader: Option<std::rc::Rc<std::cell::RefCell<HttpDownloader>>>,
}
/// @var string|false|null
diff --git a/crates/shirabe/src/util/gitlab.rs b/crates/shirabe/src/util/gitlab.rs
index 3d1fb2be..ef68c82f 100644
--- a/crates/shirabe/src/util/gitlab.rs
+++ b/crates/shirabe/src/util/gitlab.rs
@@ -17,10 +17,10 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct GitLab {
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
- pub(crate) process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
- pub(crate) http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
+ process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
+ http_downloader: std::rc::Rc<std::cell::RefCell<HttpDownloader>>,
}
impl GitLab {
diff --git a/crates/shirabe/src/util/no_proxy_pattern.rs b/crates/shirabe/src/util/no_proxy_pattern.rs
index 7d4d7b84..6d19637a 100644
--- a/crates/shirabe/src/util/no_proxy_pattern.rs
+++ b/crates/shirabe/src/util/no_proxy_pattern.rs
@@ -12,11 +12,11 @@ use shirabe_php_shim::{
#[derive(Debug)]
pub struct NoProxyPattern {
/// @var string[]
- pub(crate) host_names: Vec<String>,
+ host_names: Vec<String>,
/// @var (null|object)[]
- pub(crate) rules: IndexMap<i64, Option<UrlData>>,
+ rules: IndexMap<i64, Option<UrlData>>,
/// @var bool
- pub(crate) noproxy: bool,
+ noproxy: bool,
}
#[derive(Debug, Clone)]
@@ -69,7 +69,7 @@ impl NoProxyPattern {
}
/// Returns false is the url cannot be parsed, otherwise a data object
- pub(crate) fn get_url_data(&self, url: &str) -> anyhow::Result<Option<UrlData>> {
+ fn get_url_data(&self, url: &str) -> anyhow::Result<Option<UrlData>> {
let host = parse_url(url, PHP_URL_HOST);
if empty(&host) {
return Ok(None);
@@ -107,12 +107,7 @@ impl NoProxyPattern {
}
/// Returns true if the url is matched by a rule
- pub(crate) fn r#match(
- &mut self,
- index: i64,
- host_name: &str,
- url: &UrlData,
- ) -> anyhow::Result<bool> {
+ fn r#match(&mut self, index: i64, host_name: &str, url: &UrlData) -> anyhow::Result<bool> {
let rule = match self.get_rule(index, host_name)? {
Some(r) => r,
None => {
@@ -148,7 +143,7 @@ impl NoProxyPattern {
}
/// Returns true if the target ip is in the network range
- pub(crate) fn match_range(&self, network: &IpData, target: &IpData) -> anyhow::Result<bool> {
+ fn match_range(&self, network: &IpData, target: &IpData) -> anyhow::Result<bool> {
let net = network.ip.as_slice();
let mask = network.netmask.as_deref().unwrap_or_default();
let ip = target.ip.as_slice();
diff --git a/crates/shirabe/src/util/perforce.rs b/crates/shirabe/src/util/perforce.rs
index 246e37f5..fbab6889 100644
--- a/crates/shirabe/src/util/perforce.rs
+++ b/crates/shirabe/src/util/perforce.rs
@@ -18,22 +18,22 @@ use shirabe_symfony_process::Process;
/// @phpstan-type RepoConfig array{unique_perforce_client_name?: string, depot?: string, branch?: string, p4user?: string, p4password?: string}
#[derive(Debug)]
pub struct Perforce {
- pub(crate) path: String,
- pub(crate) p4_depot: Option<String>,
- pub(crate) p4_client: Option<String>,
- pub(crate) p4_user: Option<String>,
- pub(crate) p4_password: Option<String>,
- pub(crate) p4_port: String,
- pub(crate) p4_stream: Option<String>,
- pub(crate) p4_client_spec: String,
- pub(crate) p4_depot_type: Option<String>,
- pub(crate) p4_branch: Option<String>,
- pub(crate) process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
- pub(crate) unique_perforce_client_name: String,
- pub(crate) windows_flag: bool,
- pub(crate) command_result: String,
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
- pub(crate) filesystem: Option<std::rc::Rc<std::cell::RefCell<Filesystem>>>,
+ path: String,
+ p4_depot: Option<String>,
+ p4_client: Option<String>,
+ p4_user: Option<String>,
+ p4_password: Option<String>,
+ p4_port: String,
+ p4_stream: Option<String>,
+ p4_client_spec: String,
+ p4_depot_type: Option<String>,
+ p4_branch: Option<String>,
+ process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
+ unique_perforce_client_name: String,
+ windows_flag: bool,
+ command_result: String,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ filesystem: Option<std::rc::Rc<std::cell::RefCell<Filesystem>>>,
}
impl Perforce {
@@ -147,7 +147,7 @@ impl Perforce {
file_system.borrow_mut().remove(&client_spec);
}
- pub(crate) fn execute_command(&mut self, command: PhpMixed) -> i64 {
+ fn execute_command(&mut self, command: PhpMixed) -> i64 {
self.command_result = String::new();
let cmd_vec: Vec<String> = match &command {
@@ -180,7 +180,7 @@ impl Perforce {
self.p4_client.clone().unwrap_or_default()
}
- pub(crate) fn get_path(&self) -> &str {
+ fn get_path(&self) -> &str {
&self.path
}
@@ -190,7 +190,7 @@ impl Perforce {
fs.borrow_mut().ensure_directory_exists(path);
}
- pub(crate) fn get_port(&self) -> &str {
+ fn get_port(&self) -> &str {
&self.p4_port
}
@@ -278,7 +278,7 @@ impl Perforce {
Ok(())
}
- pub(crate) fn get_p4_variable(&mut self, name: &str) -> Option<String> {
+ fn get_p4_variable(&mut self, name: &str) -> Option<String> {
if self.windows_flag {
let command = format!("{} set", Self::get_p4_executable());
self.execute_command(PhpMixed::String(command));
@@ -507,7 +507,7 @@ impl Perforce {
Ok(())
}
- pub(crate) fn read(&self, pipe: &PhpResource, _name: PhpMixed) {
+ fn read(&self, pipe: &PhpResource, _name: PhpMixed) {
if feof(pipe) {
return;
}
@@ -743,7 +743,7 @@ impl Perforce {
false
}
- pub(crate) fn get_change_list(&mut self, reference: &str) -> Option<String> {
+ fn get_change_list(&mut self, reference: &str) -> Option<String> {
let index = strpos(reference, "@")?;
let label = substr(reference, index as i64, None);
let command =
diff --git a/crates/shirabe/src/util/process_executor.rs b/crates/shirabe/src/util/process_executor.rs
index 3f300317..00091029 100644
--- a/crates/shirabe/src/util/process_executor.rs
+++ b/crates/shirabe/src/util/process_executor.rs
@@ -30,11 +30,11 @@ static TIMEOUT: LazyLock<Mutex<i64>> = LazyLock::new(|| Mutex::new(300));
#[derive(Debug)]
pub struct ProcessExecutor {
/// @var bool
- pub(crate) capture_output: bool,
+ capture_output: bool,
/// @var string
- pub(crate) error_output: String,
+ error_output: String,
/// @var ?IOInterface
- pub(crate) io: Option<std::rc::Rc<std::cell::RefCell<dyn IOInterface>>>,
+ io: Option<std::rc::Rc<std::cell::RefCell<dyn IOInterface>>>,
/// @var int
max_jobs: i64,
/// PHP throttles async jobs through the $jobs queue and $maxJobs; here concurrent
diff --git a/crates/shirabe/src/util/svn.rs b/crates/shirabe/src/util/svn.rs
index 395f176f..bde2583d 100644
--- a/crates/shirabe/src/util/svn.rs
+++ b/crates/shirabe/src/util/svn.rs
@@ -23,21 +23,21 @@ pub struct SvnCredentials {
#[derive(Debug)]
pub struct Svn {
/// @var ?array{username: string, password: string}
- pub(crate) credentials: Option<SvnCredentials>,
+ credentials: Option<SvnCredentials>,
/// @var bool
- pub(crate) has_auth: Option<bool>,
+ has_auth: Option<bool>,
/// @var IOInterface
- pub(crate) io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ io: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
/// @var string
- pub(crate) url: String,
+ url: String,
/// @var bool
- pub(crate) cache_credentials: bool,
+ cache_credentials: bool,
/// @var ProcessExecutor
- pub(crate) process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
+ process: std::rc::Rc<std::cell::RefCell<ProcessExecutor>>,
/// @var int
- pub(crate) qty_auth_tries: i64,
+ qty_auth_tries: i64,
/// @var Config
- pub(crate) config: std::rc::Rc<std::cell::RefCell<Config>>,
+ config: std::rc::Rc<std::cell::RefCell<Config>>,
}
/// @var string|null
@@ -202,7 +202,7 @@ impl Svn {
/// Repositories requests credentials, let's put them in.
///
/// @throws \RuntimeException
- pub(crate) fn do_auth_dance(&mut self) -> anyhow::Result<&mut Self> {
+ fn do_auth_dance(&mut self) -> anyhow::Result<&mut Self> {
// cannot ask for credentials in non interactive mode
if !self.io.is_interactive() {
return Err(RuntimeException::new(
@@ -247,12 +247,7 @@ impl Svn {
/// @param non-empty-list<string> $cmd Usually 'svn ls' or something like that.
/// @param string $url Repo URL.
/// @param string $path Target for a checkout
- pub(crate) fn get_command(
- &mut self,
- mut cmd: Vec<String>,
- url: &str,
- path: Option<&str>,
- ) -> Vec<String> {
+ fn get_command(&mut self, mut cmd: Vec<String>, url: &str, path: Option<&str>) -> Vec<String> {
cmd.push("--non-interactive".to_string());
cmd.extend(self.get_credential_args());
cmd.push("--".to_string());
@@ -268,7 +263,7 @@ impl Svn {
/// Return the credential string for the svn command.
///
/// Adds --no-auth-cache when credentials are present.
- pub(crate) fn get_credential_args(&mut self) -> Vec<String> {
+ fn get_credential_args(&mut self) -> Vec<String> {
if !self.has_auth() {
return vec![];
}
@@ -299,7 +294,7 @@ impl Svn {
/// Get the password for the svn command. Can be empty.
///
/// @throws \LogicException
- pub(crate) fn get_password(&self) -> anyhow::Result<String> {
+ fn get_password(&self) -> anyhow::Result<String> {
if self.credentials.is_none() {
return Err(LogicException::new("No svn auth detected.".to_string()).into());
}
@@ -310,7 +305,7 @@ impl Svn {
/// Get the username for the svn command.
///
/// @throws \LogicException
- pub(crate) fn get_username(&self) -> anyhow::Result<String> {
+ fn get_username(&self) -> anyhow::Result<String> {
if self.credentials.is_none() {
return Err(LogicException::new("No svn auth detected.".to_string()).into());
}
@@ -319,7 +314,7 @@ impl Svn {
}
/// Detect Svn Auth.
- pub(crate) fn has_auth(&mut self) -> bool {
+ fn has_auth(&mut self) -> bool {
if let Some(has_auth) = self.has_auth {
return has_auth;
}
@@ -332,7 +327,7 @@ impl Svn {
}
/// Return the no-auth-cache switch.
- pub(crate) fn get_auth_cache_args(&self) -> Vec<String> {
+ fn get_auth_cache_args(&self) -> Vec<String> {
if self.cache_credentials {
vec![]
} else {
diff --git a/crates/shirabe/tests/plugin/plugin_installer_test.rs b/crates/shirabe/tests/plugin/plugin_installer_test.rs
index 2a065cc5..346bf5c6 100644
--- a/crates/shirabe/tests/plugin/plugin_installer_test.rs
+++ b/crates/shirabe/tests/plugin/plugin_installer_test.rs
@@ -76,7 +76,7 @@ fn fixtures_dir() -> String {
}
/// Shirabe-owned fixtures with no upstream counterpart (see `subscriber_test.rs`).
-pub(crate) fn shirabe_fixtures_dir() -> String {
+fn shirabe_fixtures_dir() -> String {
let dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/plugin/fixtures");
dir.canonicalize()
.expect("the Shirabe plugin fixtures directory must exist")
@@ -248,7 +248,7 @@ fn locker_installation_manager(
#[derive(Debug)]
pub(crate) struct SetUp {
pub(crate) io: std::rc::Rc<std::cell::RefCell<BufferIO>>,
- pub(crate) io_dyn: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
+ io_dyn: std::rc::Rc<std::cell::RefCell<dyn IOInterface>>,
pub(crate) pm: std::rc::Rc<std::cell::RefCell<PluginManager>>,
autoload_generator: std::rc::Rc<std::cell::RefCell<AutoloadGenerator>>,
packages: Vec<PackageInterfaceHandle>,