1212 */
1313final class Playground
1414{
15- private const DEFAULT_SCHEME = 'http ' ;
15+ private const string DEFAULT_SCHEME = 'http ' ;
1616
17- private const DEFAULT_HOST = 'localhost ' ;
17+ private const string DEFAULT_HOST = 'localhost ' ;
1818
19- private const DEFAULT_PORT = 9357 ;
19+ private const int DEFAULT_PORT = 9357 ;
2020
2121 /**
2222 * Playground instance.
@@ -26,15 +26,15 @@ final class Playground
2626 /**
2727 * Artisan serve process.
2828 */
29- private Process $ process ;
29+ private readonly Process $ process ;
3030
3131 /**
3232 * Constructs new instance and starts Artisan serve process.
3333 */
3434 private function __construct (
35- private string $ scheme ,
36- private string $ host ,
37- private int $ port
35+ private readonly string $ scheme ,
36+ private readonly string $ host ,
37+ private readonly int $ port
3838 ) {
3939 $ this ->shutdownIdleProcesses ();
4040
@@ -56,7 +56,7 @@ public function __destruct()
5656 */
5757 public static function start (): self
5858 {
59- if (self ::$ instance === null ) {
59+ if (! self ::$ instance instanceof self ) {
6060 self ::$ instance = new self (
6161 Arr::get ($ _ENV , 'PEST_BROWSER_PLUGIN_PLAYGROUND_SCHEME ' , self ::DEFAULT_SCHEME ), // @phpstan-ignore-line
6262 Arr::get ($ _ENV , 'PEST_BROWSER_PLUGIN_PLAYGROUND_HOST ' , self ::DEFAULT_HOST ), // @phpstan-ignore-line
0 commit comments