22 * Copyright © Magento, Inc. All rights reserved.
33 * See COPYING.txt for license details.
44 */
5+
56package com .magento .idea .magento2plugin .actions .generation .util ;
67
78import com .intellij .openapi .util .Key ;
1011import com .jetbrains .php .lang .psi .elements .Method ;
1112import com .jetbrains .php .lang .psi .elements .Parameter ;
1213import com .jetbrains .php .lang .psi .elements .PhpReturnType ;
13- import com .magento .idea .magento2plugin .actions .generation .references .PhpClassReferenceResolver ;
1414import com .magento .idea .magento2plugin .actions .generation .data .code .PluginMethodData ;
15- import org . jetbrains . annotations . NotNull ;
15+ import com . magento . idea . magento2plugin . actions . generation . references . PhpClassReferenceResolver ;
1616import java .util .ArrayList ;
1717import java .util .Arrays ;
1818import java .util .Collection ;
1919import java .util .Set ;
20+ import org .jetbrains .annotations .NotNull ;
2021
2122public class FillTextBufferWithPluginMethods {
2223 private static FillTextBufferWithPluginMethods INSTANCE = null ;
2324
25+ /**
26+ * Get util instance.
27+ *
28+ * @return FillTextBufferWithPluginMethods
29+ */
2430 public static FillTextBufferWithPluginMethods getInstance () {
2531 if (null == INSTANCE ) {
2632 INSTANCE = new FillTextBufferWithPluginMethods ();
2733 }
2834 return INSTANCE ;
2935 }
3036
31- public void execute (@ NotNull Key <Object > targetClassKey , Set <CharSequence > insertedMethodsNames , @ NotNull PhpClassReferenceResolver resolver , @ NotNull StringBuffer textBuf , @ NotNull PluginMethodData [] pluginMethods ) {
37+ /**
38+ * Fill text buffer with plugin methods.
39+ *
40+ * @param targetClassKey Key[Object]
41+ * @param insertedMethodsNames Set[CharSequence]
42+ * @param resolver PhpClassReferenceResolver
43+ * @param textBuf StringBuffer
44+ * @param pluginMethods PluginMethodData
45+ */
46+ public void execute (
47+ final @ NotNull Key <Object > targetClassKey ,
48+ final Set <CharSequence > insertedMethodsNames ,
49+ final @ NotNull PhpClassReferenceResolver resolver ,
50+ final @ NotNull StringBuffer textBuf ,
51+ final @ NotNull PluginMethodData [] pluginMethods
52+ ) {
3253 for (PluginMethodData pluginMethod : pluginMethods ) {
3354 insertedMethodsNames .add (pluginMethod .getMethod ().getName ());
3455 PhpDocComment comment = pluginMethod .getDocComment ();
@@ -39,7 +60,8 @@ public void execute(@NotNull Key<Object> targetClassKey, Set<CharSequence> inser
3960 Parameter [] parameters = targetMethod .getParameters ();
4061 Collection <PsiElement > processElements = new ArrayList <>(Arrays .asList (parameters ));
4162 resolver .processElements (processElements );
42- PsiElement targetClass = (PsiElement ) pluginMethod .getTargetMethod ().getUserData (targetClassKey );
63+ PsiElement targetClass = (PsiElement ) pluginMethod .getTargetMethod ()
64+ .getUserData (targetClassKey );
4365 resolver .processElement (targetClass );
4466 PhpReturnType returnType = targetMethod .getReturnType ();
4567 if (returnType != null ) {
0 commit comments