diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-28 17:45:26 +0900 |
| commit | 53f1fb395f33e0fb8db9aebd09ea9082f650f9f1 (patch) | |
| tree | f9e8bf0e9d4b1e98cce383574fb6a13b684fff08 /crates/shirabe-external-packages/src/symfony/process/pipes/abstract_pipes.rs | |
| parent | 212f5cd75b1403ee75ffa44d7ebdb181174340c0 (diff) | |
| download | php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.gz php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.tar.zst php-shirabe-53f1fb395f33e0fb8db9aebd09ea9082f650f9f1.zip | |
refactor: add linter
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/process/pipes/abstract_pipes.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/process/pipes/abstract_pipes.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/process/pipes/abstract_pipes.rs b/crates/shirabe-external-packages/src/symfony/process/pipes/abstract_pipes.rs index 43a6567..f9fb251 100644 --- a/crates/shirabe-external-packages/src/symfony/process/pipes/abstract_pipes.rs +++ b/crates/shirabe-external-packages/src/symfony/process/pipes/abstract_pipes.rs @@ -1,7 +1,7 @@ //! ref: composer/vendor/symfony/process/Pipes/AbstractPipes.php use indexmap::IndexMap; -use shirabe_php_shim::{self as php, PhpMixed, PhpResource}; +use shirabe_php_shim::{PhpMixed, PhpResource}; #[derive(Debug)] pub struct AbstractPipes { @@ -38,7 +38,7 @@ impl AbstractPipes { pub fn close(&mut self) { for (_, pipe) in &self.pipes { - php::fclose(pipe); + shirabe_php_shim::fclose(pipe); } self.pipes = IndexMap::new(); } @@ -60,7 +60,7 @@ impl AbstractPipes { } for (_, pipe) in &self.pipes { - php::stream_set_blocking(pipe, false); + shirabe_php_shim::stream_set_blocking(pipe, false); } // The `is_resource($this->input)` branch does not apply: `input` is never a resource in this // port (is_resource on a PhpMixed is always false). @@ -81,10 +81,11 @@ impl AbstractPipes { let mut w: Vec<PhpResource> = vec![stdin.clone()]; // let's have a look if something changed in streams - php::stream_select(&mut r, &mut w, &mut e, 0, Some(0))?; + shirabe_php_shim::stream_select(&mut r, &mut w, &mut e, 0, Some(0))?; if !self.input_buffer.is_empty() { - let written = php::fwrite(&stdin, &self.input_buffer, None).unwrap_or(0) as usize; + let written = + shirabe_php_shim::fwrite(&stdin, &self.input_buffer, None).unwrap_or(0) as usize; self.input_buffer = self.input_buffer.get(written..).unwrap_or("").to_string(); if !self.input_buffer.is_empty() { return Some(vec![stdin]); @@ -92,9 +93,9 @@ impl AbstractPipes { } // no input to read on resource, buffer is empty - if self.input_buffer.is_empty() && !php::php_truthy(&self.input) { + if self.input_buffer.is_empty() && !shirabe_php_shim::php_truthy(&self.input) { self.input = PhpMixed::Null; - php::fclose(&stdin); + shirabe_php_shim::fclose(&stdin); self.pipes.shift_remove(&0); } |
