diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-06 21:22:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-06 21:33:05 +0900 |
| commit | 8bd02532cd04ee12d7595029c206f3dc5ab9dd96 (patch) | |
| tree | 5f9897bfefcb9a503d92560311c4d95ee620a025 /crates/shirabe/src/installed_versions.rs | |
| parent | c0b743c8d75813003756a72d2fdd110de8368b5f (diff) | |
| download | php-shirabe-8bd02532cd04ee12d7595029c206f3dc5ab9dd96.tar.gz php-shirabe-8bd02532cd04ee12d7595029c206f3dc5ab9dd96.tar.zst php-shirabe-8bd02532cd04ee12d7595029c206f3dc5ab9dd96.zip | |
chore(shirabe): remove ports of PHP @deprecated APIs
Composer does not use its own deprecated APIs internally, so drop their
Rust ports: whole deprecated classes, methods, constants, and field.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installed_versions.rs')
| -rw-r--r-- | crates/shirabe/src/installed_versions.rs | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/crates/shirabe/src/installed_versions.rs b/crates/shirabe/src/installed_versions.rs index d52deac..90f0c60 100644 --- a/crates/shirabe/src/installed_versions.rs +++ b/crates/shirabe/src/installed_versions.rs @@ -5,9 +5,8 @@ use std::sync::Mutex; use anyhow::Result; use indexmap::IndexMap; use shirabe_php_shim::{ - E_USER_DEPRECATED, OutOfBoundsException, PhpMixed, array_flip, array_keys, array_merge, - call_user_func_array, implode, is_file, method_exists, php_dir, require_php_file, strtr_array, - substr, trigger_error, + OutOfBoundsException, PhpMixed, array_flip, array_keys, array_merge, call_user_func_array, + implode, is_file, method_exists, php_dir, require_php_file, strtr_array, substr, }; use shirabe_semver::version_parser::VersionParser; @@ -393,36 +392,6 @@ impl InstalledVersions { .unwrap_or_default() } - /// Returns the raw installed.php data for custom implementations - /// - /// @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - /// @return array[] - pub fn get_raw_data() -> IndexMap<String, PhpMixed> { - // PHP: @trigger_error(...) - // TODO(phase-b): Silencer::call wraps trigger_error - trigger_error( - "getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.", - E_USER_DEPRECATED, - ); - - let mut installed = INSTALLED.lock().unwrap(); - if installed.is_none() { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if substr(&php_dir(), -8, Some(1)) != "C" { - let required = require_php_file(&format!("{}/installed.php", php_dir())); - *installed = required - .as_array() - .cloned() - .map(|m| m.into_iter().map(|(k, v)| (k, *v)).collect()); - } else { - *installed = Some(IndexMap::new()); - } - } - - installed.clone().unwrap_or_default() - } - /// Returns the raw data of all installed.php which are currently loaded for custom implementations /// /// @return array[] |
