Skip to content

Commit fb79c93

Browse files
authored
Merge pull request #1453 from greg0ire/fix-build
Assert there is no failure
2 parents a0eb4e1 + edec5c5 commit fb79c93

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Generator/Generator.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Doctrine\Migrations\Tools\Console\Helper\MigrationDirectoryHelper;
1010
use InvalidArgumentException;
1111

12+
use function assert;
1213
use function explode;
1314
use function file_get_contents;
1415
use function file_put_contents;
@@ -74,11 +75,14 @@ public function generateMigration(
7475
string|null $up = null,
7576
string|null $down = null,
7677
): string {
77-
$mch = [];
78-
if (preg_match('~(.*)\\\\([^\\\\]+)~', $fqcn, $mch) === 0) {
78+
$mch = [];
79+
$matchResult = preg_match('~(.*)\\\\([^\\\\]+)~', $fqcn, $mch);
80+
if ($matchResult === 0) {
7981
throw new InvalidArgumentException(sprintf('Invalid FQCN'));
8082
}
8183

84+
assert($matchResult !== false);
85+
8286
[$fqcn, $namespace, $className] = $mch;
8387

8488
$dirs = $this->configuration->getMigrationDirectories();

0 commit comments

Comments
 (0)