Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
donatj committed Nov 28, 2022
1 parent e352979 commit c98bc85
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/MockWebServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function start() : void {
throw new Exceptions\ServerException("Failed to start server. Is something already running on port {$this->port}?");
}

register_shutdown_function(function () {
register_shutdown_function(function() {
if( $this->isRunning() ) {
$this->stop();
}
Expand Down Expand Up @@ -270,18 +270,14 @@ private function findOpenPort() : int {
throw new Exceptions\RuntimeException('Failed to find open port');
}

/**
* @return bool
*/
private function isWindowsPlatform() {
private function isWindowsPlatform() : bool {
return defined('PHP_WINDOWS_VERSION_MAJOR');
}

/**
* @param string $fullCmd
* @return resource
*/
private function startServer( $fullCmd ) {
private function startServer( string $fullCmd ) {
if( !$this->isWindowsPlatform() ) {
// We need to prefix exec to get the correct process http://php.net/manual/ru/function.proc-get-status.php#93382
$fullCmd = 'exec ' . $fullCmd;
Expand Down

0 comments on commit c98bc85

Please sign in to comment.