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 generics templates #4

Merged

Conversation

bendavies
Copy link
Contributor

@bendavies bendavies commented Sep 27, 2023

This PR fixes the templates for MicroMapperInterface and MapperInterface.
regression tests have been added.

as an aside, is the $toClass param in MapperInterface::load(...) redundant?
It seems we will only ever have concrete implementations here and will just new up a new class, which will match the class provided in the AsMapper attribute.

@bendavies bendavies changed the title fix static analysis templates fix generics templates Sep 27, 2023
@bendavies bendavies force-pushed the fix-static-analysis-templates branch from 30116ce to e35882a Compare September 27, 2023 17:39
@bendavies bendavies marked this pull request as ready for review September 27, 2023 17:41
@bendavies bendavies force-pushed the fix-static-analysis-templates branch from e35882a to 5730a2b Compare September 28, 2023 08:42
@bendavies
Copy link
Contributor Author

@weaverryan i don't think these are my failures

@weaverryan
Copy link
Contributor

Hmm, actually, I think they are... it's related to deprecations in PHPStan - so my guess is from the new test. But these are "Other deprecation notices"... are those direct? Indirect? I'm actually not sure - we might need to tweak our SYMFONY_DEPRECATIONS_HELPER... or figure out the underlying cause of this.

@stof
Copy link

stof commented Sep 29, 2023

I guess they are not classified properly because the deprecation is triggered from a class defined inside a phar, so it path has starts with phar://, which means it does not start with the absolute path of the vendor folder. I don't find it unexpected that we did not though of the case of phars in the vendor folder in that detection logic.

@weaverryan
Copy link
Contributor

I wonder if changing the phpstan dependency to the stable 1.10 in composer.json would help (I can't remember why I have 1.11-dev - probably by accident).

@bendavies
Copy link
Contributor Author

bendavies commented Oct 18, 2023

doesn't help. but i tried using phpunit directly instead of (not-so-)simple-phpunit, and there are no deprecations.

@weaverryan
Copy link
Contributor

doesn't help. but i tried using phpunit directly instead of (not-so-)simple-phpunit, and there are no deprecations

Yes, but probably just because it's hiding the deprecations :p. Maybe we can just generate and point to a baseline file for these deprecations - https://symfony.com/doc/current/components/phpunit_bridge.html#baseline-deprecations

@bendavies bendavies force-pushed the fix-static-analysis-templates branch from 3bbdd35 to cde28fa Compare October 18, 2023 13:36
@bendavies
Copy link
Contributor Author

done

@weaverryan
Copy link
Contributor

Still not happy - not sure why - phpunit-bridge can be pesky to work with and configure. BUT, I have changed the settings so that if you push, the CI will run automatically vs waiting for my approval 🙃

@bendavies
Copy link
Contributor Author

oh yeah, it's hard coded paths in the allowed deprations

@bendavies bendavies force-pushed the fix-static-analysis-templates branch from cde28fa to ff2153a Compare October 18, 2023 14:01
@bendavies
Copy link
Contributor Author

can't see the issue atm. there are deprecations in ci that i don't get locally.

@bendavies bendavies force-pushed the fix-static-analysis-templates branch 3 times, most recently from f8d804b to c12df81 Compare October 18, 2023 15:17
@bendavies
Copy link
Contributor Author

hallelujah

@weaverryan weaverryan force-pushed the fix-static-analysis-templates branch from c12df81 to 15781f2 Compare October 18, 2023 15:25
@weaverryan
Copy link
Contributor

Thank you for your hard work on this Ben!

@weaverryan weaverryan merged commit 81190a2 into SymfonyCasts:main Oct 18, 2023
@bendavies bendavies deleted the fix-static-analysis-templates branch October 18, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants