aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 09:34:34 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 09:34:34 +0900
commitdfd98ce4b227a3a14dc913c669bee4f077a65178 (patch)
treedef0558566319a18ffbcdc4eb4e5175e3c6c9bb0 /crates/shirabe-external-packages/src/symfony
parentd2a28f8c07b0aa713be338005c6153011d70f24b (diff)
downloadphp-shirabe-dfd98ce4b227a3a14dc913c669bee4f077a65178.tar.gz
php-shirabe-dfd98ce4b227a3a14dc913c669bee4f077a65178.tar.zst
php-shirabe-dfd98ce4b227a3a14dc913c669bee4f077a65178.zip
refactor(php-shim): make the fs mutators return Result
mkdir, rmdir, unlink and symlink each had a bool version and a _result twin returning the io::Error, which left two names for one call. Keep only the Result form and let the callers that want a boolean spell out .is_ok(). Call sites that discard the outcome, as their PHP originals do, are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony')
-rw-r--r--crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs b/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs
index 450c7191..a0142ce6 100644
--- a/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs
+++ b/crates/shirabe-external-packages/src/symfony/filesystem/filesystem.rs
@@ -146,7 +146,7 @@ impl Filesystem {
continue;
}
- if let Err(last_error) = shirabe_php_shim::mkdir_result(&dir, mode, true)
+ if let Err(last_error) = shirabe_php_shim::mkdir(&dir, mode, true)
&& !shirabe_php_shim::is_dir(&dir)
{
return Err(IOException::new(
@@ -202,11 +202,11 @@ impl Filesystem {
for file in files {
if shirabe_php_shim::is_link(&file) {
// See https://bugs.php.net/52176
- let unlinked = shirabe_php_shim::unlink_result(&file);
+ let unlinked = shirabe_php_shim::unlink(&file);
let mut last_error = unlinked.as_ref().err().map(ToString::to_string);
let mut removed = unlinked.is_ok() || !cfg!(windows);
if !removed {
- match shirabe_php_shim::rmdir_result(&file) {
+ match shirabe_php_shim::rmdir(&file) {
Ok(()) => {
last_error = None;
removed = true;
@@ -251,7 +251,7 @@ impl Filesystem {
(&entries).into_iter().map(|e| e.get_pathname()).collect();
Self::do_remove(child_paths, true)?;
- if let Err(last_error) = shirabe_php_shim::rmdir_result(&file)
+ if let Err(last_error) = shirabe_php_shim::rmdir(&file)
&& shirabe_php_shim::file_exists(&file)
{
return Err(IOException::new(
@@ -262,7 +262,7 @@ impl Filesystem {
)
.into());
}
- } else if let Err(last_error) = shirabe_php_shim::unlink_result(&file) {
+ } else if let Err(last_error) = shirabe_php_shim::unlink(&file) {
let last_error = last_error.to_string();
if last_error.contains("Permission denied") || shirabe_php_shim::file_exists(&file)
{
@@ -309,7 +309,7 @@ impl Filesystem {
self.remove(PhpMixed::String(target_dir.clone()))?;
}
- if let Err(last_error) = shirabe_php_shim::symlink_result(&origin_dir, &target_dir) {
+ if let Err(last_error) = shirabe_php_shim::symlink(&origin_dir, &target_dir) {
return Self::link_exception(
&origin_dir,
&target_dir,