1717#[IsReadOnly]
1818class ApplicationInfo extends Tool
1919{
20- public function __construct (protected Roster $ roster ) {}
20+ public function __construct (protected Roster $ roster )
21+ {
22+ }
2123
2224 public function description (): string
2325 {
@@ -30,15 +32,15 @@ public function schema(ToolInputSchema $schema): ToolInputSchema
3032 }
3133
3234 /**
33- * @param array<string> $arguments
35+ * @param array<string> $arguments
3436 */
3537 public function handle (array $ arguments ): ToolResult
3638 {
3739 return ToolResult::json ([
3840 'php_version ' => PHP_VERSION ,
3941 'laravel_version ' => app ()->version (),
4042 'database_engine ' => config ('database.default ' ),
41- 'packages ' => $ this ->roster ->packages ()->map (fn (Package $ package ) => ['name ' => $ package ->name (), 'version ' => $ package ->version ()]),
43+ 'packages ' => $ this ->roster ->packages ()->map (fn (Package $ package ) => ['roster_name ' => $ package ->name (), 'version ' => $ package ->version (), ' package_name ' => $ package -> rawName ()]),
4244 'models ' => $ this ->discoverModels (),
4345 ]);
4446 }
@@ -53,8 +55,8 @@ private function discoverModels(): array
5355 $ models = [];
5456 $ appPath = app_path ();
5557
56- if (! is_dir ($ appPath )) {
57- return ['app-path-isnt-a-directory: ' . $ appPath ];
58+ if (!is_dir ($ appPath )) {
59+ return ['app-path-isnt-a-directory: ' . $ appPath ];
5860 }
5961
6062 $ finder = Finder::create ()
@@ -65,17 +67,17 @@ private function discoverModels(): array
6567 foreach ($ finder as $ file ) {
6668 $ relativePath = $ file ->getRelativePathname ();
6769 $ namespace = app ()->getNamespace ();
68- $ className = $ namespace. str_replace (
69- ['/ ' , '.php ' ],
70- ['\\' , '' ],
71- $ relativePath
72- );
70+ $ className = $ namespace . str_replace (
71+ ['/ ' , '.php ' ],
72+ ['\\' , '' ],
73+ $ relativePath
74+ );
7375
7476 try {
7577 if (class_exists ($ className )) {
7678 $ reflection = new ReflectionClass ($ className );
77- if ($ reflection ->isSubclassOf (Model::class) && ! $ reflection ->isAbstract ()) {
78- $ models [$ className ] = $ appPath. DIRECTORY_SEPARATOR . $ relativePath ;
79+ if ($ reflection ->isSubclassOf (Model::class) && !$ reflection ->isAbstract ()) {
80+ $ models [$ className ] = $ appPath . DIRECTORY_SEPARATOR . $ relativePath ;
7981 }
8082 }
8183 } catch (\Throwable ) {
0 commit comments