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

2490 remove usages of scheduled for removal api #2495

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).

## 2025.0.1

### Fixed

- Fixed compatibility with PhpStorm/IntelliJ 2025.* [#2495](https://github.com/magento/magento2-phpstorm-plugin/pull/2495)

## 2025.0.0

### Added
Expand Down
60 changes: 38 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
<!-- Plugin description -->
# PhpStorm Magento 2 Plugin

This is a PhpStorm IDE plugin for a better Magento 2 development workflow.

## Version 2025.0.0 - Contributors

<table align="center">
<caption>
This is a PhpStorm IDE plugin for a better Magento 2 development workflow.
</caption>
<thead>
<tr>
<td colspan="3" align="center">
Version 2025.0.0 - Contributors
</td>
</tr>
</thead>
<tbody>
<tr>
<td align="center">
<a href="https://github.com/YevhenZvieriev">
Expand All @@ -35,13 +42,36 @@ This is a PhpStorm IDE plugin for a better Magento 2 development workflow.
</a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3" align="center">
<h3>Support the Project</h3>
<p>If you find this plugin helpful and want to support its development, consider buying the contributors a coffee:</p>
<a href="https://buymeacoffee.com/vitalii_b">
<img src="https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Donate-orange.svg" alt="Buy Me a Coffee">
</a>
<p>Thank you to our sponsors—your support means everything:</p>
<p>Lucas van Staden</p>
<p>Ivan Chepurnyi</p>
</td>
</tr>
</tfoot>
</table>

### Support the Project

If you find this plugin helpful and want to support its development, consider buying the contributors a coffee:
## Features

[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Donate-orange.svg)](https://buymeacoffee.com/vitalii_b)
* Configuration smart completion and references for XML/JavaScript files
* `Navigate to configuration` reference in scope of class/interface
* `Go to plugin` reference in scope of class/interface and method
* `Navigate to Web API configuration` reference in scope of class/interface and method
* Plugin class methods generation
* Plugin declaration inspection
* RequireJS reference navigation and completion
* MFTF reference navigation and completion
* GraphQL navigation line markers
* Code generation
* Inspections for XML configuration

<!-- Plugin description end -->

Expand All @@ -63,20 +93,6 @@ If you find this plugin helpful and want to support its development, consider bu
* PhpStorm >= 2023.1
* JRE >= 17

## Features

* Configuration smart completion and references for XML/JavaScript files
* `Navigate to configuration` reference in scope of class/interface
* `Go to plugin` reference in scope of class/interface and method
* `Navigate to Web API configuration` reference in scope of class/interface and method
* Plugin class methods generation
* Plugin declaration inspection
* RequireJS reference navigation and completion
* MFTF reference navigation and completion
* GraphQL navigation line markers
* Code generation
* Inspections for XML configuration

## Setting up development environment

1. Check out this repository
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pluginGroup = com.magento.idea.magento2plugin
pluginName = Magento PhpStorm
pluginRepositoryUrl = https://github.com/magento/magento2-phpstorm-plugin
pluginVersion = 2025.0.0
pluginVersion = 2025.0.1
pluginSinceBuild = 233
pluginUntilBuild = 248.*
pluginUntilBuild = 258.*
platformType = PS
platformVersion = 2024.3
platformPlugins =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiReference;
import com.intellij.psi.tree.IElementType;
import com.intellij.util.SlowOperations;
import com.jetbrains.php.lang.lexer.PhpTokenTypes;
import com.jetbrains.php.lang.psi.PhpFile;
import com.jetbrains.php.lang.psi.elements.Method;
Expand Down Expand Up @@ -133,7 +132,7 @@ private boolean checkIsEventDispatchMethod(final MethodReference element) {
if (elementReference == null) {
return false;
}
final PsiElement method = SlowOperations.allowSlowOperations(elementReference::resolve);
final PsiElement method = elementReference.resolve();
if (!(method instanceof Method)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package com.magento.idea.magento2plugin.actions.generation.dialog;

import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.util.Pair;
import com.magento.idea.magento2plugin.actions.generation.data.ui.ComboBoxItemData;
import com.magento.idea.magento2plugin.actions.generation.dialog.prompt.PlaceholderInitializerUtil;
Expand Down Expand Up @@ -35,10 +36,13 @@
/**
* All code generate dialog should extend this class.
*/
@SuppressWarnings({
"PMD.TooManyMethods"
})
public abstract class AbstractDialog extends JDialog {

protected CommonBundle bundle;
protected final ValidatorBundle validatorBundle = new ValidatorBundle();
protected transient CommonBundle bundle;
protected final transient ValidatorBundle validatorBundle = new ValidatorBundle();
protected final List<FieldValidationData> fieldsValidationsList;
private final String errorTitle;
private JTabbedPane tabbedPane;
Expand Down Expand Up @@ -75,12 +79,37 @@ protected void exit() {
dispose();
}

/**
* Executes onOK within a WriteAction context.
*/
protected final void executeOnOk() {
WriteAction.run(this::onWriteActionOK);
}

/**
* This method should contain the core logic for onOk.
* Subclasses can override to provide their implementation.
* Must be invoked via executeOnOk().
*/
protected abstract void onWriteActionOK();

/**
* Hook executed when the OK button is pressed.
*/
protected final void onOK() {
executeOnOk();
}

/**
* Validate all form fields.
*
* @return boolean
*/
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.AvoidDeeplyNestedIfStmts"})
@SuppressWarnings({
"PMD.CyclomaticComplexity",
"PMD.AvoidDeeplyNestedIfStmts",
"PMD.CognitiveComplexity"
})
protected boolean validateFormFields() {
boolean dialogHasErrors;
isValidationErrorShown = dialogHasErrors = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ private void fillTargetAreaOptions() {
}
}

protected void onOK() {
protected void onWriteActionOK() {

if (targetMethod == null) {
targetMethod = getSelectedTargetMethod();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private void fillTargetAreaOptions() {
/**
* Perform code generation using input data.
*/
private void onOK() {
protected void onWriteActionOK() {
if (validateFormFields()) {
new ObserverClassGenerator(new ObserverFileData(
getObserverDirectory(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public static void open(
/**
* Fire process if all fields are valid.
*/
private void onOK() {
protected void onWriteActionOK() {

if (itemsTable.isEditing()) {
itemsTable.getCellEditor().stopCellEditing();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ protected void updateArgumentText() {
);
}

protected void onOK() {
protected void onWriteActionOK() {

if (!validateFormFields()) {
exit();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ public static void open(
/**
* Fire generation process if all fields are valid.
*/
private void onOK() {
protected void onWriteActionOK() {

if (validateFormFields()) {
final DiArgumentData data = getDialogDataObject();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public static void open(final Project project, final PsiDirectory directory) {
dialog.setVisible(true);
}

protected void onOK() {
protected void onWriteActionOK() {

if (validateFormFields()) {
generateFile();
exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public String getCLICommandClassFqn() {
return namespaceBuilder.getClassFqn();
}

private void onOK() {
protected void onWriteActionOK() {

if (validateFormFields() && isPHPClassValid()) {
this.generate();
exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ public static void open(final Project project, final PsiDirectory directory) {
dialog.setVisible(true);
}

private void onOK() {
protected void onWriteActionOK() {

if (validateFormFields()) {
generateFile();
exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ public static void open(final Project project, final PsiDirectory directory) {
dialog.setVisible(true);
}

private void onOK() {
protected void onWriteActionOK() {

if (validateFormFields()) {
generateFile();
exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ private String suggestCronjobName(final String cronjobClassname) {
/**
* When new cronjob dialog is filled, validate the input data and generate a new cronjob.
*/
private void onOK() {
protected void onWriteActionOK() {

if (!validateFormFields()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
import org.jetbrains.annotations.NotNull;

@SuppressWarnings({
"PMD.ExcessiveImports"
"PMD.ExcessiveImports",
"PMD.ConstructorCallsOverridableMethod"
})
public class NewDataModelDialog extends AbstractDialog {

Expand All @@ -63,13 +64,13 @@ public class NewDataModelDialog extends AbstractDialog {

private final Project project;
private final String moduleName;
private final ValidatorBundle validatorBundle;
private final CommonBundle commonBundle;
private final transient ValidatorBundle validatorBundle;
private final transient CommonBundle commonBundle;
private final List<String> properties;

private JPanel contentPanel;
private JButton buttonOK;
private JButton buttonCancel;
private JPanel contentPanel; //NOPMD
private JButton buttonOK; //NOPMD
private JButton buttonCancel; //NOPMD
private JTable propertyTable;
private JButton addProperty;
private JCheckBox createInterface;
Expand Down Expand Up @@ -121,7 +122,9 @@ public void windowClosing(final WindowEvent event) {
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
);

addComponentListener(new FocusOnAFieldListener(() -> modelName.requestFocusInWindow()));
addComponentListener(new FocusOnAFieldListener(() -> {
modelName.requestFocusInWindow();
}));
}

/**
Expand All @@ -140,7 +143,8 @@ public static void open(
/**
* Proceed with generation.
*/
private void onOK() {
protected void onWriteActionOK() {

if (propertyTable.isEditing()) {
propertyTable.getCellEditor().stopCellEditing();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ public void windowClosing(final WindowEvent event) {
/**
* On buttonOK action listener.
*/
private void onOK() {
protected void onWriteActionOK() {

if (columnsTable.isEditing()) {
columnsTable.getCellEditor().stopCellEditing();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ private String getModuleName() {
return this.moduleName;
}

private void onOK() {
protected void onWriteActionOK() {

final boolean emailTemplateCanBeDeclared = !this.validator.validate(this);

if (!validateFormFields() || emailTemplateCanBeDeclared) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ private void generateNewEntityFiles(final @NotNull ActionEvent event) {
/**
* Perform code generation using input data.
*/
private void onOK() {
protected void onWriteActionOK() {

if (!validateFormFields()) {
onOkActionFired.setInProgress(false);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public static void open(final Project project, final PsiDirectory directory) {
}
}

protected void onOK() {
protected void onWriteActionOK() {

if (validateFormFields()) {
generateFile();
exit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ private void fillPredefinedValuesAndDisableInputs() {
/**
* Fire generation process if all fields are valid.
*/
private void onOK() {
protected void onWriteActionOK() {

if (validateFormFields()) {
final WebApiInterfaceData data = getDialogDataObject();

Expand Down
Loading
Loading