Skip to content
Open
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
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ parameters:
- tests/data/doctrine_fixtures/TestFixture1.php
- tests/data/doctrine_fixtures/TestFixture2.php
- tests/_support/UnitTester.php
checkMissingIterableValueType: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed the following warning when running phpstan locally:

Note: Using configuration file /var/www/html/phpstan.neon.
⚠️  You're using a deprecated config option checkMissingIterableValueType ⚠️️

It's strongly recommended to remove it from your configuration file
and add the missing array typehints.

If you want to continue ignoring missing typehints from arrays,
add missingType.iterableValue error identifier to your ignoreErrors:

parameters:
        ignoreErrors:
                -
                        identifier: missingType.iterableValue

reportUnmatchedIgnoredErrors: true
ignoreErrors:
- path: tests/
Expand All @@ -21,3 +20,4 @@ parameters:
message: '#Method \S+ has no return type specified#'
- path: tests/
message: '#(?:Method|Property) .+ with generic (?:interface|class) \S+ does not specify its types#'
- identifier: missingType.iterableValue
18 changes: 9 additions & 9 deletions tests/unit/Codeception/Module/Doctrine2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ protected function _setUp()
$connection = DriverManager::getConnection(['driver' => $sqliteDriver, 'memory' => true]);

if (version_compare(InstalledVersions::getVersion('doctrine/orm'), '3', '>=')) {
$this->em = new EntityManager(
$connection,
ORMSetup::createAttributeMetadataConfiguration([$dir], true)
);
$configuration = ORMSetup::createAttributeMetadataConfiguration([$dir], true);
} else {
$this->em = new EntityManager(
$connection,
// @phpstan-ignore-next-line
ORMSetup::createAnnotationMetadataConfiguration([$dir], true)
);
// @phpstan-ignore-next-line
$configuration = ORMSetup::createAnnotationMetadataConfiguration([$dir], true);
}

if (PHP_VERSION_ID >= 80400 && method_exists($configuration, 'enableNativeLazyObjects')) {
$configuration->enableNativeLazyObjects(true);
}

$this->em = new EntityManager($connection, $configuration);

(new SchemaTool($this->em))->createSchema([
$this->em->getClassMetadata(CompositePrimaryKeyEntity::class),
$this->em->getClassMetadata(PlainEntity::class),
Expand Down