@@ -14,7 +14,7 @@ export type StartBridgeConfig = {
14
14
localRoot ?: string ;
15
15
16
16
phpInstance ?: PHP ;
17
- getPHPFile ?: ( path : string ) => Promise < string > ;
17
+ getPHPFile ?: ( path : string ) => string | Promise < string > ;
18
18
} ;
19
19
20
20
export async function startBridge ( config : StartBridgeConfig ) {
@@ -58,21 +58,17 @@ export async function startBridge(config: StartBridgeConfig) {
58
58
}
59
59
60
60
const getPHPFile = config . phpInstance
61
- ? ( path : string ) =>
62
- new Promise < string > ( ( ) =>
63
- config . phpInstance ! . readFileAsText ( path )
64
- )
61
+ ? ( path : string ) => config . phpInstance ! . readFileAsText ( path )
65
62
: config . getPHPFile
66
63
? config . getPHPFile
67
- : ( path : string ) =>
68
- new Promise < string > ( ( ) => {
69
- // Default implementation: read from filesystem
70
- // Convert file:/// URLs to local paths
71
- const localPath = path . startsWith ( 'file://' )
72
- ? path . replace ( 'file://' , '' )
73
- : path ;
74
- return readFileSync ( localPath , 'utf-8' ) ;
75
- } ) ;
64
+ : ( path : string ) => {
65
+ // Default implementation: read from filesystem
66
+ // Convert file:/// URLs to local paths
67
+ const localPath = path . startsWith ( 'file://' )
68
+ ? path . replace ( 'file://' , '' )
69
+ : path ;
70
+ return readFileSync ( localPath , 'utf-8' ) ;
71
+ } ;
76
72
77
73
const phpFiles = getPhpFiles ( phpRoot ) ;
78
74
return new XdebugCDPBridge ( dbgpSession , cdpServer , {
0 commit comments