aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--crates/shirabe-class-map-generator/src/class_map_generator.rs8
-rw-r--r--crates/shirabe-php-shim/src/runtime.rs4
-rw-r--r--crates/shirabe/src/package/version/version_guesser.rs8
3 files changed, 8 insertions, 12 deletions
diff --git a/crates/shirabe-class-map-generator/src/class_map_generator.rs b/crates/shirabe-class-map-generator/src/class_map_generator.rs
index 7262fd8a..0042a0a1 100644
--- a/crates/shirabe-class-map-generator/src/class_map_generator.rs
+++ b/crates/shirabe-class-map-generator/src/class_map_generator.rs
@@ -6,9 +6,9 @@ use crate::php_file_parser::PhpFileParser;
use indexmap::indexmap;
use shirabe_pcre::{CaptureKey, Preg};
use shirabe_php_shim::{
- InvalidArgumentException, LogicException, PATHINFO_EXTENSION, PHP_INT_MAX, RuntimeException,
- explode, getcwd, implode, is_dir, is_file, pathinfo, php_regex, preg_quote, realpath,
- str_replace, str_starts_with, stream_get_wrappers, strlen, strpos, strrpos, strtr, substr,
+ InvalidArgumentException, LogicException, PATHINFO_EXTENSION, RuntimeException, explode,
+ getcwd, implode, is_dir, is_file, pathinfo, php_regex, preg_quote, realpath, str_replace,
+ str_starts_with, stream_get_wrappers, strlen, strpos, strrpos, strtr, substr,
};
use shirabe_symfony_finder::Finder;
use std::path::PathBuf;
@@ -247,7 +247,7 @@ impl ClassMapGenerator {
let real_sub_path = substr(
&real_sub_path_str,
0,
- Some(dot_position.map(|p| p as i64).unwrap_or(PHP_INT_MAX)),
+ Some(dot_position.map(|p| p as i64).unwrap_or(i64::MAX)),
);
for class in classes {
diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs
index 71356427..74ea8350 100644
--- a/crates/shirabe-php-shim/src/runtime.rs
+++ b/crates/shirabe-php-shim/src/runtime.rs
@@ -13,10 +13,6 @@ pub const PHP_WINDOWS_VERSION_MAJOR: i64 = 0;
pub const PHP_WINDOWS_VERSION_MINOR: i64 = 0;
pub const PHP_WINDOWS_VERSION_BUILD: i64 = 0;
-pub const PHP_INT_MAX: i64 = i64::MAX;
-pub const PHP_INT_MIN: i64 = i64::MIN;
-pub const PHP_INT_SIZE: i64 = 8;
-
pub const HHVM_VERSION: Option<&str> = None;
pub const E_ALL: i64 = 32767;
diff --git a/crates/shirabe/src/package/version/version_guesser.rs b/crates/shirabe/src/package/version/version_guesser.rs
index ff7c6b9b..2fde58fb 100644
--- a/crates/shirabe/src/package/version/version_guesser.rs
+++ b/crates/shirabe/src/package/version/version_guesser.rs
@@ -14,9 +14,9 @@ use crate::util::sync_executor;
use indexmap::IndexMap;
use shirabe_pcre::{CaptureKey, Preg};
use shirabe_php_shim::{
- PHP_INT_MAX, PhpMixed, RuntimeException, array_keys, array_map, array_merge, empty,
- function_exists, implode, is_string, json_encode, php_regex, preg_quote, str_replace, strlen,
- strnatcasecmp, strpos, substr, trim, usort,
+ PhpMixed, RuntimeException, array_keys, array_map, array_merge, empty, function_exists,
+ implode, is_string, json_encode, php_regex, preg_quote, str_replace, strlen, strnatcasecmp,
+ strpos, substr, trim, usort,
};
/// Seam over the parts of [`VersionGuesser`] that consumers depend on, so they can be exercised
@@ -507,7 +507,7 @@ impl VersionGuesser {
if !has_branch_alias || has_self_version {
let branch =
Preg::replace(php_regex!(r"{^dev-}"), "", version.as_deref().unwrap_or(""));
- let mut length: i64 = PHP_INT_MAX;
+ let mut length = i64::MAX;
// return directly, if branch is configured to be non-feature branch
if !self.is_feature_branch(package_config, Some(&branch)) {