File tree Expand file tree Collapse file tree 4 files changed +7
-18
lines changed
Expand file tree Collapse file tree 4 files changed +7
-18
lines changed Original file line number Diff line number Diff line change 1616
1717final class BitoCliGenerator extends Generator
1818{
19- /**
20- * @psalm-suppress UnusedClosureParam
21- */
2219 public function generate (string $ prompt ): string
2320 {
2421 return $ this
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ public function mustRunProcess(
7373 /**
7474 * @param array|string|\Symfony\Component\Process\Process $cmd
7575 * @noinspection MissingParameterTypeDeclarationInspection
76+ * @psalm-suppress UndefinedInterfaceMethod
7677 */
7778 public function runProcess (
7879 $ cmd ,
@@ -102,15 +103,4 @@ public function getHelper(string $name): HelperInterface
102103 {
103104 return $ this ->helperSet ->get ($ name );
104105 }
105-
106- public function sanitizeJson (string $ json ): string
107- {
108- return (string ) str ($ json )
109- ->match ('/\{.*\}/s ' )
110- // ->replaceMatches('/[[:cntrl:]]/mu', '')
111- ->replace (
112- ["\\' " , PHP_EOL ],
113- ["' " , '' ]
114- );
115- }
116106}
Original file line number Diff line number Diff line change 1616
1717final class GithubCopilotCliGenerator extends Generator
1818{
19- /**
20- * @psalm-suppress UnusedClosureParam
21- */
2219 public function generate (string $ prompt ): string
2320 {
2421 return resolve (
Original file line number Diff line number Diff line change 1818 * This source file is subject to the MIT license that is bundled.
1919 */
2020
21+ use App \Commands \CommitCommand ;
2122use App \GeneratorManager ;
2223
2324beforeEach (function (): void {
4041 OUTPUT;
4142
4243 expect ($ output )->not ->toBeJson ()
43- ->and ($ this ->generator ->sanitizeJson ($ output ))->toBeJson ();
44+ ->and (
45+ (function (string $ message ): string {
46+ return $ this ->tryFixMessage ($ message );
47+ })->call (app (CommitCommand::class), $ output )
48+ )->toBeJson ();
4449})->group (__DIR__ , __FILE__ );
You can’t perform that action at this time.
0 commit comments