Skip to content

[OXID] replace backwards-compatability classes in oxNew#2883

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
alfredbez:oxid-replace-deprecated-classes
Feb 18, 2020
Merged

[OXID] replace backwards-compatability classes in oxNew#2883
TomasVotruba merged 1 commit intorectorphp:masterfrom
alfredbez:oxid-replace-deprecated-classes

Conversation

@alfredbez
Copy link
Copy Markdown
Contributor

The OXID Framework has a wrapper for the new keyword, which allows loading a class like

oxNew('oxarticle');

A few years ago we moved to namespaces

oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

... but many modules and projects out there still use the old syntax. This rule makes the transition to the new recommended way a breeze.


I plan to add a similar rector for replacing these classes also in docblocks (@return and @param statements) which should help to get static analysis like phpstan or psalm running. I will extract the class-map to a standalone class to make it usable in multiple rectors.

@TomasVotruba TomasVotruba self-requested a review February 18, 2020 17:05
@TomasVotruba
Copy link
Copy Markdown
Member

Nice job 👍

@TomasVotruba TomasVotruba merged commit b65a200 into rectorphp:master Feb 18, 2020
TomasVotruba added a commit that referenced this pull request Sep 1, 2022
rectorphp/rector-src@8961d20 [DX] Localize multi instance checker and privates accessor from Symplify + bump to PHPStan 1.8.3 (#2883)
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.

2 participants