From 561924db750cbb4e4c183f9616472ed9a5b0fc7f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 12 Aug 2026 00:19:10 +0900 Subject: docs(todo): retag TODO markers by root cause Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-php-shim/src/fs.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/shirabe-php-shim/src/fs.rs') diff --git a/crates/shirabe-php-shim/src/fs.rs b/crates/shirabe-php-shim/src/fs.rs index 6aa8eeee..c5a4bdf5 100644 --- a/crates/shirabe-php-shim/src/fs.rs +++ b/crates/shirabe-php-shim/src/fs.rs @@ -385,7 +385,7 @@ pub fn fwrite(stream: &PhpResource, data: impl AsRef<[u8]>, length: Option) } /// PHP `fread()`. Reads up to `length` bytes. -/// TODO(phase-e): byte-string semantics — should return Vec; from_utf8_lossy can corrupt +/// TODO(bytes): byte-string semantics — should return Vec; from_utf8_lossy can corrupt /// binary reads (filesAreEqual / binary copy). pub fn fread(stream: &PhpResource, length: i64) -> Option { let cap = length.max(0) as usize; @@ -449,7 +449,7 @@ pub fn fclose(stream: &PhpResource) -> bool { /// PHP `fgets()`. Reads one line, including the trailing newline, capped at `length-1` bytes /// when given (matching PHP's `length` parameter). -/// TODO(phase-e): byte-string semantics — should return Vec; from_utf8_lossy can corrupt +/// TODO(bytes): byte-string semantics — should return Vec; from_utf8_lossy can corrupt /// binary reads. pub fn fgets(stream: &PhpResource, length: Option) -> Option { let limit = match length { @@ -507,7 +507,7 @@ fn fgets_read_line( } /// PHP `fgetc()`: reads a single byte, or `None` at end-of-stream. -/// TODO(phase-e): byte-string semantics — should return Vec. +/// TODO(bytes): byte-string semantics — should return Vec. pub fn fgetc(stream: &PhpResource) -> Option { let mut byte = [0u8; 1]; match stream { @@ -793,7 +793,7 @@ pub fn chmod(path: impl AsRef, mode: u32) -> bool { pub fn fileperms(path: impl AsRef) -> Result { use std::os::unix::fs::MetadataExt; - // TODO(phase-e): PHP returns the full st_mode (file type bits included). + // TODO(php-semantics): PHP returns the full st_mode (file type bits included). std::fs::metadata(path.as_ref()).map(|m| m.mode()) } @@ -843,7 +843,7 @@ pub fn is_dir(path: impl AsRef) -> bool { /// PHP `readlink()`: the target the link points at, without resolving it further. /// `None` is PHP's `false`-on-failure. -/// TODO(phase-e): byte-string semantics -- PHP returns the raw bytes of the link target. +/// TODO(bytes): byte-string semantics -- PHP returns the raw bytes of the link target. pub fn readlink(path: impl AsRef) -> Option { std::fs::read_link(path) .ok() @@ -880,7 +880,7 @@ pub fn file_put_contents(path: &str, data: &[u8]) -> Option { } pub fn file_put_contents3(filename: &str, data: &str, flags: i64) -> Option { - // TODO(phase-c): the LOCK_EX and FILE_USE_INCLUDE_PATH flags are ignored; only FILE_APPEND is + // TODO(php-semantics): the LOCK_EX and FILE_USE_INCLUDE_PATH flags are ignored; only FILE_APPEND is // honored. let append = flags & FILE_APPEND != 0; let mut opts = std::fs::OpenOptions::new(); @@ -914,7 +914,7 @@ pub fn file_get_contents5( offset: i64, length: Option, ) -> Option { - // TODO(phase-c): the stream $context and FILE_USE_INCLUDE_PATH are ignored; only $offset and + // TODO(php-semantics): the stream $context and FILE_USE_INCLUDE_PATH are ignored; only $offset and // $length are applied (to the file read from the local filesystem). // PHP supports the file:// stream wrapper; strip it to read the local file. let path = path.strip_prefix("file://").unwrap_or(path); @@ -1060,7 +1060,7 @@ pub fn sys_get_temp_dir() -> String { // A directory-handle resource. This is a distinct resource kind from the byte streams modeled by // PhpResource; readdir/closedir have no callers yet, so it only records the opened path. -// TODO(phase-c): give it real readdir/closedir behavior (cursor over the entries) when needed. +// TODO(php-semantics): give it real readdir/closedir behavior (cursor over the entries) when needed. #[derive(Debug)] pub struct PhpDirHandle { pub path: std::path::PathBuf, @@ -1097,7 +1097,7 @@ pub fn pathinfo(path: &str, option: i64) -> String { } } -// TODO(phase-c): returns Option +// TODO(type-model): returns Option pub fn realpath(path: impl AsRef) -> Option { path.as_ref() .canonicalize() -- cgit v1.3.1-4-g156e