Skip to content

Commit 1f85fc6

Browse files
Merge branch '4.2.2-develop' of github.com:magento/magento2-phpstorm-plugin into 633-no-such-element-exception-when-creating-new-controller
2 parents e582ca8 + 3c95b7c commit 1f85fc6

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

src/com/magento/idea/magento2plugin/magento/packages/MessageQueueConnections.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
import java.util.List;
1010

1111
public enum MessageQueueConnections {
12+
1213
DB("db"),
13-
AMPQ("ampq");
14+
AMPQ("amqp");
1415

1516
private final String type;
1617

@@ -32,16 +33,6 @@ public String getType() {
3233
return type;
3334
}
3435

35-
/**
36-
* Get connection type by name.
37-
*
38-
* @param typeName type name
39-
* @return Request Interface
40-
*/
41-
public static String getConnectionTypeByName(final String typeName) {
42-
return MessageQueueConnections.valueOf(typeName).getType();
43-
}
44-
4536
/**
4637
* Get list of connection types.
4738
*
@@ -51,7 +42,7 @@ public static List<String> getList() {
5142
final List<String> typeList = new ArrayList<>();
5243

5344
for (final MessageQueueConnections type: MessageQueueConnections.values()) {
54-
typeList.add(getConnectionTypeByName(type.name()));
45+
typeList.add(type.getType());
5546
}
5647

5748
return typeList;

src/com/magento/idea/magento2uct/util/php/MagentoTypeEscapeUtil.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ private MagentoTypeEscapeUtil() {
3232
String result = typeFqn;
3333

3434
while (matcher.find()) {
35-
result = result.substring(0, matcher.start(0)) + result.substring(matcher.end(0));
35+
final int begin = matcher.start(0);
36+
final int end = matcher.end(0);
37+
38+
if (begin < 0 || begin > end || end > result.length()) {
39+
continue;
40+
}
41+
result = result.substring(0, begin) + result.substring(end);
3642
}
3743

3844
return typeFqn.equals(result) ? typeFqn : result;

0 commit comments

Comments
 (0)