File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 9
9
use Doctrine \Migrations \Tools \Console \Helper \MigrationDirectoryHelper ;
10
10
use InvalidArgumentException ;
11
11
12
+ use function assert ;
12
13
use function explode ;
13
14
use function file_get_contents ;
14
15
use function file_put_contents ;
@@ -74,11 +75,14 @@ public function generateMigration(
74
75
string |null $ up = null ,
75
76
string |null $ down = null ,
76
77
): string {
77
- $ mch = [];
78
- if (preg_match ('~(.*) \\\\([^ \\\\]+)~ ' , $ fqcn , $ mch ) === 0 ) {
78
+ $ mch = [];
79
+ $ matchResult = preg_match ('~(.*) \\\\([^ \\\\]+)~ ' , $ fqcn , $ mch );
80
+ if ($ matchResult === 0 ) {
79
81
throw new InvalidArgumentException (sprintf ('Invalid FQCN ' ));
80
82
}
81
83
84
+ assert ($ matchResult !== false );
85
+
82
86
[$ fqcn , $ namespace , $ className ] = $ mch ;
83
87
84
88
$ dirs = $ this ->configuration ->getMigrationDirectories ();
You can’t perform that action at this time.
0 commit comments