[BUGFIX] Make class aliases available for consumers#1534
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
2eab94e to
76c23f7
Compare
76c23f7 to
6c7af52
Compare
6c7af52 to
f701e4b
Compare
JakeQZ
left a comment
There was a problem hiding this comment.
Could we not keep the class alias files in their original locations, and just have the two files explicitly loaded via Composer?
That way
- we don't need to introduce a new root-level directory along with config file changes that we'll have to undo when we drop the aliases for the next major release;
- the separate alias files remain in a source directory representing the namespace of the alias (i.e. the old name of the class), and the deprecation notices make more sense.
| use Sabberworm\CSS\Rule\Rule; | ||
| use Sabberworm\CSS\RuleSet\RuleContainer; | ||
| use Sabberworm\CSS\Property\Declaration; | ||
| use Sabberworm\CSS\RuleSet\DeclarationList; |
There was a problem hiding this comment.
These should be in alphabetical order.
I'll give it a try … |
|
Okay, done and repushed. |
JakeQZ
left a comment
There was a problem hiding this comment.
Much cleaner :)
I assume it still works.
It does indeed (at least on my machine). |
|
Relevant PHPStan issues that were not resolved which means we need the Composer workaround: |
I'm now getting errors from Stan saying it can't find the classes, within the PHP-CSS-Parser project alone. But maybe Composer hasn't updated the class loaders. When I run |
I got those as well. It turned out I needed to delete the PHPStan caches (which on my Linux machine are located in |
"./vendor/bin/phpstan" clear-result-cachedoes the job and should work on both Windows and Linux. I think we have some other cache-clearing commands in |
We don't seem to have any cache-clearing commands any more. Perhaps they were for tools that we stopped using. |
Fixes #1532