Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Psalm job #755

Merged
merged 2 commits into from
Jan 6, 2023
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
2 changes: 1 addition & 1 deletion Loader/SymfonyFixturesLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private function addGroupsFixtureMapping(string $className, array $groups)
}

/**
* @param string[] $fixtures An array of fixtures with class names as keys
* @param array<class-string<FixtureInterface>, FixtureInterface> $fixtures An array of fixtures with class names as keys
*/
private function validateDependencies(array $fixtures, FixtureInterface $fixture)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\ODM\MongoDB\Repository\DocumentRepository;

/** @template-extends DocumentRepository<object> */
class TestCustomClassRepoRepository extends DocumentRepository
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\Bundle\MongoDBBundle\Repository\ServiceDocumentRepository;
use Doctrine\Bundle\MongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\RepositoryServiceBundle\Document\TestCustomServiceRepoDocument;

/** @template-extends ServiceDocumentRepository<TestCustomServiceRepoDocument> */
class TestCustomServiceRepoDocumentRepository extends ServiceDocumentRepository
{
public function __construct(ManagerRegistry $registry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\Bundle\MongoDBBundle\Repository\ServiceDocumentRepository;
use Doctrine\Bundle\MongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\RepositoryServiceBundle\Document\TestCustomServiceRepoFile;

/** @template-extends ServiceDocumentRepository<TestCustomServiceRepoFile> */
class TestCustomServiceRepoGridFSRepository extends ServiceDocumentRepository
{
public function __construct(ManagerRegistry $registry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\Bundle\MongoDBBundle\Repository\ServiceDocumentRepository;
use Doctrine\Bundle\MongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\RepositoryServiceBundle\Document\TestUnmappedDocument;

/** @template-extends ServiceDocumentRepository<TestUnmappedDocument> */
class TestUnmappedDocumentRepository extends ServiceDocumentRepository
{
public function __construct(ManagerRegistry $registry)
Expand Down
2 changes: 2 additions & 0 deletions Tests/Fixtures/Cache/Collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ class Collections
public $another;
}

/** @template-extends ArrayCollection<array-key, mixed> */
class SomeCollection extends ArrayCollection
{
}

/** @template-extends ArrayCollection<array-key, mixed> */
class AnotherCollection extends ArrayCollection
{
}
1 change: 1 addition & 0 deletions Tests/Fixtures/Repository/CustomGridFSRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\ODM\MongoDB\Repository\DocumentRepository;

/** @template-extends DocumentRepository<object> */
final class CustomGridFSRepository extends DocumentRepository
{
}
1 change: 1 addition & 0 deletions Tests/Fixtures/Repository/CustomRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Doctrine\ODM\MongoDB\Repository\DocumentRepository;

/** @template-extends DocumentRepository<object> */
final class CustomRepository extends DocumentRepository
{
}
2 changes: 2 additions & 0 deletions Tests/Repository/ContainerRepositoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,12 @@ private function createDocumentManager(array $documentRepositoryClasses)
}
}

/** @template-extends DocumentRepository<object> */
class StubRepository extends DocumentRepository
{
}

/** @template-extends DocumentRepository<object> */
class StubServiceRepository extends DocumentRepository implements ServiceDocumentRepositoryInterface
{
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"symfony/stopwatch": "^4.4|^5.3|^6.0",
"symfony/validator": "^4.4|^5.3|^6.0",
"symfony/yaml": "^4.3.3|^5.3|^6.0",
"vimeo/psalm": "^4.8"
"vimeo/psalm": "^4.30"
},
"suggest": {
"doctrine/data-fixtures": "Load data fixtures"
Expand Down
8 changes: 8 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.30.0@d0bc6e25d89f649e4f36a534f330f8bb4643dd69">
<file src="Command/LoadDataFixturesDoctrineODMCommand.php">
<UndefinedInterfaceMethod occurrences="1">
<code>ask</code>
</UndefinedInterfaceMethod>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<plugins>
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin"/>
Expand Down