Skip to content

Commit

Permalink
Merge pull request #1278 from magento/1277-fixed-missing-import
Browse files Browse the repository at this point in the history
1277: fixed throwable and wrapButtonSettings function call
  • Loading branch information
VitaliyBoyko authored Dec 28, 2022
2 parents 24bd90f + 5df615d commit 051d406
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ${NAME} extends ${GENERIC_BUTTON} implements ${DATA_PROVIDER_TYPE}

#end
return $this->wrapButtonSettings(
__('${LABEL}'),
__('${LABEL}')->getText(),
'${CLASS}',
${ON_CLICK},
${DATA_ATTRS},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.intellij.util.io.DataExternalizer;
import com.intellij.util.io.EnumeratorStringDescriptor;
import com.intellij.util.io.KeyDescriptor;
import com.jetbrains.php.PhpIndex;
import com.jetbrains.php.lang.PhpLangUtil;
import com.magento.idea.magento2plugin.magento.files.ModuleDiXml;
import com.magento.idea.magento2plugin.project.Settings;
Expand Down Expand Up @@ -91,7 +90,6 @@ public Map<String, Set<PluginData>> map(final @NotNull FileContent fileContent)

@SuppressWarnings("checkstyle:LineLength")
private Set<PluginData> getPluginsForType(final XmlTag typeNode) {
final PhpIndex phpIndex = PhpIndex.getInstance(typeNode.getProject());
final Set<PluginData> results = new HashSet<>();

for (final XmlTag pluginTag: typeNode.findSubTags(ModuleDiXml.PLUGIN_TAG_NAME)) {
Expand All @@ -100,12 +98,7 @@ private Set<PluginData> getPluginsForType(final XmlTag typeNode) {

if (pluginType != null && !pluginType.isEmpty()) {
final PluginData pluginData = getPluginDataObject(pluginType, getIntegerOrZeroValue(pluginSortOrder));
try {
phpIndex.getAnyByFQN(pluginData.getType());
results.add(pluginData);
} catch (Throwable exception) { //NOPMD
//do nothing
}
results.add(pluginData);
}
}

Expand All @@ -128,7 +121,7 @@ private PluginData getPluginDataObject(
final String pluginType,
final Integer sortOrder
) {
return new PluginData(pluginType, sortOrder);
return new PluginData(pluginType, sortOrder);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MyBackButton extends GenericButton implements ButtonProviderInterface
public function getButtonData(): array
{
return $this->wrapButtonSettings(
__('Back To Grid'),
__('Back To Grid')->getText(),
'back',
sprintf("location.href = '%s';", $this->getUrl('*/*/')),
[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MyCustom extends GenericButton implements ButtonProviderInterface
public function getButtonData(): array
{
return $this->wrapButtonSettings(
__('Custom Button'),
__('Custom Button')->getText(),
'custom',
'',
[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function getButtonData(): array
}

return $this->wrapButtonSettings(
__('Delete'),
__('Delete')->getText(),
'delete',
sprintf("deleteConfirm('%s', '%s')",
__('Are you sure you want to delete this book?'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SaveBlock extends GenericButton implements ButtonProviderInterface
public function getButtonData(): array
{
return $this->wrapButtonSettings(
__('Save'),
__('Save')->getText(),
'save primary',
'',
[
Expand Down

0 comments on commit 051d406

Please sign in to comment.