- 在parseNativeMethodCall周围添加try-catch块以捕获PlaceHolder异常 - 当捕获到PlaceHolder异常时返回占位符数组 - 更新测试用例预期输出结果 - 添加新的占位符功能测试用例pull/1/head
parent
6d9c3da0c0
commit
fd48162ab6
3 changed files with 49 additions and 2 deletions
@ -0,0 +1,41 @@ |
||||
--TEST-- |
||||
place-holder |
||||
--FILE-- |
||||
<?php |
||||
class Select { |
||||
public function onReadable($stream, callable $func): void |
||||
{ |
||||
$func($stream); |
||||
} |
||||
} |
||||
class Worker { |
||||
public static ?EventInterface $globalEvent = null; |
||||
protected $mainSocket; |
||||
|
||||
function __construct() { |
||||
$this->mainSocket = 'tcp-stream'; |
||||
} |
||||
|
||||
public function resumeAccept() |
||||
{ |
||||
static::$globalEvent->onReadable($this->mainSocket, $this->acceptUdpConnection(...)); |
||||
} |
||||
|
||||
protected function acceptUdpConnection($stream) |
||||
{ |
||||
var_dump(__METHOD__); |
||||
var_dump($stream); |
||||
} |
||||
} |
||||
|
||||
function main() |
||||
{ |
||||
$obj = new Worker; |
||||
Worker::$globalEvent = new Select; |
||||
$obj->resumeAccept(); |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
string(27) "Worker::acceptUdpConnection" |
||||
string(10) "tcp-stream" |
||||
|
||||
Loading…
Reference in new issue