Skip to content

Commit 54dd1ee

Browse files
committed
🐛 Fix inflector deprecation
1 parent 152c958 commit 54dd1ee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/DefaultNamingStrategy.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,25 @@
33

44
namespace TheCodingMachine\FluidSchema;
55

6-
use Doctrine\Common\Inflector\Inflector;
76
use Doctrine\DBAL\Platforms\AbstractPlatform;
7+
use Doctrine\Inflector\Inflector;
8+
use Doctrine\Inflector\InflectorFactory;
89

910
class DefaultNamingStrategy implements NamingStrategyInterface
1011
{
1112
/**
1213
* @var AbstractPlatform
1314
*/
1415
private $platform;
16+
/**
17+
* @var Inflector
18+
*/
19+
private $inflector;
1520

1621
public function __construct(AbstractPlatform $platform = null)
1722
{
1823
$this->platform = $platform;
24+
$this->inflector = InflectorFactory::create()->build();
1925
}
2026

2127
/**
@@ -54,7 +60,7 @@ private function toSingular($plural): string
5460

5561
$strs = [];
5662
foreach ($tokens as $token) {
57-
$strs[] = Inflector::singularize($token);
63+
$strs[] = $this->inflector->singularize($token);
5864
}
5965

6066
return implode('_', $strs);

0 commit comments

Comments
 (0)