File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -493,14 +493,14 @@ public function stream_lock(int $operation): bool
493493 * 
494494 * @codeCoverageIgnore 
495495 * 
496-  * @param int $option one of STREAM_OPTION_BLOCKING, STREAM_OPTION_READ_TIMEOUT, STREAM_OPTION_WRITE_BUFFER 
497-  * @param int $arg1 depending on option 
498-  * @param int $arg2 depending on option 
496+  * @param int   $option one of STREAM_OPTION_BLOCKING, STREAM_OPTION_READ_TIMEOUT, STREAM_OPTION_WRITE_BUFFER 
497+  * @param int   $arg1 depending on option 
498+  * @param int|null  $arg2 depending on option 
499499 * 
500500 * @return bool Returns TRUE on success or FALSE on failure. If option is not implemented, 
501501 * FALSE should be returned. 
502502 */ 
503-  public  function  stream_set_option (int  $ optionint  $ arg1int  $ arg2bool 
503+  public  function  stream_set_option (int  $ optionint  $ arg1? int  $ arg2 =  null ): bool 
504504 {
505505 if  (false  === $ this resource ) {
506506 return  false ;
Original file line number Diff line number Diff line change @@ -27,6 +27,24 @@ public function testFlockWithFilePutContents(): void
2727 $ this assertEquals (\strlen ($ testData$ res
2828 }
2929
30+  public  function  testSetStreamOptions (): void 
31+  {
32+  $ processornew  StreamProcessor ();
33+  $ processorintercept ();
34+ 
35+  $ handlefopen ('tests/fixtures/file_put_contents ' , 'w ' );
36+ 
37+  self ::assertTrue (stream_set_blocking ($ handletrue ));
38+  self ::assertFalse (stream_set_timeout ($ handle10 ));
39+  self ::assertFalse (stream_set_timeout ($ handle5 , 2 ));
40+  self ::assertSame (-1 , stream_set_write_buffer ($ handle0 ));
41+  self ::assertSame (0 , stream_set_read_buffer ($ handle0 ));
42+ 
43+  fclose ($ handle
44+ 
45+  $ processorrestore ();
46+  }
47+ 
3048 /** 
3149 * @dataProvider streamOpenAppendFilterProvider 
3250 */ 
                         You can’t perform that action at this time. 
           
                  
0 commit comments