diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:25:52 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:25:52 +0900 |
| commit | 7f606f36fef0c0467c3c0db3d0da33af486dae8a (patch) | |
| tree | c3f0a3340e1dbfc5245964a775b73030d5abf44e | |
| parent | 9389ddbf06f6d38445c277640cab7b2270057790 (diff) | |
| download | php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.tar.gz php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.tar.zst php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.zip | |
feat(port): add stub implementations of shirabe-external-packages
128 files changed, 2226 insertions, 0 deletions
@@ -8,6 +8,7 @@ edition = "2024" [workspace.dependencies] shirabe = { path = "crates/shirabe" } +shirabe-external-packages = { path = "crates/shirabe-external-packages" } shirabe-php-shim = { path = "crates/shirabe-php-shim" } shirabe-semver = { path = "crates/shirabe-semver" } anyhow = "1.0.102" diff --git a/crates/shirabe-class-map-generator/Cargo.toml b/crates/shirabe-class-map-generator/Cargo.toml index 514d03e..1780060 100644 --- a/crates/shirabe-class-map-generator/Cargo.toml +++ b/crates/shirabe-class-map-generator/Cargo.toml @@ -4,6 +4,7 @@ version.workspace = true edition.workspace = true [dependencies] +shirabe-external-packages.workspace = true shirabe-php-shim.workspace = true anyhow.workspace = true indexmap.workspace = true diff --git a/crates/shirabe-external-packages/Cargo.toml b/crates/shirabe-external-packages/Cargo.toml new file mode 100644 index 0000000..2c32ed3 --- /dev/null +++ b/crates/shirabe-external-packages/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "shirabe-external-packages" +version.workspace = true +edition.workspace = true + +[dependencies] +anyhow.workspace = true +indexmap.workspace = true +shirabe-php-shim = { path = "../shirabe-php-shim" } diff --git a/crates/shirabe-external-packages/src/composer/ca_bundle/ca_bundle.rs b/crates/shirabe-external-packages/src/composer/ca_bundle/ca_bundle.rs new file mode 100644 index 0000000..4a980c6 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/ca_bundle/ca_bundle.rs @@ -0,0 +1,22 @@ +use crate::psr::log::logger_interface::LoggerInterface; + +#[derive(Debug)] +pub struct CaBundle; + +impl CaBundle { + pub fn is_openssl_parse_safe() -> bool { + todo!() + } + + pub fn get_system_ca_root_bundle_path(logger: Option<&dyn LoggerInterface>) -> String { + todo!() + } + + pub fn validate_ca_file(ca_file: &str, logger: Option<&dyn LoggerInterface>) -> bool { + todo!() + } + + pub fn get_bundled_ca_bundle_path() -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/ca_bundle/mod.rs b/crates/shirabe-external-packages/src/composer/ca_bundle/mod.rs new file mode 100644 index 0000000..537fe0d --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/ca_bundle/mod.rs @@ -0,0 +1 @@ +pub mod ca_bundle; diff --git a/crates/shirabe-external-packages/src/composer/metadata_minifier/metadata_minifier.rs b/crates/shirabe-external-packages/src/composer/metadata_minifier/metadata_minifier.rs new file mode 100644 index 0000000..f886197 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/metadata_minifier/metadata_minifier.rs @@ -0,0 +1,15 @@ +use indexmap::IndexMap; +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct MetadataMinifier; + +impl MetadataMinifier { + pub fn expand(minified_data: IndexMap<String, PhpMixed>) -> IndexMap<String, PhpMixed> { + todo!() + } + + pub fn minify(packages: IndexMap<String, PhpMixed>) -> IndexMap<String, PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/metadata_minifier/mod.rs b/crates/shirabe-external-packages/src/composer/metadata_minifier/mod.rs new file mode 100644 index 0000000..fb69bd5 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/metadata_minifier/mod.rs @@ -0,0 +1 @@ +pub mod metadata_minifier; diff --git a/crates/shirabe-external-packages/src/composer/mod.rs b/crates/shirabe-external-packages/src/composer/mod.rs new file mode 100644 index 0000000..61e5544 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/mod.rs @@ -0,0 +1,7 @@ +pub mod ca_bundle; +pub mod metadata_minifier; +pub mod pcre; +pub mod semver; +pub mod spdx_licenses; +pub mod util; +pub mod xdebug_handler; diff --git a/crates/shirabe-external-packages/src/composer/pcre/mod.rs b/crates/shirabe-external-packages/src/composer/pcre/mod.rs new file mode 100644 index 0000000..5cc1656 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/pcre/mod.rs @@ -0,0 +1 @@ +pub mod preg; diff --git a/crates/shirabe-external-packages/src/composer/pcre/preg.rs b/crates/shirabe-external-packages/src/composer/pcre/preg.rs new file mode 100644 index 0000000..1b2d675 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/pcre/preg.rs @@ -0,0 +1,88 @@ +use indexmap::IndexMap; + +#[derive(Debug)] +pub struct Preg; + +impl Preg { + pub fn is_match(pattern: &str, subject: &str) -> anyhow::Result<bool> { + todo!() + } + + pub fn replace(pattern: &str, replacement: &str, subject: &str) -> anyhow::Result<String> { + todo!() + } + + pub fn replace_callback<F>(pattern: &str, callback: F, subject: &str) -> anyhow::Result<String> + where + F: Fn(&IndexMap<String, String>) -> String, + { + todo!() + } + + pub fn replace_with_count( + pattern: &str, + replacement: &str, + subject: &str, + count: &mut i64, + ) -> anyhow::Result<String> { + todo!() + } + + pub fn split(pattern: &str, subject: &str) -> anyhow::Result<Vec<String>> { + todo!() + } + + pub fn grep(pattern: &str, input: Vec<String>) -> anyhow::Result<Vec<String>> { + todo!() + } + + /// Returns captures as a flat Vec indexed by group number (index 0 = full match). + pub fn is_match_strict_groups( + pattern: &str, + subject: &str, + ) -> Option<Vec<String>> { + todo!() + } + + /// Returns named captures in an IndexMap. + pub fn is_match_named( + pattern: &str, + subject: &str, + matches: &mut IndexMap<String, String>, + ) -> anyhow::Result<bool> { + todo!() + } + + /// Returns all matches; outer Vec indexed by group number, inner Vec by match occurrence. + pub fn is_match_all_strict_groups( + pattern: &str, + subject: &str, + ) -> Option<Vec<Vec<String>>> { + todo!() + } + + /// Returns captures with byte offsets: IndexMap<group_name, Vec<(match_str, offset)>>. + pub fn is_match_all_with_offsets( + pattern: &str, + subject: &str, + matches: &mut IndexMap<String, Vec<(String, i64)>>, + ) -> anyhow::Result<bool> { + todo!() + } + + /// Returns indexed captures as Vec (index 0 = full match) when pattern matches. + pub fn is_match_with_indexed_captures( + pattern: &str, + subject: &str, + ) -> anyhow::Result<Option<Vec<String>>> { + todo!() + } + + /// Like is_match_strict_groups but returns named captures as IndexMap. + pub fn match_strict_groups( + pattern: &str, + subject: &str, + ) -> Option<IndexMap<String, String>> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/semver/compiling_matcher.rs b/crates/shirabe-external-packages/src/composer/semver/compiling_matcher.rs new file mode 100644 index 0000000..dea5475 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/semver/compiling_matcher.rs @@ -0,0 +1,22 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct CompilingMatcher; + +impl CompilingMatcher { + pub fn r#match(constraint: &dyn std::any::Any, package: &dyn std::any::Any) -> bool { + todo!() + } + + pub fn matches(constraint: &dyn std::any::Any, operator: &str, version: &str) -> bool { + todo!() + } + + pub fn match_(constraint: &dyn std::any::Any, operator: &str, version: &str) -> bool { + todo!() + } + + pub fn clear() { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/semver/intervals.rs b/crates/shirabe-external-packages/src/composer/semver/intervals.rs new file mode 100644 index 0000000..957436d --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/semver/intervals.rs @@ -0,0 +1,29 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct Intervals; + +impl Intervals { + pub fn is_subset_of( + constraint_a: &dyn std::any::Any, + constraint_b: &dyn std::any::Any, + ) -> anyhow::Result<bool> { + todo!() + } + + pub fn compact_constraint(constraint: &dyn std::any::Any) -> Box<dyn std::any::Any> { + todo!() + } + + pub fn compact(constraint: &dyn std::any::Any) -> Box<dyn std::any::Any> { + todo!() + } + + pub fn get(constraint: &dyn std::any::Any) -> anyhow::Result<PhpMixed> { + todo!() + } + + pub fn clear() { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/semver/mod.rs b/crates/shirabe-external-packages/src/composer/semver/mod.rs new file mode 100644 index 0000000..800150d --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/semver/mod.rs @@ -0,0 +1,3 @@ +pub mod compiling_matcher; +pub mod intervals; +pub mod semver; diff --git a/crates/shirabe-external-packages/src/composer/semver/semver.rs b/crates/shirabe-external-packages/src/composer/semver/semver.rs new file mode 100644 index 0000000..f467c2c --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/semver/semver.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct Semver; + +impl Semver { + pub fn sort(versions: Vec<String>) -> anyhow::Result<Vec<String>> { + todo!() + } + + pub fn rsort(versions: Vec<String>) -> Vec<String> { + todo!() + } + + pub fn satisfies(version: &str, constraint: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/spdx_licenses/mod.rs b/crates/shirabe-external-packages/src/composer/spdx_licenses/mod.rs new file mode 100644 index 0000000..a4b5b0a --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/spdx_licenses/mod.rs @@ -0,0 +1 @@ +pub mod spdx_licenses; diff --git a/crates/shirabe-external-packages/src/composer/spdx_licenses/spdx_licenses.rs b/crates/shirabe-external-packages/src/composer/spdx_licenses/spdx_licenses.rs new file mode 100644 index 0000000..95640c9 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/spdx_licenses/spdx_licenses.rs @@ -0,0 +1,22 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct SpdxLicenses; + +impl SpdxLicenses { + pub fn new() -> Self { + todo!() + } + + pub fn validate(&self, license: &str) -> bool { + todo!() + } + + pub fn get_license_by_identifier(&self, identifier: &str) -> Option<PhpMixed> { + todo!() + } + + pub fn get_licenses(&self) -> PhpMixed { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/util/composer_mirror.rs b/crates/shirabe-external-packages/src/composer/util/composer_mirror.rs new file mode 100644 index 0000000..767ff36 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/util/composer_mirror.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct ComposerMirror; + +impl ComposerMirror { + pub fn process_url(mirror: &str, package_name: &str, version: &str, reference: Option<&str>, url: &str, custom_filename: Option<&str>) -> String { + todo!() + } + + pub fn process_git_url(mirror: &str, package_name: &str, url: &str, extension: &str) -> String { + todo!() + } + + pub fn process_hg_url(mirror: &str, package_name: &str, url: &str, extension: &str) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/composer/util/mod.rs b/crates/shirabe-external-packages/src/composer/util/mod.rs new file mode 100644 index 0000000..3048d03 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/util/mod.rs @@ -0,0 +1 @@ +pub mod composer_mirror; diff --git a/crates/shirabe-external-packages/src/composer/xdebug_handler/mod.rs b/crates/shirabe-external-packages/src/composer/xdebug_handler/mod.rs new file mode 100644 index 0000000..cd8b96e --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/xdebug_handler/mod.rs @@ -0,0 +1 @@ +pub mod xdebug_handler; diff --git a/crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs b/crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs new file mode 100644 index 0000000..d58b423 --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/xdebug_handler/xdebug_handler.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct XdebugHandler; + +impl XdebugHandler { + pub fn is_xdebug_active() -> bool { + todo!() + } + + pub fn get_skipped_version() -> Option<String> { + todo!() + } + + pub fn get_all_ini_files() -> Vec<String> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/json_schema/mod.rs b/crates/shirabe-external-packages/src/json_schema/mod.rs new file mode 100644 index 0000000..fa199f2 --- /dev/null +++ b/crates/shirabe-external-packages/src/json_schema/mod.rs @@ -0,0 +1 @@ +pub mod validator; diff --git a/crates/shirabe-external-packages/src/json_schema/validator.rs b/crates/shirabe-external-packages/src/json_schema/validator.rs new file mode 100644 index 0000000..aad230b --- /dev/null +++ b/crates/shirabe-external-packages/src/json_schema/validator.rs @@ -0,0 +1,22 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct Validator; + +impl Validator { + pub fn new() -> Self { + todo!() + } + + pub fn check(&mut self, data: &PhpMixed, schema: &PhpMixed) -> anyhow::Result<()> { + todo!() + } + + pub fn is_valid(&self) -> bool { + todo!() + } + + pub fn get_errors(&self) -> Vec<String> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/lib.rs b/crates/shirabe-external-packages/src/lib.rs new file mode 100644 index 0000000..2cedddb --- /dev/null +++ b/crates/shirabe-external-packages/src/lib.rs @@ -0,0 +1,6 @@ +pub mod composer; +pub mod json_schema; +pub mod psr; +pub mod react; +pub mod seld; +pub mod symfony; diff --git a/crates/shirabe-external-packages/src/psr/log/log_level.rs b/crates/shirabe-external-packages/src/psr/log/log_level.rs new file mode 100644 index 0000000..7232fa0 --- /dev/null +++ b/crates/shirabe-external-packages/src/psr/log/log_level.rs @@ -0,0 +1,13 @@ +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct LogLevel; + +impl LogLevel { + pub const EMERGENCY: &'static str = "emergency"; + pub const ALERT: &'static str = "alert"; + pub const CRITICAL: &'static str = "critical"; + pub const ERROR: &'static str = "error"; + pub const WARNING: &'static str = "warning"; + pub const NOTICE: &'static str = "notice"; + pub const INFO: &'static str = "info"; + pub const DEBUG: &'static str = "debug"; +} diff --git a/crates/shirabe-external-packages/src/psr/log/logger_interface.rs b/crates/shirabe-external-packages/src/psr/log/logger_interface.rs new file mode 100644 index 0000000..730bfe5 --- /dev/null +++ b/crates/shirabe-external-packages/src/psr/log/logger_interface.rs @@ -0,0 +1,13 @@ +use shirabe_php_shim::PhpMixed; + +pub trait LoggerInterface { + fn emergency(&self, message: &str, context: &[(&str, &str)]); + fn alert(&self, message: &str, context: &[(&str, &str)]); + fn critical(&self, message: &str, context: &[(&str, &str)]); + fn error(&self, message: &str, context: &[(&str, &str)]); + fn warning(&self, message: &str, context: &[(&str, &str)]); + fn notice(&self, message: &str, context: &[(&str, &str)]); + fn info(&self, message: &str, context: &[(&str, &str)]); + fn debug(&self, message: &str, context: &[(&str, &str)]); + fn log(&self, level: &str, message: &str, context: &[(&str, &str)]); +} diff --git a/crates/shirabe-external-packages/src/psr/log/mod.rs b/crates/shirabe-external-packages/src/psr/log/mod.rs new file mode 100644 index 0000000..ce220bc --- /dev/null +++ b/crates/shirabe-external-packages/src/psr/log/mod.rs @@ -0,0 +1,2 @@ +pub mod log_level; +pub mod logger_interface; diff --git a/crates/shirabe-external-packages/src/psr/mod.rs b/crates/shirabe-external-packages/src/psr/mod.rs new file mode 100644 index 0000000..f4ee9bc --- /dev/null +++ b/crates/shirabe-external-packages/src/psr/mod.rs @@ -0,0 +1 @@ +pub mod log; diff --git a/crates/shirabe-external-packages/src/react/mod.rs b/crates/shirabe-external-packages/src/react/mod.rs new file mode 100644 index 0000000..c97841f --- /dev/null +++ b/crates/shirabe-external-packages/src/react/mod.rs @@ -0,0 +1 @@ +pub mod promise; diff --git a/crates/shirabe-external-packages/src/react/promise/mod.rs b/crates/shirabe-external-packages/src/react/promise/mod.rs new file mode 100644 index 0000000..602cee2 --- /dev/null +++ b/crates/shirabe-external-packages/src/react/promise/mod.rs @@ -0,0 +1,13 @@ +pub mod promise; +pub mod promise_interface; + +use shirabe_php_shim::PhpMixed; +use self::promise::Promise; + +pub fn resolve(value: Option<PhpMixed>) -> Promise { + todo!() +} + +pub fn all(promises: Vec<Promise>) -> Promise { + todo!() +} diff --git a/crates/shirabe-external-packages/src/react/promise/promise.rs b/crates/shirabe-external-packages/src/react/promise/promise.rs new file mode 100644 index 0000000..36770b6 --- /dev/null +++ b/crates/shirabe-external-packages/src/react/promise/promise.rs @@ -0,0 +1,18 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct Promise; + +impl Promise { + pub fn new(resolver: Box<dyn FnOnce(Box<dyn FnOnce(Option<PhpMixed>)>, Box<dyn FnOnce(Option<PhpMixed>)>)>) -> Self { + todo!() + } + + pub fn then<F, G>(self, on_fulfilled: Option<F>, on_rejected: Option<G>) -> Self + where + F: FnOnce(Option<PhpMixed>) -> Option<PhpMixed>, + G: FnOnce(Option<PhpMixed>) -> Option<PhpMixed>, + { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/react/promise/promise_interface.rs b/crates/shirabe-external-packages/src/react/promise/promise_interface.rs new file mode 100644 index 0000000..bb604a8 --- /dev/null +++ b/crates/shirabe-external-packages/src/react/promise/promise_interface.rs @@ -0,0 +1,9 @@ +use shirabe_php_shim::PhpMixed; + +pub trait PromiseInterface { + fn then( + &self, + on_fulfilled: Option<Box<dyn FnOnce(Option<PhpMixed>) -> Option<PhpMixed>>>, + on_rejected: Option<Box<dyn FnOnce(Option<PhpMixed>) -> Option<PhpMixed>>>, + ) -> Box<dyn PromiseInterface>; +} diff --git a/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs b/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs new file mode 100644 index 0000000..9e35396 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct DuplicateKeyException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for DuplicateKeyException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for DuplicateKeyException {} diff --git a/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs b/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs new file mode 100644 index 0000000..6deb13c --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs @@ -0,0 +1,16 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct JsonParser; + +impl JsonParser { + pub const DETECT_KEY_CONFLICTS: u32 = 1; + + pub fn new() -> Self { + todo!() + } + + pub fn parse(&self, json: &str, flags: u32) -> anyhow::Result<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/seld/json_lint/mod.rs b/crates/shirabe-external-packages/src/seld/json_lint/mod.rs new file mode 100644 index 0000000..fef5a26 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/mod.rs @@ -0,0 +1,3 @@ +pub mod duplicate_key_exception; +pub mod json_parser; +pub mod parsing_exception; diff --git a/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs new file mode 100644 index 0000000..3ec6b6b --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct ParsingException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for ParsingException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for ParsingException {} diff --git a/crates/shirabe-external-packages/src/seld/mod.rs b/crates/shirabe-external-packages/src/seld/mod.rs new file mode 100644 index 0000000..c7b1cd4 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/mod.rs @@ -0,0 +1,3 @@ +pub mod json_lint; +pub mod phar_utils; +pub mod signal; diff --git a/crates/shirabe-external-packages/src/seld/phar_utils/linter.rs b/crates/shirabe-external-packages/src/seld/phar_utils/linter.rs new file mode 100644 index 0000000..d879c7d --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/phar_utils/linter.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub struct Linter; + +impl Linter { + pub fn lint(file: &str, php_versions: &[String]) -> anyhow::Result<()> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/seld/phar_utils/mod.rs b/crates/shirabe-external-packages/src/seld/phar_utils/mod.rs new file mode 100644 index 0000000..82049a8 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/phar_utils/mod.rs @@ -0,0 +1,2 @@ +pub mod linter; +pub mod timestamps; diff --git a/crates/shirabe-external-packages/src/seld/phar_utils/timestamps.rs b/crates/shirabe-external-packages/src/seld/phar_utils/timestamps.rs new file mode 100644 index 0000000..d2e1be9 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/phar_utils/timestamps.rs @@ -0,0 +1,18 @@ +#[derive(Debug)] +pub struct Timestamps { + file: String, +} + +impl Timestamps { + pub fn new(file: &str) -> Self { + todo!() + } + + pub fn update_timestamps(&mut self, date: &str) -> anyhow::Result<()> { + todo!() + } + + pub fn save(&self, file: &str, format: i64) -> anyhow::Result<()> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/seld/signal/mod.rs b/crates/shirabe-external-packages/src/seld/signal/mod.rs new file mode 100644 index 0000000..61f69bd --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/signal/mod.rs @@ -0,0 +1 @@ +pub mod signal_handler; diff --git a/crates/shirabe-external-packages/src/seld/signal/signal_handler.rs b/crates/shirabe-external-packages/src/seld/signal/signal_handler.rs new file mode 100644 index 0000000..c592fc5 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/signal/signal_handler.rs @@ -0,0 +1,19 @@ +#[derive(Debug)] +pub struct SignalHandler; + +impl SignalHandler { + pub const SIGINT: &'static str = "SIGINT"; + pub const SIGTERM: &'static str = "SIGTERM"; + pub const SIGHUP: &'static str = "SIGHUP"; + + pub fn create( + signals: Vec<String>, + callback: Box<dyn Fn(String, &SignalHandler)>, + ) -> Self { + todo!() + } + + pub fn unregister(&self) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/application.rs b/crates/shirabe-external-packages/src/symfony/component/console/application.rs new file mode 100644 index 0000000..760e609 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/application.rs @@ -0,0 +1,88 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::output::output_interface::OutputInterface; + +#[derive(Debug)] +pub struct Application; + +impl Application { + pub fn new(name: &str, version: &str) -> Self { + todo!() + } + + pub fn run( + &mut self, + input: Option<&mut dyn InputInterface>, + output: Option<&mut dyn OutputInterface>, + ) -> anyhow::Result<i64> { + todo!() + } + + pub fn set_name(&mut self, name: &str) { + todo!() + } + + pub fn get_name(&self) -> String { + todo!() + } + + pub fn set_version(&mut self, version: &str) { + todo!() + } + + pub fn get_version(&self) -> String { + todo!() + } + + pub fn add(&mut self, command: PhpMixed) -> Option<PhpMixed> { + todo!() + } + + pub fn get(&self, name: &str) -> anyhow::Result<PhpMixed> { + todo!() + } + + pub fn set_auto_exit(&mut self, auto_exit: bool) { + todo!() + } + + pub fn set_catch_exceptions(&mut self, catch_exceptions: bool) { + todo!() + } + + pub fn get_helper_set(&self) -> PhpMixed { + todo!() + } + + pub fn set_helper_set(&mut self, helper_set: PhpMixed) { + todo!() + } + + pub fn get_definition(&self) -> PhpMixed { + todo!() + } + + pub fn get_long_version(&self) -> String { + todo!() + } + + pub fn find(&self, name: &str) -> anyhow::Result<PhpMixed> { + todo!() + } + + pub fn all(&self, namespace: Option<&str>) -> Vec<PhpMixed> { + todo!() + } + + pub fn get_namespaces(&self) -> Vec<String> { + todo!() + } + + pub fn set_default_command(&mut self, command_name: &str, is_single_command: bool) -> &mut Self { + todo!() + } + + pub fn is_single_command(&self) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs b/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs new file mode 100644 index 0000000..cf18378 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs @@ -0,0 +1,81 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::output::output_interface::OutputInterface; +use crate::symfony::component::console::input::input_definition::InputDefinition; + +#[derive(Debug)] +pub struct Command; + +impl Command { + pub fn new(name: Option<&str>) -> Self { + todo!() + } + + pub fn set_name(&mut self, name: &str) -> &mut Self { + todo!() + } + + pub fn get_name(&self) -> Option<String> { + todo!() + } + + pub fn set_description(&mut self, description: &str) -> &mut Self { + todo!() + } + + pub fn get_description(&self) -> String { + todo!() + } + + pub fn set_help(&mut self, help: &str) -> &mut Self { + todo!() + } + + pub fn set_definition(&mut self, definition: PhpMixed) -> &mut Self { + todo!() + } + + pub fn get_definition(&self) -> &InputDefinition { + todo!() + } + + pub fn add_argument(&mut self, name: &str, mode: Option<i64>, description: &str, default: PhpMixed) -> &mut Self { + todo!() + } + + pub fn add_option(&mut self, name: &str, shortcut: Option<&str>, mode: Option<i64>, description: &str, default: PhpMixed) -> &mut Self { + todo!() + } + + pub fn set_aliases(&mut self, aliases: &[String]) -> &mut Self { + todo!() + } + + pub fn get_aliases(&self) -> Vec<String> { + todo!() + } + + pub fn set_hidden(&mut self, hidden: bool) -> &mut Self { + todo!() + } + + pub fn is_hidden(&self) -> bool { + todo!() + } + + pub fn run( + &mut self, + input: &mut dyn InputInterface, + output: &mut dyn OutputInterface, + ) -> anyhow::Result<i64> { + todo!() + } + + pub fn get_helper(&self, name: &str) -> PhpMixed { + todo!() + } + + pub fn get_helper_set(&self) -> PhpMixed { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/command/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/command/mod.rs new file mode 100644 index 0000000..9fe7961 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/command/mod.rs @@ -0,0 +1 @@ +pub mod command; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs new file mode 100644 index 0000000..a4b3d3e --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs @@ -0,0 +1,26 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct CompletionInput; + +impl CompletionInput { + pub fn get_completion_type(&self) -> String { + todo!() + } + + pub fn get_completion_name(&self) -> Option<String> { + todo!() + } + + pub fn get_completion_value(&self) -> String { + todo!() + } + + pub fn must_suggest_option_values_for(&self, name: &str) -> bool { + todo!() + } + + pub fn must_suggest_argument_values_for(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs new file mode 100644 index 0000000..709cdcd --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs @@ -0,0 +1,14 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct CompletionSuggestions; + +impl CompletionSuggestions { + pub fn suggest_values(&mut self, values: Vec<PhpMixed>) { + todo!() + } + + pub fn suggest_value(&mut self, value: PhpMixed) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/mod.rs new file mode 100644 index 0000000..6300bb0 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/mod.rs @@ -0,0 +1,2 @@ +pub mod completion_input; +pub mod completion_suggestions; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs new file mode 100644 index 0000000..f1ed60b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/command_not_found_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct CommandNotFoundException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for CommandNotFoundException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for CommandNotFoundException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs new file mode 100644 index 0000000..3c42009 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/exception_interface.rs @@ -0,0 +1 @@ +pub trait ExceptionInterface: std::error::Error {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs new file mode 100644 index 0000000..658ed8c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/invalid_argument_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct InvalidArgumentException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for InvalidArgumentException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for InvalidArgumentException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs new file mode 100644 index 0000000..febda79 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/exception/mod.rs @@ -0,0 +1,3 @@ +pub mod command_not_found_exception; +pub mod exception_interface; +pub mod invalid_argument_exception; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/mod.rs new file mode 100644 index 0000000..81a2a87 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/mod.rs @@ -0,0 +1,2 @@ +pub mod output_formatter; +pub mod output_formatter_style; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs new file mode 100644 index 0000000..1f51e46 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs @@ -0,0 +1,32 @@ +#[derive(Debug)] +pub struct OutputFormatter; + +impl OutputFormatter { + pub fn new(decorated: bool) -> Self { + todo!() + } + + pub fn format(&self, message: &str) -> String { + todo!() + } + + pub fn is_decorated(&self) -> bool { + todo!() + } + + pub fn set_decorated(&mut self, decorated: bool) { + todo!() + } + + pub fn escape(text: &str) -> String { + todo!() + } + + pub fn escape_trailing_backslash(text: &str) -> String { + todo!() + } + + pub fn set_style(&mut self, name: &str, style: crate::symfony::component::console::formatter::output_formatter_style::OutputFormatterStyle) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs new file mode 100644 index 0000000..8be111d --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub struct OutputFormatterStyle; + +impl OutputFormatterStyle { + pub fn new(foreground: Option<&str>, background: Option<&str>, options: Option<Vec<String>>) -> Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs new file mode 100644 index 0000000..eb19ea7 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs @@ -0,0 +1,12 @@ +#[derive(Debug)] +pub struct FormatterHelper; + +impl FormatterHelper { + pub fn format_section(&self, section: &str, message: &str, style: &str) -> String { + todo!() + } + + pub fn format_block(&self, messages: &[&str], style: &str, large: bool) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper.rs new file mode 100644 index 0000000..881aabd --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper.rs @@ -0,0 +1,3 @@ +pub trait Helper { + fn get_name(&self) -> String; +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs new file mode 100644 index 0000000..9448310 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs @@ -0,0 +1,22 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct HelperSet; + +impl HelperSet { + pub fn new(helpers: Vec<PhpMixed>) -> Self { + todo!() + } + + pub fn get(&self, name: &str) -> Option<PhpMixed> { + todo!() + } + + pub fn set(&mut self, helper: PhpMixed, alias: Option<&str>) { + todo!() + } + + pub fn has(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/mod.rs new file mode 100644 index 0000000..4fbb5c3 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/mod.rs @@ -0,0 +1,7 @@ +pub mod formatter_helper; +pub mod helper; +pub mod helper_set; +pub mod progress_bar; +pub mod question_helper; +pub mod table; +pub mod table_separator; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs new file mode 100644 index 0000000..22ca089 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs @@ -0,0 +1,34 @@ +use crate::symfony::component::console::output::output_interface::OutputInterface; + +#[derive(Debug)] +pub struct ProgressBar; + +impl ProgressBar { + pub fn new(output: &dyn OutputInterface, max: i64) -> Self { + todo!() + } + + pub fn start(&mut self, max: Option<i64>) { + todo!() + } + + pub fn advance(&mut self, step: i64) { + todo!() + } + + pub fn finish(&mut self) { + todo!() + } + + pub fn set_format(&mut self, format: &str) { + todo!() + } + + pub fn get_progress(&self) -> i64 { + todo!() + } + + pub fn get_max_steps(&self) -> i64 { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs new file mode 100644 index 0000000..ade7c06 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs @@ -0,0 +1,18 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::output::output_interface::OutputInterface; +use crate::symfony::component::console::question::question::Question; + +#[derive(Debug)] +pub struct QuestionHelper; + +impl QuestionHelper { + pub fn ask( + &self, + input: &mut dyn InputInterface, + output: &mut dyn OutputInterface, + question: &Question, + ) -> Option<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs new file mode 100644 index 0000000..0244c73 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs @@ -0,0 +1,35 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::output::output_interface::OutputInterface; + +#[derive(Debug)] +pub struct Table; + +impl Table { + pub fn new(output: &dyn OutputInterface) -> Self { + todo!() + } + + pub fn set_headers(&mut self, headers: Vec<PhpMixed>) -> &mut Self { + todo!() + } + + pub fn set_rows(&mut self, rows: Vec<PhpMixed>) -> &mut Self { + todo!() + } + + pub fn add_row(&mut self, row: PhpMixed) -> &mut Self { + todo!() + } + + pub fn render(&mut self) { + todo!() + } + + pub fn set_style(&mut self, style: &str) -> &mut Self { + todo!() + } + + pub fn set_column_widths(&mut self, widths: Vec<i64>) -> &mut Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs new file mode 100644 index 0000000..7b4b2e2 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub struct TableSeparator; + +impl TableSeparator { + pub fn new() -> Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs new file mode 100644 index 0000000..c70e798 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs @@ -0,0 +1,31 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::input::input_definition::InputDefinition; + +#[derive(Debug)] +pub struct ArrayInput; + +impl ArrayInput { + pub fn new(parameters: IndexMap<String, PhpMixed>, definition: Option<InputDefinition>) -> Self { + todo!() + } +} + +impl InputInterface for ArrayInput { + fn get_first_argument(&self) -> Option<String> { todo!() } + fn has_parameter_option(&self, _values: &[&str], _only_params: bool) -> bool { todo!() } + fn get_parameter_option(&self, _values: &[&str], _default: PhpMixed, _only_params: bool) -> PhpMixed { todo!() } + fn bind(&mut self, _definition: &InputDefinition) -> anyhow::Result<()> { todo!() } + fn validate(&self) -> anyhow::Result<()> { todo!() } + fn get_arguments(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_argument(&self, _name: &str) -> PhpMixed { todo!() } + fn set_argument(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_argument(&self, _name: &str) -> bool { todo!() } + fn get_options(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_option(&self, _name: &str) -> PhpMixed { todo!() } + fn set_option(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_option(&self, _name: &str) -> bool { todo!() } + fn is_interactive(&self) -> bool { todo!() } + fn set_interactive(&mut self, _interactive: bool) { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs new file mode 100644 index 0000000..7a46004 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs @@ -0,0 +1,30 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct InputDefinition; + +impl InputDefinition { + pub fn new(definition: Vec<PhpMixed>) -> Self { + todo!() + } + + pub fn add_argument(&mut self, argument: PhpMixed) { + todo!() + } + + pub fn add_option(&mut self, option: PhpMixed) { + todo!() + } + + pub fn has_option(&self, name: &str) -> bool { + todo!() + } + + pub fn get_option(&self, name: &str) -> anyhow::Result<PhpMixed> { + todo!() + } + + pub fn has_argument(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/input_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_interface.rs new file mode 100644 index 0000000..04e302e --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/input_interface.rs @@ -0,0 +1,19 @@ +use shirabe_php_shim::PhpMixed; + +pub trait InputInterface { + fn get_first_argument(&self) -> Option<String>; + fn has_parameter_option(&self, values: &[&str], only_params: bool) -> bool; + fn get_parameter_option(&self, values: &[&str], default: PhpMixed, only_params: bool) -> PhpMixed; + fn bind(&mut self, definition: &crate::symfony::component::console::input::input_definition::InputDefinition) -> anyhow::Result<()>; + fn validate(&self) -> anyhow::Result<()>; + fn get_arguments(&self) -> indexmap::IndexMap<String, PhpMixed>; + fn get_argument(&self, name: &str) -> PhpMixed; + fn set_argument(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + fn has_argument(&self, name: &str) -> bool; + fn get_options(&self) -> indexmap::IndexMap<String, PhpMixed>; + fn get_option(&self, name: &str) -> PhpMixed; + fn set_option(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + fn has_option(&self, name: &str) -> bool; + fn is_interactive(&self) -> bool; + fn set_interactive(&mut self, interactive: bool); +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs new file mode 100644 index 0000000..9c188ba --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs @@ -0,0 +1,46 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct InputOption; + +impl InputOption { + pub const VALUE_NONE: i64 = 1; + pub const VALUE_REQUIRED: i64 = 2; + pub const VALUE_OPTIONAL: i64 = 4; + pub const VALUE_IS_ARRAY: i64 = 8; + pub const VALUE_NEGATABLE: i64 = 16; + + pub fn new( + name: &str, + shortcut: Option<&str>, + mode: Option<i64>, + description: &str, + default: PhpMixed, + ) -> Self { + todo!() + } + + pub fn get_name(&self) -> String { + todo!() + } + + pub fn accept_value(&self) -> bool { + todo!() + } + + pub fn is_value_required(&self) -> bool { + todo!() + } + + pub fn is_value_optional(&self) -> bool { + todo!() + } + + pub fn is_array(&self) -> bool { + todo!() + } + + pub fn get_default(&self) -> PhpMixed { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/mod.rs new file mode 100644 index 0000000..1a81599 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/mod.rs @@ -0,0 +1,5 @@ +pub mod array_input; +pub mod input_definition; +pub mod input_interface; +pub mod input_option; +pub mod string_input; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs new file mode 100644 index 0000000..3c401eb --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs @@ -0,0 +1,31 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::component::console::input::input_interface::InputInterface; +use crate::symfony::component::console::input::input_definition::InputDefinition; + +#[derive(Debug)] +pub struct StringInput; + +impl StringInput { + pub fn new(input: &str) -> Self { + todo!() + } +} + +impl InputInterface for StringInput { + fn get_first_argument(&self) -> Option<String> { todo!() } + fn has_parameter_option(&self, _values: &[&str], _only_params: bool) -> bool { todo!() } + fn get_parameter_option(&self, _values: &[&str], _default: PhpMixed, _only_params: bool) -> PhpMixed { todo!() } + fn bind(&mut self, _definition: &InputDefinition) -> anyhow::Result<()> { todo!() } + fn validate(&self) -> anyhow::Result<()> { todo!() } + fn get_arguments(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_argument(&self, _name: &str) -> PhpMixed { todo!() } + fn set_argument(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_argument(&self, _name: &str) -> bool { todo!() } + fn get_options(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_option(&self, _name: &str) -> PhpMixed { todo!() } + fn set_option(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_option(&self, _name: &str) -> bool { todo!() } + fn is_interactive(&self) -> bool { todo!() } + fn set_interactive(&mut self, _interactive: bool) { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/mod.rs new file mode 100644 index 0000000..b7c65d8 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/mod.rs @@ -0,0 +1,11 @@ +pub mod application; +pub mod command; +pub mod completion; +pub mod exception; +pub mod formatter; +pub mod helper; +pub mod input; +pub mod output; +pub mod question; +pub mod single_command_application; +pub mod terminal; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs new file mode 100644 index 0000000..98133df --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs @@ -0,0 +1,31 @@ +use crate::symfony::component::console::formatter::output_formatter::OutputFormatter; +use crate::symfony::component::console::output::output_interface::OutputInterface; +use crate::symfony::component::console::output::console_output_interface::ConsoleOutputInterface; + +#[derive(Debug)] +pub struct ConsoleOutput; + +impl ConsoleOutput { + pub fn new(verbosity: i64, decorated: Option<bool>, formatter: Option<OutputFormatter>) -> Self { + todo!() + } + + pub fn get_error_output(&self) -> &dyn OutputInterface { + todo!() + } +} + +impl OutputInterface for ConsoleOutput { + fn write(&mut self, _messages: &str, _newline: bool, _type: i64) { todo!() } + fn writeln(&mut self, _messages: &str, _type: i64) { todo!() } + fn set_verbosity(&mut self, _level: i64) { todo!() } + fn get_verbosity(&self) -> i64 { todo!() } + fn is_quiet(&self) -> bool { todo!() } + fn is_verbose(&self) -> bool { todo!() } + fn is_very_verbose(&self) -> bool { todo!() } + fn is_debug(&self) -> bool { todo!() } + fn set_decorated(&mut self, _decorated: bool) { todo!() } + fn is_decorated(&self) -> bool { todo!() } + fn set_formatter(&mut self, _formatter: OutputFormatter) { todo!() } + fn get_formatter(&self) -> &OutputFormatter { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/console_output_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output_interface.rs new file mode 100644 index 0000000..0e5fc88 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output_interface.rs @@ -0,0 +1,6 @@ +use crate::symfony::component::console::output::output_interface::OutputInterface; + +pub trait ConsoleOutputInterface: OutputInterface { + fn get_error_output(&self) -> &dyn OutputInterface; + fn set_error_output(&mut self, error: Box<dyn OutputInterface>); +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/mod.rs new file mode 100644 index 0000000..a548a0c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/mod.rs @@ -0,0 +1,3 @@ +pub mod console_output; +pub mod console_output_interface; +pub mod output_interface; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/output_interface.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/output_interface.rs new file mode 100644 index 0000000..62a95bb --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/output_interface.rs @@ -0,0 +1,26 @@ +use crate::symfony::component::console::formatter::output_formatter::OutputFormatter; + +pub trait OutputInterface { + fn write(&mut self, messages: &str, newline: bool, r#type: i64); + fn writeln(&mut self, messages: &str, r#type: i64); + fn set_verbosity(&mut self, level: i64); + fn get_verbosity(&self) -> i64; + fn is_quiet(&self) -> bool; + fn is_verbose(&self) -> bool; + fn is_very_verbose(&self) -> bool; + fn is_debug(&self) -> bool; + fn set_decorated(&mut self, decorated: bool); + fn is_decorated(&self) -> bool; + fn set_formatter(&mut self, formatter: OutputFormatter); + fn get_formatter(&self) -> &OutputFormatter; +} + +pub const VERBOSITY_QUIET: i64 = 16; +pub const VERBOSITY_NORMAL: i64 = 32; +pub const VERBOSITY_VERBOSE: i64 = 64; +pub const VERBOSITY_VERY_VERBOSE: i64 = 128; +pub const VERBOSITY_DEBUG: i64 = 256; + +pub const OUTPUT_NORMAL: i64 = 1; +pub const OUTPUT_RAW: i64 = 2; +pub const OUTPUT_PLAIN: i64 = 4; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs new file mode 100644 index 0000000..5b32ced --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs @@ -0,0 +1,19 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::component::console::question::question::Question; + +#[derive(Debug)] +pub struct ChoiceQuestion(pub Question); + +impl ChoiceQuestion { + pub fn new(question: &str, choices: Vec<PhpMixed>, default: Option<PhpMixed>) -> Self { + todo!() + } + + pub fn set_multiselect(&mut self, multiselect: bool) { + todo!() + } + + pub fn set_error_message(&mut self, error_message: &str) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/mod.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/mod.rs new file mode 100644 index 0000000..e3a42e8 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/mod.rs @@ -0,0 +1,2 @@ +pub mod choice_question; +pub mod question; diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs new file mode 100644 index 0000000..cfbdd25 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs @@ -0,0 +1,46 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct Question; + +impl Question { + pub fn new(question: &str, default: Option<PhpMixed>) -> Self { + todo!() + } + + pub fn set_validator(&mut self, validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>) { + todo!() + } + + pub fn set_max_attempts(&mut self, attempts: Option<i64>) { + todo!() + } + + pub fn set_hidden(&mut self, hidden: bool) { + todo!() + } + + pub fn set_hidden_fallback(&mut self, fallback: bool) { + todo!() + } + + pub fn get_question(&self) -> String { + todo!() + } + + pub fn get_default(&self) -> Option<PhpMixed> { + todo!() + } + + pub fn is_hidden(&self) -> bool { + todo!() + } + + pub fn get_validator(&self) -> Option<&dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>> { + todo!() + } + + pub fn get_max_attempts(&self) -> Option<i64> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs b/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs new file mode 100644 index 0000000..9642aa0 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs @@ -0,0 +1,26 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct SingleCommandApplication; + +impl SingleCommandApplication { + pub fn new() -> Self { + todo!() + } + + pub fn set_name(&mut self, name: &str) -> &mut Self { + todo!() + } + + pub fn set_version(&mut self, version: &str) -> &mut Self { + todo!() + } + + pub fn set_code(&mut self, code: Box<dyn Fn(&dyn std::any::Any, &dyn std::any::Any) -> i64>) -> &mut Self { + todo!() + } + + pub fn run(&mut self) -> anyhow::Result<i64> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs b/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs new file mode 100644 index 0000000..f960a50 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct Terminal; + +impl Terminal { + pub fn new() -> Self { + todo!() + } + + pub fn get_width(&self) -> i64 { + todo!() + } + + pub fn get_height(&self) -> i64 { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/filesystem/exception/io_exception.rs b/crates/shirabe-external-packages/src/symfony/component/filesystem/exception/io_exception.rs new file mode 100644 index 0000000..3ffcc9c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/filesystem/exception/io_exception.rs @@ -0,0 +1,14 @@ +#[derive(Debug)] +pub struct IOException { + pub message: String, + pub code: i64, + pub path: Option<String>, +} + +impl std::fmt::Display for IOException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for IOException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/filesystem/exception/mod.rs b/crates/shirabe-external-packages/src/symfony/component/filesystem/exception/mod.rs new file mode 100644 index 0000000..e6d5ea1 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/filesystem/exception/mod.rs @@ -0,0 +1 @@ +pub mod io_exception; diff --git a/crates/shirabe-external-packages/src/symfony/component/filesystem/filesystem.rs b/crates/shirabe-external-packages/src/symfony/component/filesystem/filesystem.rs new file mode 100644 index 0000000..9999419 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/filesystem/filesystem.rs @@ -0,0 +1,105 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug, Clone)] +pub struct Filesystem; + +impl Filesystem { + pub fn new() -> Self { + todo!() + } + + pub fn copy(&self, origin_file: &str, target_file: &str, override_file: bool) -> anyhow::Result<()> { + todo!() + } + + pub fn mkdir(&self, dirs: PhpMixed, mode: u32) -> anyhow::Result<()> { + todo!() + } + + pub fn exists(&self, files: PhpMixed) -> bool { + todo!() + } + + pub fn touch(&self, files: PhpMixed, time: Option<i64>, atime: Option<i64>) -> anyhow::Result<()> { + todo!() + } + + pub fn remove(&self, files: PhpMixed) -> anyhow::Result<()> { + todo!() + } + + pub fn chmod(&self, files: PhpMixed, mode: u32, umask: u32, recursive: bool) -> anyhow::Result<()> { + todo!() + } + + pub fn chown(&self, files: PhpMixed, user: PhpMixed, recursive: bool) -> anyhow::Result<()> { + todo!() + } + + pub fn chgrp(&self, files: PhpMixed, group: PhpMixed, recursive: bool) -> anyhow::Result<()> { + todo!() + } + + pub fn rename(&self, origin: &str, target: &str, override_file: bool) -> anyhow::Result<()> { + todo!() + } + + pub fn symlink(&self, origin_dir: &str, target_dir: &str, copy_on_windows: bool) -> anyhow::Result<()> { + todo!() + } + + pub fn hard_link(&self, origin_file: &str, target_files: PhpMixed) -> anyhow::Result<()> { + todo!() + } + + pub fn read_link(&self, path: &str) -> String { + todo!() + } + + pub fn make_path_relative(&self, end_path: &str, start_path: &str) -> String { + todo!() + } + + pub fn mirror( + &self, + origin_dir: &str, + target_dir: &str, + iterator: Option<PhpMixed>, + options: &indexmap::IndexMap<String, PhpMixed>, + ) -> anyhow::Result<()> { + todo!() + } + + pub fn is_absolute_path(&self, file: &str) -> bool { + todo!() + } + + pub fn dump_file(&self, filename: &str, content: &str) -> anyhow::Result<()> { + todo!() + } + + pub fn append_to_file(&self, filename: &str, content: &str) -> anyhow::Result<()> { + todo!() + } + + pub fn temp_nam(&self, dir: &str, prefix: &str) -> anyhow::Result<String> { + todo!() + } + + // Static-style helper methods used in the ported codebase + pub fn is_readable(path: &str) -> bool { + todo!() + } + + pub fn is_local_path(path: &str) -> bool { + todo!() + } + + pub fn trim_trailing_slash(path: &str) -> String { + todo!() + } + + pub fn get_platform_path(path: &str) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/filesystem/mod.rs b/crates/shirabe-external-packages/src/symfony/component/filesystem/mod.rs new file mode 100644 index 0000000..e74dc5f --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/filesystem/mod.rs @@ -0,0 +1,2 @@ +pub mod exception; +pub mod filesystem; diff --git a/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs b/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs new file mode 100644 index 0000000..95bc4f7 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs @@ -0,0 +1,55 @@ +use crate::symfony::component::finder::spl_file_info::SplFileInfo; + +#[derive(Debug)] +pub struct Finder; + +impl Finder { + pub fn new() -> Self { + todo!() + } + + pub fn create() -> Self { + todo!() + } + + pub fn files(&mut self) -> &mut Self { + todo!() + } + + pub fn directories(&mut self) -> &mut Self { + todo!() + } + + pub fn depth(&mut self, level: i64) -> &mut Self { + todo!() + } + + pub fn r#in(&mut self, dirs: &str) -> &mut Self { + todo!() + } + + pub fn ignore_vcs(&mut self, ignore_vcs: bool) -> &mut Self { + todo!() + } + + pub fn ignore_dot_files(&mut self, ignore_dot_files: bool) -> &mut Self { + todo!() + } + + pub fn not_name(&mut self, pattern: &str) -> &mut Self { + todo!() + } + + pub fn name(&mut self, pattern: &str) -> &mut Self { + todo!() + } + + pub fn sort_by_name(&mut self) -> &mut Self { + todo!() + } + + pub fn iter(&self) -> impl Iterator<Item = SplFileInfo> { + todo!(); + std::iter::empty() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/finder/glob.rs b/crates/shirabe-external-packages/src/symfony/component/finder/glob.rs new file mode 100644 index 0000000..d6aadd2 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/finder/glob.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub struct Glob; + +impl Glob { + pub fn to_regex(glob: &str, strict_leading_dot: bool, strict_wildcard_slash: bool) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/finder/mod.rs b/crates/shirabe-external-packages/src/symfony/component/finder/mod.rs new file mode 100644 index 0000000..b71a0ef --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/finder/mod.rs @@ -0,0 +1,3 @@ +pub mod finder; +pub mod glob; +pub mod spl_file_info; diff --git a/crates/shirabe-external-packages/src/symfony/component/finder/spl_file_info.rs b/crates/shirabe-external-packages/src/symfony/component/finder/spl_file_info.rs new file mode 100644 index 0000000..fd63b33 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/finder/spl_file_info.rs @@ -0,0 +1,52 @@ +#[derive(Debug)] +pub struct SplFileInfo; + +impl SplFileInfo { + pub fn get_path_name(&self) -> String { + todo!() + } + + pub fn get_path(&self) -> String { + todo!() + } + + pub fn get_filename(&self) -> String { + todo!() + } + + pub fn get_basename(&self, suffix: Option<&str>) -> String { + todo!() + } + + pub fn get_extension(&self) -> String { + todo!() + } + + pub fn get_relative_path_name(&self) -> String { + todo!() + } + + pub fn get_relative_path(&self) -> String { + todo!() + } + + pub fn is_dir(&self) -> bool { + todo!() + } + + pub fn is_file(&self) -> bool { + todo!() + } + + pub fn is_link(&self) -> bool { + todo!() + } + + pub fn get_real_path(&self) -> Option<String> { + todo!() + } + + pub fn get_size(&self) -> i64 { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/mod.rs b/crates/shirabe-external-packages/src/symfony/component/mod.rs new file mode 100644 index 0000000..e0d9e4f --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/mod.rs @@ -0,0 +1,4 @@ +pub mod console; +pub mod filesystem; +pub mod finder; +pub mod process; diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/mod.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/mod.rs new file mode 100644 index 0000000..0fec4ee --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/mod.rs @@ -0,0 +1,3 @@ +pub mod process_signaled_exception; +pub mod process_timed_out_exception; +pub mod runtime_exception; diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/process_signaled_exception.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_signaled_exception.rs new file mode 100644 index 0000000..154a7a7 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_signaled_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct ProcessSignaledException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for ProcessSignaledException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for ProcessSignaledException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/process_timed_out_exception.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_timed_out_exception.rs new file mode 100644 index 0000000..cbcdaa4 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_timed_out_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct ProcessTimedOutException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for ProcessTimedOutException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for ProcessTimedOutException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/runtime_exception.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/runtime_exception.rs new file mode 100644 index 0000000..3ac2c8b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/runtime_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct RuntimeException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for RuntimeException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for RuntimeException {} diff --git a/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs b/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs new file mode 100644 index 0000000..9aa5a8b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct ExecutableFinder; + +impl ExecutableFinder { + pub fn new() -> Self { + todo!() + } + + pub fn add_suffix(&mut self, suffix: &str) { + todo!() + } + + pub fn find(&self, name: &str, default: Option<&str>, dirs: &[String]) -> Option<String> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/process/mod.rs b/crates/shirabe-external-packages/src/symfony/component/process/mod.rs new file mode 100644 index 0000000..4d21bf3 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/mod.rs @@ -0,0 +1,4 @@ +pub mod exception; +pub mod executable_finder; +pub mod php_executable_finder; +pub mod process; diff --git a/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs b/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs new file mode 100644 index 0000000..be99e8c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct PhpExecutableFinder; + +impl PhpExecutableFinder { + pub fn new() -> Self { + todo!() + } + + pub fn find(&self, include_args: bool) -> Option<String> { + todo!() + } + + pub fn find_arguments(&self) -> Vec<String> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/component/process/process.rs b/crates/shirabe-external-packages/src/symfony/component/process/process.rs new file mode 100644 index 0000000..7572f3b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/component/process/process.rs @@ -0,0 +1,110 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; + +#[derive(Debug)] +pub struct Process; + +impl Process { + pub const ERR: &'static str = "err"; + pub const OUT: &'static str = "out"; + + pub fn new( + command: Vec<String>, + cwd: Option<String>, + env: Option<IndexMap<String, String>>, + input: Option<String>, + timeout: Option<f64>, + ) -> Self { + todo!() + } + + pub fn from_shell_commandline( + command: &str, + cwd: Option<&str>, + env: Option<IndexMap<String, String>>, + input: Option<String>, + timeout: Option<f64>, + ) -> Self { + todo!() + } + + pub fn set_timeout(&mut self, timeout: Option<f64>) -> &mut Self { + todo!() + } + + pub fn set_env(&mut self, env: IndexMap<String, String>) -> &mut Self { + todo!() + } + + pub fn set_input(&mut self, input: Option<String>) -> &mut Self { + todo!() + } + + pub fn run(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 { + todo!() + } + + pub fn must_run(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> anyhow::Result<&mut Self> { + todo!() + } + + pub fn start(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) { + todo!() + } + + pub fn wait(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 { + todo!() + } + + pub fn stop(&mut self, timeout: f64, signal: Option<i64>) -> Option<i64> { + todo!() + } + + pub fn is_running(&self) -> bool { + todo!() + } + + pub fn is_successful(&self) -> bool { + todo!() + } + + pub fn is_started(&self) -> bool { + todo!() + } + + pub fn is_terminated(&self) -> bool { + todo!() + } + + pub fn get_output(&self) -> String { + todo!() + } + + pub fn get_error_output(&self) -> String { + todo!() + } + + pub fn get_exit_code(&self) -> Option<i64> { + todo!() + } + + pub fn get_exit_code_text(&self) -> Option<String> { + todo!() + } + + pub fn get_command_line(&self) -> String { + todo!() + } + + pub fn check_timeout(&self) -> anyhow::Result<()> { + todo!() + } + + pub fn get_timeout(&self) -> Option<f64> { + todo!() + } + + pub fn set_working_directory(&mut self, cwd: &str) -> &mut Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/completion/completion_input.rs b/crates/shirabe-external-packages/src/symfony/console/completion/completion_input.rs new file mode 100644 index 0000000..a4b3d3e --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/completion/completion_input.rs @@ -0,0 +1,26 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct CompletionInput; + +impl CompletionInput { + pub fn get_completion_type(&self) -> String { + todo!() + } + + pub fn get_completion_name(&self) -> Option<String> { + todo!() + } + + pub fn get_completion_value(&self) -> String { + todo!() + } + + pub fn must_suggest_option_values_for(&self, name: &str) -> bool { + todo!() + } + + pub fn must_suggest_argument_values_for(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/completion/completion_suggestions.rs b/crates/shirabe-external-packages/src/symfony/console/completion/completion_suggestions.rs new file mode 100644 index 0000000..709cdcd --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/completion/completion_suggestions.rs @@ -0,0 +1,14 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct CompletionSuggestions; + +impl CompletionSuggestions { + pub fn suggest_values(&mut self, values: Vec<PhpMixed>) { + todo!() + } + + pub fn suggest_value(&mut self, value: PhpMixed) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/completion/mod.rs b/crates/shirabe-external-packages/src/symfony/console/completion/mod.rs new file mode 100644 index 0000000..67838b3 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/completion/mod.rs @@ -0,0 +1,3 @@ +pub mod completion_input; +pub mod completion_suggestions; +pub mod suggestion; diff --git a/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs b/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs new file mode 100644 index 0000000..1d6d0f0 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct Suggestion; + +impl Suggestion { + pub fn new(value: String, description: Option<String>) -> Self { + todo!() + } + + pub fn get_value(&self) -> String { + todo!() + } + + pub fn get_description(&self) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/exception/invalid_argument_exception.rs b/crates/shirabe-external-packages/src/symfony/console/exception/invalid_argument_exception.rs new file mode 100644 index 0000000..658ed8c --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/exception/invalid_argument_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct InvalidArgumentException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for InvalidArgumentException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for InvalidArgumentException {} diff --git a/crates/shirabe-external-packages/src/symfony/console/exception/mod.rs b/crates/shirabe-external-packages/src/symfony/console/exception/mod.rs new file mode 100644 index 0000000..498f029 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/exception/mod.rs @@ -0,0 +1 @@ +pub mod invalid_argument_exception; diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/mod.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/mod.rs new file mode 100644 index 0000000..8c6d8c8 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/mod.rs @@ -0,0 +1,3 @@ +pub mod output_formatter; +pub mod output_formatter_interface; +pub mod output_formatter_style; diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs new file mode 100644 index 0000000..03c622b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs @@ -0,0 +1,24 @@ +#[derive(Debug)] +pub struct OutputFormatter; + +impl OutputFormatter { + pub fn new(decorated: bool) -> Self { + todo!() + } + + pub fn format(&self, message: &str) -> String { + todo!() + } + + pub fn is_decorated(&self) -> bool { + todo!() + } + + pub fn set_decorated(&mut self, decorated: bool) { + todo!() + } + + pub fn escape(text: &str) -> String { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_interface.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_interface.rs new file mode 100644 index 0000000..dc93a3b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_interface.rs @@ -0,0 +1,5 @@ +pub trait OutputFormatterInterface { + fn is_decorated(&self) -> bool; + fn set_decorated(&mut self, decorated: bool); + fn format(&self, message: &str) -> String; +} diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs new file mode 100644 index 0000000..8be111d --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub struct OutputFormatterStyle; + +impl OutputFormatterStyle { + pub fn new(foreground: Option<&str>, background: Option<&str>, options: Option<Vec<String>>) -> Self { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/helper_set.rs b/crates/shirabe-external-packages/src/symfony/console/helper/helper_set.rs new file mode 100644 index 0000000..9448310 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/helper/helper_set.rs @@ -0,0 +1,22 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct HelperSet; + +impl HelperSet { + pub fn new(helpers: Vec<PhpMixed>) -> Self { + todo!() + } + + pub fn get(&self, name: &str) -> Option<PhpMixed> { + todo!() + } + + pub fn set(&mut self, helper: PhpMixed, alias: Option<&str>) { + todo!() + } + + pub fn has(&self, name: &str) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/mod.rs b/crates/shirabe-external-packages/src/symfony/console/helper/mod.rs new file mode 100644 index 0000000..285c411 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/helper/mod.rs @@ -0,0 +1,3 @@ +pub mod helper_set; +pub mod question_helper; +pub mod table; diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/question_helper.rs b/crates/shirabe-external-packages/src/symfony/console/helper/question_helper.rs new file mode 100644 index 0000000..3a2bd5b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/helper/question_helper.rs @@ -0,0 +1,15 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct QuestionHelper; + +impl QuestionHelper { + pub fn ask( + &self, + input: &mut dyn std::any::Any, + output: &mut dyn std::any::Any, + question: &dyn std::any::Any, + ) -> Option<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs new file mode 100644 index 0000000..2a8848d --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs @@ -0,0 +1,26 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct Table; + +impl Table { + pub fn new(output: &dyn std::any::Any) -> Self { + todo!() + } + + pub fn set_headers(&mut self, headers: Vec<PhpMixed>) -> &mut Self { + todo!() + } + + pub fn set_rows(&mut self, rows: Vec<PhpMixed>) -> &mut Self { + todo!() + } + + pub fn add_row(&mut self, row: PhpMixed) -> &mut Self { + todo!() + } + + pub fn render(&mut self) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs new file mode 100644 index 0000000..1eb3883 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs @@ -0,0 +1,29 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::console::input::input_interface::InputInterface; + +#[derive(Debug)] +pub struct ArrayInput; + +impl ArrayInput { + pub fn new(parameters: IndexMap<String, PhpMixed>) -> Self { + todo!() + } +} + +impl InputInterface for ArrayInput { + fn get_first_argument(&self) -> Option<String> { todo!() } + fn has_parameter_option(&self, _values: &[&str], _only_params: bool) -> bool { todo!() } + fn get_parameter_option(&self, _values: &[&str], _default: PhpMixed, _only_params: bool) -> PhpMixed { todo!() } + fn validate(&self) -> anyhow::Result<()> { todo!() } + fn get_arguments(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_argument(&self, _name: &str) -> PhpMixed { todo!() } + fn set_argument(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_argument(&self, _name: &str) -> bool { todo!() } + fn get_options(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_option(&self, _name: &str) -> PhpMixed { todo!() } + fn set_option(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_option(&self, _name: &str) -> bool { todo!() } + fn is_interactive(&self) -> bool { todo!() } + fn set_interactive(&mut self, _interactive: bool) { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs new file mode 100644 index 0000000..1f70581 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs @@ -0,0 +1,30 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct InputArgument; + +impl InputArgument { + pub const REQUIRED: i64 = 1; + pub const OPTIONAL: i64 = 2; + pub const IS_ARRAY: i64 = 4; + + pub fn new(name: &str, mode: Option<i64>, description: &str, default: Option<PhpMixed>) -> Self { + todo!() + } + + pub fn get_name(&self) -> String { + todo!() + } + + pub fn is_required(&self) -> bool { + todo!() + } + + pub fn is_array(&self) -> bool { + todo!() + } + + pub fn get_default(&self) -> Option<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs new file mode 100644 index 0000000..2e25dea --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_interface.rs @@ -0,0 +1,19 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; + +pub trait InputInterface { + fn get_first_argument(&self) -> Option<String>; + fn has_parameter_option(&self, values: &[&str], only_params: bool) -> bool; + fn get_parameter_option(&self, values: &[&str], default: PhpMixed, only_params: bool) -> PhpMixed; + fn validate(&self) -> anyhow::Result<()>; + fn get_arguments(&self) -> IndexMap<String, PhpMixed>; + fn get_argument(&self, name: &str) -> PhpMixed; + fn set_argument(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + fn has_argument(&self, name: &str) -> bool; + fn get_options(&self) -> IndexMap<String, PhpMixed>; + fn get_option(&self, name: &str) -> PhpMixed; + fn set_option(&mut self, name: &str, value: PhpMixed) -> anyhow::Result<()>; + fn has_option(&self, name: &str) -> bool; + fn is_interactive(&self) -> bool; + fn set_interactive(&mut self, interactive: bool); +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs new file mode 100644 index 0000000..9c188ba --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs @@ -0,0 +1,46 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct InputOption; + +impl InputOption { + pub const VALUE_NONE: i64 = 1; + pub const VALUE_REQUIRED: i64 = 2; + pub const VALUE_OPTIONAL: i64 = 4; + pub const VALUE_IS_ARRAY: i64 = 8; + pub const VALUE_NEGATABLE: i64 = 16; + + pub fn new( + name: &str, + shortcut: Option<&str>, + mode: Option<i64>, + description: &str, + default: PhpMixed, + ) -> Self { + todo!() + } + + pub fn get_name(&self) -> String { + todo!() + } + + pub fn accept_value(&self) -> bool { + todo!() + } + + pub fn is_value_required(&self) -> bool { + todo!() + } + + pub fn is_value_optional(&self) -> bool { + todo!() + } + + pub fn is_array(&self) -> bool { + todo!() + } + + pub fn get_default(&self) -> PhpMixed { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/mod.rs b/crates/shirabe-external-packages/src/symfony/console/input/mod.rs new file mode 100644 index 0000000..fba76f2 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/mod.rs @@ -0,0 +1,6 @@ +pub mod array_input; +pub mod input_argument; +pub mod input_interface; +pub mod input_option; +pub mod streamable_input_interface; +pub mod string_input; diff --git a/crates/shirabe-external-packages/src/symfony/console/input/streamable_input_interface.rs b/crates/shirabe-external-packages/src/symfony/console/input/streamable_input_interface.rs new file mode 100644 index 0000000..ed4a238 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/streamable_input_interface.rs @@ -0,0 +1,7 @@ +use crate::symfony::console::input::input_interface::InputInterface; +use shirabe_php_shim::PhpMixed; + +pub trait StreamableInputInterface: InputInterface { + fn set_stream(&mut self, stream: PhpMixed); + fn get_stream(&self) -> Option<PhpMixed>; +} diff --git a/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs new file mode 100644 index 0000000..d552380 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs @@ -0,0 +1,29 @@ +use shirabe_php_shim::PhpMixed; +use indexmap::IndexMap; +use crate::symfony::console::input::input_interface::InputInterface; + +#[derive(Debug)] +pub struct StringInput; + +impl StringInput { + pub fn new(input: &str) -> Self { + todo!() + } +} + +impl InputInterface for StringInput { + fn get_first_argument(&self) -> Option<String> { todo!() } + fn has_parameter_option(&self, _values: &[&str], _only_params: bool) -> bool { todo!() } + fn get_parameter_option(&self, _values: &[&str], _default: PhpMixed, _only_params: bool) -> PhpMixed { todo!() } + fn validate(&self) -> anyhow::Result<()> { todo!() } + fn get_arguments(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_argument(&self, _name: &str) -> PhpMixed { todo!() } + fn set_argument(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_argument(&self, _name: &str) -> bool { todo!() } + fn get_options(&self) -> IndexMap<String, PhpMixed> { todo!() } + fn get_option(&self, _name: &str) -> PhpMixed { todo!() } + fn set_option(&mut self, _name: &str, _value: PhpMixed) -> anyhow::Result<()> { todo!() } + fn has_option(&self, _name: &str) -> bool { todo!() } + fn is_interactive(&self) -> bool { todo!() } + fn set_interactive(&mut self, _interactive: bool) { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/mod.rs b/crates/shirabe-external-packages/src/symfony/console/mod.rs new file mode 100644 index 0000000..ae105cd --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/mod.rs @@ -0,0 +1,8 @@ +pub mod completion; +pub mod exception; +pub mod formatter; +pub mod helper; +pub mod input; +pub mod output; +pub mod question; +pub mod style; diff --git a/crates/shirabe-external-packages/src/symfony/console/output/mod.rs b/crates/shirabe-external-packages/src/symfony/console/output/mod.rs new file mode 100644 index 0000000..80e9326 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/output/mod.rs @@ -0,0 +1,2 @@ +pub mod output_interface; +pub mod stream_output; diff --git a/crates/shirabe-external-packages/src/symfony/console/output/output_interface.rs b/crates/shirabe-external-packages/src/symfony/console/output/output_interface.rs new file mode 100644 index 0000000..4031cc6 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/output/output_interface.rs @@ -0,0 +1,22 @@ +pub trait OutputInterface { + fn write(&mut self, messages: &str, newline: bool, r#type: i64); + fn writeln(&mut self, messages: &str, r#type: i64); + fn set_verbosity(&mut self, level: i64); + fn get_verbosity(&self) -> i64; + fn is_quiet(&self) -> bool; + fn is_verbose(&self) -> bool; + fn is_very_verbose(&self) -> bool; + fn is_debug(&self) -> bool; + fn set_decorated(&mut self, decorated: bool); + fn is_decorated(&self) -> bool; +} + +pub const VERBOSITY_QUIET: i64 = 16; +pub const VERBOSITY_NORMAL: i64 = 32; +pub const VERBOSITY_VERBOSE: i64 = 64; +pub const VERBOSITY_VERY_VERBOSE: i64 = 128; +pub const VERBOSITY_DEBUG: i64 = 256; + +pub const OUTPUT_NORMAL: i64 = 1; +pub const OUTPUT_RAW: i64 = 2; +pub const OUTPUT_PLAIN: i64 = 4; diff --git a/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs b/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs new file mode 100644 index 0000000..8728fa6 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs @@ -0,0 +1,24 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::console::output::output_interface::OutputInterface; + +#[derive(Debug)] +pub struct StreamOutput; + +impl StreamOutput { + pub fn new(stream: PhpMixed, verbosity: i64, decorated: Option<bool>) -> Self { + todo!() + } +} + +impl OutputInterface for StreamOutput { + fn write(&mut self, _messages: &str, _newline: bool, _type: i64) { todo!() } + fn writeln(&mut self, _messages: &str, _type: i64) { todo!() } + fn set_verbosity(&mut self, _level: i64) { todo!() } + fn get_verbosity(&self) -> i64 { todo!() } + fn is_quiet(&self) -> bool { todo!() } + fn is_verbose(&self) -> bool { todo!() } + fn is_very_verbose(&self) -> bool { todo!() } + fn is_debug(&self) -> bool { todo!() } + fn set_decorated(&mut self, _decorated: bool) { todo!() } + fn is_decorated(&self) -> bool { todo!() } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/question/mod.rs b/crates/shirabe-external-packages/src/symfony/console/question/mod.rs new file mode 100644 index 0000000..b44264d --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/question/mod.rs @@ -0,0 +1 @@ +pub mod question; diff --git a/crates/shirabe-external-packages/src/symfony/console/question/question.rs b/crates/shirabe-external-packages/src/symfony/console/question/question.rs new file mode 100644 index 0000000..2fc7368 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/question/question.rs @@ -0,0 +1,34 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct Question; + +impl Question { + pub fn new(question: &str, default: Option<PhpMixed>) -> Self { + todo!() + } + + pub fn set_validator(&mut self, validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>) { + todo!() + } + + pub fn set_max_attempts(&mut self, attempts: Option<i64>) { + todo!() + } + + pub fn set_hidden(&mut self, hidden: bool) { + todo!() + } + + pub fn get_question(&self) -> String { + todo!() + } + + pub fn get_default(&self) -> Option<PhpMixed> { + todo!() + } + + pub fn is_hidden(&self) -> bool { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/console/style/mod.rs b/crates/shirabe-external-packages/src/symfony/console/style/mod.rs new file mode 100644 index 0000000..e5c930f --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/style/mod.rs @@ -0,0 +1 @@ +pub mod symfony_style; diff --git a/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs new file mode 100644 index 0000000..288a79d --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs @@ -0,0 +1,96 @@ +use shirabe_php_shim::PhpMixed; +use crate::symfony::console::output::output_interface::OutputInterface; +use crate::symfony::console::input::input_interface::InputInterface; + +#[derive(Debug)] +pub struct SymfonyStyle; + +impl SymfonyStyle { + pub fn new(input: &dyn InputInterface, output: &dyn OutputInterface) -> Self { + todo!() + } + + pub fn title(&mut self, message: &str) { + todo!() + } + + pub fn section(&mut self, message: &str) { + todo!() + } + + pub fn text(&mut self, message: &str) { + todo!() + } + + pub fn comment(&mut self, message: &str) { + todo!() + } + + pub fn success(&mut self, message: PhpMixed) { + todo!() + } + + pub fn error(&mut self, message: PhpMixed) { + todo!() + } + + pub fn warning(&mut self, message: PhpMixed) { + todo!() + } + + pub fn note(&mut self, message: PhpMixed) { + todo!() + } + + pub fn listing(&mut self, elements: &[String]) { + todo!() + } + + pub fn new_line(&mut self, count: i64) { + todo!() + } + + pub fn ask(&mut self, question: &str, default: Option<&str>, validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>) -> PhpMixed { + todo!() + } + + pub fn ask_hidden(&mut self, question: &str, validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>) -> PhpMixed { + todo!() + } + + pub fn confirm(&mut self, question: &str, default: bool) -> bool { + todo!() + } + + pub fn choice(&mut self, question: &str, choices: Vec<PhpMixed>, default: Option<PhpMixed>) -> PhpMixed { + todo!() + } + + pub fn table(&mut self, headers: Vec<PhpMixed>, rows: Vec<PhpMixed>) { + todo!() + } + + pub fn progress_start(&mut self, max: i64) { + todo!() + } + + pub fn progress_advance(&mut self, step: i64) { + todo!() + } + + pub fn progress_finish(&mut self) { + todo!() + } + + pub fn is_debug(&self) -> bool { + todo!() + } + + pub fn writeln(&mut self, messages: PhpMixed, r#type: i64) { + todo!() + } + + pub fn write(&mut self, messages: PhpMixed, newline: bool, r#type: i64) { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/mod.rs b/crates/shirabe-external-packages/src/symfony/mod.rs new file mode 100644 index 0000000..0abb8fc --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/mod.rs @@ -0,0 +1,3 @@ +pub mod component; +pub mod console; +pub mod process; diff --git a/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs new file mode 100644 index 0000000..9aa5a8b --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs @@ -0,0 +1,16 @@ +#[derive(Debug)] +pub struct ExecutableFinder; + +impl ExecutableFinder { + pub fn new() -> Self { + todo!() + } + + pub fn add_suffix(&mut self, suffix: &str) { + todo!() + } + + pub fn find(&self, name: &str, default: Option<&str>, dirs: &[String]) -> Option<String> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/symfony/process/mod.rs b/crates/shirabe-external-packages/src/symfony/process/mod.rs new file mode 100644 index 0000000..0e705e3 --- /dev/null +++ b/crates/shirabe-external-packages/src/symfony/process/mod.rs @@ -0,0 +1 @@ +pub mod executable_finder; diff --git a/crates/shirabe/Cargo.toml b/crates/shirabe/Cargo.toml index 6117540..b41c839 100644 --- a/crates/shirabe/Cargo.toml +++ b/crates/shirabe/Cargo.toml @@ -4,7 +4,9 @@ version.workspace = true edition.workspace = true [dependencies] +shirabe-external-packages.workspace = true shirabe-php-shim.workspace = true +shirabe-semver.workspace = true anyhow.workspace = true base64.workspace = true chrono.workspace = true |
