Skip to content

Commit

Permalink
Fixed php 8.1 compatibility (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Dymarchuk authored Apr 4, 2022
1 parent 428eccd commit 2c7a2f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Propel/Generator/Model/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public function addExtraIndices(): void
// MySQL needs indices on any columns that serve as foreign keys.
// These are not auto-created prior to 4.1.2.

$name = substr_replace($foreignKey->getName(), 'fi_', strrpos($foreignKey->getName(), 'fk_'), 3);
$name = substr_replace($foreignKey->getName(), 'fi_', (int)strrpos($foreignKey->getName(), 'fk_'), 3);
if ($this->hasIndex($name)) {
// if we already have an index with this name, then it looks like the columns of this index have just
// been changed, so remove it and inject it again. This is the case if a referenced table is handled
Expand Down

0 comments on commit 2c7a2f7

Please sign in to comment.