88use Tempest \Core \DiscoveryException ;
99use Tempest \Core \DiscoveryLocation ;
1010use Tempest \Core \Kernel ;
11- use Tempest \Support \ PathHelper ;
11+ use function Tempest \path ;
1212
1313/** @internal */
1414final readonly class LoadDiscoveryLocations
@@ -35,8 +35,8 @@ public function __invoke(): void
3535 */
3636 private function discoverCorePackages (): array
3737 {
38- $ composerPath = PathHelper:: make ($ this ->kernel ->root , 'vendor/composer ' );
39- $ installed = $ this ->loadJsonFile (PathHelper:: make ($ composerPath , 'installed.json ' ));
38+ $ composerPath = path ($ this ->kernel ->root , 'vendor/composer ' );
39+ $ installed = $ this ->loadJsonFile (path ($ composerPath , 'installed.json ' )-> toString ( ));
4040 $ packages = $ installed ['packages ' ] ?? [];
4141
4242 $ discoveredLocations = [];
@@ -49,12 +49,12 @@ private function discoverCorePackages(): array
4949 continue ;
5050 }
5151
52- $ packagePath = PathHelper:: make ($ composerPath , $ package ['install-path ' ] ?? '' );
52+ $ packagePath = path ($ composerPath , $ package ['install-path ' ] ?? '' );
5353
5454 foreach ($ package ['autoload ' ]['psr-4 ' ] as $ namespace => $ namespacePath ) {
55- $ namespacePath = PathHelper:: make ($ packagePath , $ namespacePath );
55+ $ namespacePath = path ($ packagePath , $ namespacePath );
5656
57- $ discoveredLocations [] = new DiscoveryLocation ($ namespace , $ namespacePath );
57+ $ discoveredLocations [] = new DiscoveryLocation ($ namespace , $ namespacePath-> toString () );
5858 }
5959 }
6060
@@ -69,9 +69,9 @@ private function discoverAppNamespaces(): array
6969 $ discoveredLocations = [];
7070
7171 foreach ($ this ->composer ->namespaces as $ namespace ) {
72- $ path = PathHelper:: make ($ this ->kernel ->root , $ namespace ->path );
72+ $ path = path ($ this ->kernel ->root , $ namespace ->path );
7373
74- $ discoveredLocations [] = new DiscoveryLocation ($ namespace ->namespace , $ path );
74+ $ discoveredLocations [] = new DiscoveryLocation ($ namespace ->namespace , $ path-> toString () );
7575 }
7676
7777 return $ discoveredLocations ;
@@ -82,8 +82,8 @@ private function discoverAppNamespaces(): array
8282 */
8383 private function discoverVendorPackages (): array
8484 {
85- $ composerPath = PathHelper:: make ($ this ->kernel ->root , 'vendor/composer ' );
86- $ installed = $ this ->loadJsonFile (PathHelper:: make ($ composerPath , 'installed.json ' ));
85+ $ composerPath = path ($ this ->kernel ->root , 'vendor/composer ' );
86+ $ installed = $ this ->loadJsonFile (path ($ composerPath , 'installed.json ' )-> toString ( ));
8787 $ packages = $ installed ['packages ' ] ?? [];
8888
8989 $ discoveredLocations = [];
@@ -96,7 +96,7 @@ private function discoverVendorPackages(): array
9696 continue ;
9797 }
9898
99- $ packagePath = PathHelper:: make ($ composerPath , $ package ['install-path ' ] ?? '' );
99+ $ packagePath = path ($ composerPath , $ package ['install-path ' ] ?? '' );
100100 $ requiresTempest = isset ($ package ['require ' ]['tempest/framework ' ]) || isset ($ package ['require ' ]['tempest/core ' ]);
101101 $ hasPsr4Namespaces = isset ($ package ['autoload ' ]['psr-4 ' ]);
102102
@@ -105,9 +105,9 @@ private function discoverVendorPackages(): array
105105 }
106106
107107 foreach ($ package ['autoload ' ]['psr-4 ' ] as $ namespace => $ namespacePath ) {
108- $ path = PathHelper:: make ($ packagePath , $ namespacePath );
108+ $ path = path ($ packagePath , $ namespacePath );
109109
110- $ discoveredLocations [] = new DiscoveryLocation ($ namespace , $ path );
110+ $ discoveredLocations [] = new DiscoveryLocation ($ namespace , $ path-> toString () );
111111 }
112112 }
113113
0 commit comments