@@ -14,7 +14,7 @@ export type StartBridgeConfig = {
1414 localRoot ?: string ;
1515
1616 phpInstance ?: PHP ;
17- getPHPFile ?: ( path : string ) => Promise < string > ;
17+ getPHPFile ?: ( path : string ) => string | Promise < string > ;
1818} ;
1919
2020export async function startBridge ( config : StartBridgeConfig ) {
@@ -58,21 +58,17 @@ export async function startBridge(config: StartBridgeConfig) {
5858 }
5959
6060 const getPHPFile = config . phpInstance
61- ? ( path : string ) =>
62- new Promise < string > ( ( ) =>
63- config . phpInstance ! . readFileAsText ( path )
64- )
61+ ? ( path : string ) => config . phpInstance ! . readFileAsText ( path )
6562 : config . getPHPFile
6663 ? 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+ } ;
7672
7773 const phpFiles = getPhpFiles ( phpRoot ) ;
7874 return new XdebugCDPBridge ( dbgpSession , cdpServer , {
0 commit comments