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

[FEATURE] Add RemoveAddLLrefForTCAdescrMethodCallRector #4471

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MohsinQK
Copy link
Contributor

@MohsinQK MohsinQK commented Jan 9, 2025

No description provided.

*/
public function refactor(Node $node): ?Node
{
if (! $node instanceof StaticCall) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check is useless as this will always be the case because of the nodeTypes filter above


if (! $this->nodeTypeResolver->isMethodStaticCallOrClassMethodObjectType(
$node,
new ObjectType(ExtensionManagementUtility::class)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not import class names from TYPO3. See other rules how it is done.

return null;
}

return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return null does nothing and does not remove the node.

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
CODE_SAMPLE
),

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line


use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove please

@simonschaufi
Copy link
Collaborator

simonschaufi commented Jan 13, 2025

Please also link the corresponding issue to this rule in the commit message and in the future please use a new branch to keep your main branch clean, otherwise you have to hard reset it after a merge.

MohsinQK and others added 2 commits January 13, 2025 20:12
Co-authored-by: Simon Schaufelberger <simonschaufi@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@simonschaufi
Copy link
Collaborator

Can you please have a look at my comments?

@MohsinQK
Copy link
Contributor Author

Hello @simonschaufi
Actually, I am new to the rector, can you give me one example Rector Rule from which I can get help building this?
because this is a very simple rector rule but, I could not find any rule that removes a static call.
Please give me one example if you know one where we are removing static calls.

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