-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 issues detected by psalm on 2.7 #7989
Conversation
Restarting the build |
Issues in Scrutinizer are correct but were not introduced by this PR. Can this be merged as is? |
Yeah don't worry about Scrutinizer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scrutinizer needs a restart sometimes and it gets back to be green again.
Thanks for approving. What's the next step on this? Should we wait for more approval or is there something to do? Thanks |
More approvals would be great indeed, especially from people who are familiar with the annotations (@Ocramius maybe?) @SenseException I don't know how familiar you are with psalm annotations and how we use them inside Doctrine, feel free to merge. Meanwhile, 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?
|
5de4de2
to
38eb578
Compare
Not familiar enough to merge it without hesitation. |
I've become more familiar with Psalm now.. I think this could be merged, but should be merged on 2.7, since it is just code comments, and in order to keep differences between branches minimal. |
@greg0ire great! I don't really know how to switch branches though, do you also have an explanation like the one for rebase? (it was extremely useful btw, I learned to rebase thanks to that explanation and it made me understand a lot about git) |
Start by clicking the edit button and changing the target branch to 2.7. You should see a lot of commit appear. What you would want to rebase is only the commit you added on top of 2.8.x, so that would be Another way to do the same thing would be this:
|
Mmh, that went pretty smoothly, it's suspicious!
I wanted to try the first solution but I messed up and used the second one without noticing. but it finished successfully but I still see So I'm not sure if everything went well. Can you check if it's okay please? I noticed a new error on psalm, it is indeed an issue in code (we try to instantiate a potential null string). I'd prefer to avoid touching code unless I'm more comfortable with the repo. If it's okay with you, I'll just add it to the baseline or add an issueHandler in psalm.xml |
That's expected, isn't it? That's what I expected at least. |
No please don't, I will look into it for you. |
Well, wasn't the whole point to switch from 2.8 to 2.7? The fact that it still displays 2.8 anywhere that isn't the name of my branche seems disturbing.
Great, thanks! |
Oh right you did not switch the head branch with the edit button |
Can you please allow pushes from maintainers? Should be a checkbox, bottom right |
Thanks for the change, I didn't know you had to change it there too. (EDIT: oh. That's actually the first thing you posted on your explanation. I have no excuse :( ) The checkbox was already checked. I unchecked it and then rechecked just to be sure. |
Well, for some reason I have this:
Not sure if related to this: https://twitter.com/nicolasgrekas/status/1258709224734982146 |
Here are my changes BTW:
|
You forgot the |
268c90f
to
e9b5727
Compare
I'm really bad with CS rules :D I should run them locally! It should be ok now |
Trying to get a report from Travis, without success it seems :/ |
yeah, don't know what's up with that... |
I have the same issue with this other PR: doctrine/cache#341 , but their status seems ok: https://www.traviscistatus.com/ |
Seems to work better now :) |
lib/Doctrine/ORM/Query/SqlWalker.php
Outdated
@@ -142,6 +142,8 @@ class SqlWalker implements TreeWalker | |||
* Map of all components/classes that appear in the DQL query. | |||
* | |||
* @var array | |||
* | |||
* @psalm-var array<string, array{metadata: ClassMetadata, mixed}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to merge, then saw this… Isn't that equivalent to
* @psalm-var array<string, array{metadata: ClassMetadata, mixed}> | |
* @psalm-var array<string, array{metadata: ClassMetadata}> |
Or is there something I am missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest, I don't remember that part. I didn't use psalter and I don't see why I would have added that manually. It was probably a psalm suggestion, even if that doesn't make a lot of sense. I'll revert that
lib/Doctrine/ORM/Query/SqlWalker.php
Outdated
@@ -232,6 +234,8 @@ public function getEntityManager() | |||
* @param string $dqlAlias The DQL alias. | |||
* | |||
* @return array | |||
* | |||
* @psalm-return array{metadata: ClassMetadata, mixed} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Thanks a lot @orklah |
This PR is basically #7986 but targetted on 2.8 as suggested.
I'll copy the text from there:
I didn't expect such difference between master and 2.8! Great job guys, I can't wait for future versions!
It seems that the CI is broken on 2.8. I tried to run phpcbf locally but there are massive changes, I didn't dare apply them here, so there may be some CS errors. If the CI is fixed and the errors are still there in the future, I'll correct them.
I'll close #7986, some changes there were specific to the master branch due to code movements but let's fix that later.