Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/build/
/composer.lock
/composer.phar
/phpstan.neon
/phpunit.xml
/swagger.json
/swagger.yaml
Expand Down
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ return PhpCsFixer\Config::create()
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => true,
],
'phpdoc_no_alias_tag' => false, // Set the rule to true when https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5357 is fixed
'phpdoc_order' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_var_annotation_correct_order' => true,
Expand Down
10 changes: 5 additions & 5 deletions src/Util/Inflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
final class Inflector
{
/**
* @var InflectorObject
* @var InflectorObject|null
*/
private static $instance;

Expand All @@ -38,18 +38,18 @@ private static function getInstance(): InflectorObject
}

/**
* @see LegacyInflector::tableize()
* @see InflectorObject::tableize()
*/
public static function tableize(string $word): string
{
return class_exists(InflectorFactory::class) ? self::getInstance()->tableize($word) : LegacyInflector::tableize($word);
Comment thread
meyerbaptiste marked this conversation as resolved.
return class_exists(LegacyInflector::class) ? LegacyInflector::tableize($word) : self::getInstance()->tableize($word);
}

/**
* @see LegacyInflector::pluralize()
* @see InflectorObject::pluralize()
*/
public static function pluralize(string $word): string
{
return class_exists(InflectorFactory::class) ? self::getInstance()->pluralize($word) : LegacyInflector::pluralize($word);
return class_exists(LegacyInflector::class) ? LegacyInflector::pluralize($word) : self::getInstance()->pluralize($word);
}
}
3 changes: 1 addition & 2 deletions tests/Fixtures/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle;
use Doctrine\Common\Inflector\Inflector;
use Doctrine\Inflector\InflectorFactory;
use FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle;
use Nelmio\ApiDocBundle\NelmioApiDocBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
Expand Down Expand Up @@ -54,7 +53,7 @@ public function __construct(string $environment, bool $debug)

// patch for old versions of Doctrine Inflector, to delete when we'll drop support for v1
// see https://github.com/doctrine/inflector/issues/147#issuecomment-628807276
if (!class_exists(InflectorFactory::class)) {
if (class_exists(Inflector::class)) {
Inflector::rules('plural', ['/taxon/i' => 'taxa']);
}
}
Expand Down