File tree 1 file changed +7
-4
lines changed
src/McpServer/Projects/DTO
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,13 @@ public static function fromArray(?array $data): ?self
31
31
return null ;
32
32
}
33
33
34
+ $ configFile = $ data ['config_file ' ] ?? null ;
35
+ $ envFile = $ data ['env_file ' ] ?? null ;
36
+
34
37
return new self (
35
38
path: (string ) FSPath::create ($ data ['path ' ]),
36
- configFile: (string ) FSPath::create ($ data [ ' config_file ' ] ?? null ) ,
37
- envFile: (string ) FSPath::create ($ data [ ' env_file ' ] ?? null ) ,
39
+ configFile: $ configFile ? (string ) FSPath::create ($ configFile ) : null ,
40
+ envFile: $ envFile ? (string ) FSPath::create ($ envFile ) : null ,
38
41
);
39
42
}
40
43
@@ -79,8 +82,8 @@ public function jsonSerialize(): array
79
82
{
80
83
return [
81
84
'path ' => (string ) FSPath::create ($ this ->path ),
82
- 'config_file ' => (string ) FSPath::create ($ this ->configFile ),
83
- 'env_file ' => (string ) FSPath::create ($ this ->envFile ),
85
+ 'config_file ' => $ this -> configFile ? (string ) FSPath::create ($ this ->configFile ) : null ,
86
+ 'env_file ' => $ this -> envFile ? (string ) FSPath::create ($ this ->envFile ) : null ,
84
87
];
85
88
}
86
89
}
You can’t perform that action at this time.
0 commit comments