Skip to content

Commit

Permalink
Update to psalm 5
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Jan 13, 2023
1 parent 3ceffc6 commit 011084b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
2 changes: 0 additions & 2 deletions CacheWarmer/PersistentCollectionCacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Doctrine\ODM\MongoDB\Configuration;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
use Doctrine\Persistence\ManagerRegistry;
use RuntimeException;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down Expand Up @@ -81,7 +80,6 @@ public function warmUp($cacheDir)
$collectionGenerator = $dm->getConfiguration()->getPersistentCollectionGenerator();
$classes = $dm->getMetadataFactory()->getAllMetadata();
foreach ($classes as $metadata) {
assert($metadata instanceof ClassMetadata);
foreach ($metadata->getAssociationNames() as $fieldName) {
$mapping = $metadata->getFieldMapping($fieldName);
if (empty($mapping['collectionClass']) || in_array($mapping['collectionClass'], $generated)) {
Expand Down
5 changes: 1 addition & 4 deletions Form/Type/DocumentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ public function configureOptions(OptionsResolver $resolver)
* @internal Symfony 2.8 compatibility
*
* @return string
*
* @inheritdoc
*/
#[\ReturnTypeWillChange]
public function getBlockPrefix()
{
return 'document';
Expand All @@ -79,8 +78,6 @@ public function getBlockPrefix()
* @internal Symfony 2.7 compatibility
*
* @return string
*
* @inheritdoc
*/
public function getName()
{
Expand Down
4 changes: 4 additions & 0 deletions Repository/ServiceGridFSRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
* parent::__construct($registry, YourDocument::class);
* }
* }
*
* @template T of object
* @template-extends DefaultGridFSRepository<T>
*/
class ServiceGridFSRepository extends DefaultGridFSRepository implements ServiceDocumentRepositoryInterface
{
/** @use ServiceRepositoryTrait<T> */
use ServiceRepositoryTrait;
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
"doctrine/coding-standard": "^11.0",
"doctrine/data-fixtures": "^1.3",
"phpunit/phpunit": "^8.5.16 || ^9.3",
"psalm/plugin-symfony": "^3.0",
"psalm/plugin-symfony": "^5.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/form": "^4.3.3|^5.0|^6.0",
"symfony/phpunit-bridge": "^6.0",
"symfony/security-bundle": "^4.4|^5.3|^6.0",
"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.30"
"vimeo/psalm": "^5.4"
},
"suggest": {
"doctrine/data-fixtures": "Load data fixtures"
Expand Down
17 changes: 16 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.30.0@d0bc6e25d89f649e4f36a534f330f8bb4643dd69">
<files psalm-version="5.4.0@62db5d4f6a7ae0a20f7cc5a4952d730272fc0863">
<file src="Command/LoadDataFixturesDoctrineODMCommand.php">
<UndefinedInterfaceMethod occurrences="1">
<code>ask</code>
</UndefinedInterfaceMethod>
</file>
<file src="Command/TailCursorDoctrineODMCommand.php">
<InvalidReturnType occurrences="1">
<code>int</code>
</InvalidReturnType>
</file>
<file src="Repository/ContainerRepositoryFactory.php">
<NoValue occurrences="1">
<code>$customRepositoryName</code>
</NoValue>
</file>
<file src="Tests/Form/Type/GuesserTestType.php">
<MissingTemplateParam occurrences="1">
<code>GuesserTestType</code>
</MissingTemplateParam>
</file>
</files>

0 comments on commit 011084b

Please sign in to comment.