doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.92k stars 2.51k forks source link

Fix psalm errors: remove override of template type #11385

Closed tantegerda1 closed 6 months ago

tantegerda1 commented 6 months ago

See https://github.com/doctrine/collections/issues/368 for the same issue in doctrine/collections which has been fixed there.

The issue happens when using ->contains(). Running psalm emits

InvalidArgument - Argument 1 of Doctrine\ORM\PersistentCollection::contains expects TMaybeContained:fn-doctrine\common\collections\readablecollection::contains as mixed, but … provided.

We should either not define @template TMaybeContained or re-define the psalm docblock from ReadableCollection completely.

derrabus commented 6 months ago

Psalm and PHPCS are failing.

tantegerda1 commented 6 months ago

Updated to address these issues (good that there is a strict CI watching my rookie commits…).

The remaining failing check seems unrelated.

greg0ire commented 6 months ago

Restarted the job, it now passes.

greg0ire commented 6 months ago

Please kindly squash your commits together. If you don't, we'll try to remember to do it for you but it's best if you save us this trouble.

How to do that?

  1. git rebase -i origin/3.1.x, assuming origin is a git remote that points to this repository, and not your fork. If you're not sure what your remotes are, run git remote -vvv, there should be your fork and the holy/reference/base/origin/whatever-you-call-it repository.
  2. A window will show up with many lines, replace pick with fixup on every line but the first one
  3. Close your editor, git should do its magic, and you should end up with one commit
  4. Use git push --force to overwrite what you already push. Don't forget the --force option otherwise git will try to merge both things together.
tantegerda1 commented 6 months ago

Sorry. I started from the wrong branch. Failed to see #11208 How to choose the right branch.