Skip to content

Commit

Permalink
Php8.4 support - Reverting method changes
Browse files Browse the repository at this point in the history
Signed-off-by: Atul-glo35265 <[email protected]>
  • Loading branch information
Atul-glo35265 committed Nov 13, 2024
1 parent 09582ec commit 5d3dfe2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
14 changes: 3 additions & 11 deletions src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,19 +625,11 @@ public function toXml()
}

/**
* Handle WSDL document
*
* @param string|null|callable $responseHandler
* @return void
* Handle WSDL document.
*/
public function handle($responseHandler = null)
public function handle()
{
if (is_callable($responseHandler)) {
$responseHandler('Content-Type: text/xml');
} else {
header($responseHandler ?? 'Content-Type: text/xml');
}

header('Content-Type: text/xml');
echo $this->toXml();
}
}
9 changes: 5 additions & 4 deletions test/AutoDiscoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1453,16 +1453,17 @@ public function testRecursiveWsdlDependencies()
$this->documentNodesTest();
}

/**
* @runInSeparateProcess
*/
public function testHandle()
{
$scriptUri = 'http://localhost/MyService.php';

$this->server->setClass(Test::class);

ob_start();

$this->server->handle(function (?string $header) {
$this->assertEquals('Content-Type: text/xml', $header);
});
$this->server->handle();

$actualWsdl = ob_get_clean();

Expand Down

0 comments on commit 5d3dfe2

Please sign in to comment.