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

Add missing iterable stubs #796

Closed
wants to merge 4 commits into from
Closed

Add missing iterable stubs #796

wants to merge 4 commits into from

Conversation

jdecool
Copy link
Contributor

@jdecool jdecool commented Nov 20, 2021

Some iterable class missing in stubs.

This PR add some of them: FilterIterator, CallbackFilterIterator & RecursiveCallbackFilterIterator.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

New generic classes also need to be added to this array

skipCheckGenericClasses: []
so that we don't start requiring user to specify their type variables everywhere.

@ondrejmirtes
Copy link
Member

The integration tests found this error:

 ------ ----------------------------------------------------------------------- 
  Line   tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php     
 ------ ----------------------------------------------------------------------- 
  29     Property                                                               
         Composer\Test\Package\Archiver\ArchivableFilesFinderTest::$finder      
         type has no value type specified in iterable type                      
         Composer\Package\Archiver\ArchivableFilesFinder.                       
         💡 See:                                                                 
         https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-i  
         terable-type                                                           
 ------ ----------------------------------------------------------------------- 

The ArchivableFilesFinder class extends FilterIterator. It's a concern for me why:

  1. The error hasn't been reported previously (it should be).
  2. It's started to be reported now.

What I suspect that this is some kind of mix up between implicit and explicit mixed which got changed with generics.

Can you please debug this? Thanks.

@jdecool
Copy link
Contributor Author

jdecool commented Nov 22, 2021

Can you please debug this? Thanks.

I didn't leave a comment after my last push to warn you that I was watching this issue.

I'm going to debug it, I'll let you know when I found something.

Thanks.

@ondrejmirtes
Copy link
Member

I'd be happy if the error "type has no value type specified in iterable type" wasn't started to be reported in this situation even after this PR - so this build should continue to be green even for Composer codebase.

@jdecool
Copy link
Contributor Author

jdecool commented Dec 24, 2021

Hi @ondrejmirtes after working a little on this PR, I've to admit that I'm not sure how to fix this issue.

Couldn't we update the integration tests?

@ondrejmirtes
Copy link
Member

One idea - try to rebase on top of dev-master, it might be fixed.

@ondrejmirtes
Copy link
Member

Thank you! I merged it and will deal with the errors on master :)

@jdecool
Copy link
Contributor Author

jdecool commented Feb 8, 2022

Thanks @ondrejmirtes

You make an awesome work with phpstan

@jdecool jdecool deleted the add-missing-iterable-stubs branch February 8, 2022 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants