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

Use import instead of fully qualified namespaces #7060

Merged
merged 13 commits into from Dec 5, 2021

Conversation

rarila
Copy link
Contributor

@rarila rarila commented Dec 4, 2021

At least for most cases. Partials left for another PR as they need some more thinking.

All conversions were done carefullly, no tests fail. I hope that no external stuff (Plugins) break.
I don’t know now to review such a monster PR :-(

Fixes #7037

@weirdan weirdan self-requested a review December 4, 2021 21:28
@weirdan weirdan added the release:internal The PR will be included in 'Internal changes' section of the release notes label Dec 4, 2021
@weirdan
Copy link
Collaborator

weirdan commented Dec 4, 2021

Mind looking into phar issue? See

- run:
name: Build Phar file
command: bin/build-phar.sh
- run:
name: Smoke test Phar file
command: build/psalm.phar --version
for how it's built.

@rarila
Copy link
Contributor Author

rarila commented Dec 4, 2021

Hmm, we probably should include this in the local tests

@rarila
Copy link
Contributor Author

rarila commented Dec 4, 2021

@weirdan Fixed. But that was mor an educated guess than knowledge. Do you know what happened there? Doesn’t look wrong to me. Some magic with box that does some search-replace with \Composer\Autoload\ClassLoader perhaps?!

@weirdan
Copy link
Collaborator

weirdan commented Dec 4, 2021

Some magic with box that does some search-replace with \Composer\Autoload\ClassLoader perhaps?!

Likely. Should we also revert other similar changes, e.g. in Cli\LanguageServer?

@rarila
Copy link
Contributor Author

rarila commented Dec 4, 2021

Likely. Should we also revert other similar changes, e.g. in Cli\LanguageServer?

Yes, to be on the save side. The same code is in LanguageServer, Psalter, and Refactor. I guess when it breaks in Psalm it should do so there, too.

@weirdan weirdan merged commit e9d9481 into vimeo:master Dec 5, 2021
@weirdan
Copy link
Collaborator

weirdan commented Dec 5, 2021

Thanks!

@rarila rarila deleted the codingstyle-convert-fqn branch December 5, 2021 00:55
@rarila
Copy link
Contributor Author

rarila commented Dec 5, 2021

@weirdan Found the cause of the \Composer\Autoload\ClassLoader problem:

psalm/scoper.inc.php

Lines 22 to 26 in eb4e9de

return str_replace(
'\\'.$prefix.'\Composer\Autoload\ClassLoader',
'\Composer\Autoload\ClassLoader',
$contents
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:internal The PR will be included in 'Internal changes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codingstyle – contributor input wanted
2 participants