You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/11/14 16:00:33 UTC

[GitHub] [netbeans] KacerCZ opened a new pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

KacerCZ opened a new pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535


   https://issues.apache.org/jira/browse/NETBEANS-5027
   
   Improves display of array used as default parameter value.
   Uses short array format, displays first item in array, indicates more elements in array.
   
   Before:
   ![netbeans5027-before](https://user-images.githubusercontent.com/4249184/99151342-c6f9a280-269a-11eb-9f32-df2087e40260.png)
   
   After:
   ![netbeans5027-after](https://user-images.githubusercontent.com/4249184/99151343-c9f49300-269a-11eb-831a-f86b84343999.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] KacerCZ commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
KacerCZ commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731163536


   @tmysik Build failure is related to network issue during build setup. Could you please trigger build again?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731348334


   I know that. It occurred again when I reran jobs. (See timestamp of build job.)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] KacerCZ commented on a change in pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
KacerCZ commented on a change in pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#discussion_r527681681



##########
File path: php/php.editor/test/unit/src/org/netbeans/modules/php/editor/CodeUtilsTest.java
##########
@@ -179,4 +183,43 @@ public void testCommonNamespacePrefixes11() {
         assertEquals(0, prefixes.size());
     }
 
+    public void testGetParamDefaultValueEmptyArray() {
+        List<ArrayElement> emptyArray = Collections.emptyList();
+        FormalParameter param = createFormalParameterWithDefaultArray(emptyArray);
+        assertEquals("[]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayOneItem() {
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, null, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayTwoItems() {
+        Scalar value1 = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item1 = new ArrayElement(1, 1, null, value1);
+        Scalar value2 = new Scalar(1, 1, "'b'", Scalar.Type.STRING);
+        ArrayElement item2 = new ArrayElement(1, 1, null, value2);
+        List<ArrayElement> array = Arrays.asList(item1, item2);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a',...]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayItemWithKey() {
+        Scalar key = new Scalar(1, 1, "3", Scalar.Type.INT);
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, key, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("[3 => 'a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    private FormalParameter createFormalParameterWithDefaultArray(List<ArrayElement> arrayContent) {
+        ArrayCreation defaultValue = new ArrayCreation(1, 1, arrayContent, ArrayCreation.Type.NEW);
+        FormalParameter param = new FormalParameter(1, 1, null, null, defaultValue);
+        return param;
+    }
+

Review comment:
       If I understand you correctly you mean this case?
   <code>
   function printDate(\DateTime $date = new \DateTime()) {}
   </code>
   
   PHP does not support object as default value.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
tmysik commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731353923


   So, I would merge it. Any objections?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731280429


   @hectorespert Could you have a look at the following?
   ```
   Error: Unable to process command '::add-path::/home/runner/.composer/vendor/bin' successfully.
   Error: The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik merged pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
tmysik merged pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
tmysik commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731053339


   @KacerCZ 
   
   Could you please check the failed build? Thanks.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#discussion_r527877072



##########
File path: php/php.editor/test/unit/src/org/netbeans/modules/php/editor/CodeUtilsTest.java
##########
@@ -179,4 +183,43 @@ public void testCommonNamespacePrefixes11() {
         assertEquals(0, prefixes.size());
     }
 
+    public void testGetParamDefaultValueEmptyArray() {
+        List<ArrayElement> emptyArray = Collections.emptyList();
+        FormalParameter param = createFormalParameterWithDefaultArray(emptyArray);
+        assertEquals("[]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayOneItem() {
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, null, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayTwoItems() {
+        Scalar value1 = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item1 = new ArrayElement(1, 1, null, value1);
+        Scalar value2 = new Scalar(1, 1, "'b'", Scalar.Type.STRING);
+        ArrayElement item2 = new ArrayElement(1, 1, null, value2);
+        List<ArrayElement> array = Arrays.asList(item1, item2);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a',...]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayItemWithKey() {
+        Scalar key = new Scalar(1, 1, "3", Scalar.Type.INT);
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, key, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("[3 => 'a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    private FormalParameter createFormalParameterWithDefaultArray(List<ArrayElement> arrayContent) {
+        ArrayCreation defaultValue = new ArrayCreation(1, 1, arrayContent, ArrayCreation.Type.NEW);
+        FormalParameter param = new FormalParameter(1, 1, null, null, defaultValue);
+        return param;
+    }
+

Review comment:
       No. I meant how the tooltip would look like for array e.g. `[0 => new DateTime()]`. Just to verify that it still looks ok. Thanks and sorry for not being clear.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] hectorespert commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
hectorespert commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731528023


   For me it's ok, linux tests are failing due the fix was not applied in this PR, but the job to run php tests in windows pass this change.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] KacerCZ commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
KacerCZ commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731344943


   @junichi11 This issue was fixed by @hectorespert in PR #2543


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#discussion_r527879759



##########
File path: php/php.editor/test/unit/src/org/netbeans/modules/php/editor/CodeUtilsTest.java
##########
@@ -179,4 +183,43 @@ public void testCommonNamespacePrefixes11() {
         assertEquals(0, prefixes.size());
     }
 
+    public void testGetParamDefaultValueEmptyArray() {
+        List<ArrayElement> emptyArray = Collections.emptyList();
+        FormalParameter param = createFormalParameterWithDefaultArray(emptyArray);
+        assertEquals("[]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayOneItem() {
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, null, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayTwoItems() {
+        Scalar value1 = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item1 = new ArrayElement(1, 1, null, value1);
+        Scalar value2 = new Scalar(1, 1, "'b'", Scalar.Type.STRING);
+        ArrayElement item2 = new ArrayElement(1, 1, null, value2);
+        List<ArrayElement> array = Arrays.asList(item1, item2);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a',...]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayItemWithKey() {
+        Scalar key = new Scalar(1, 1, "3", Scalar.Type.INT);
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, key, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("[3 => 'a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    private FormalParameter createFormalParameterWithDefaultArray(List<ArrayElement> arrayContent) {
+        ArrayCreation defaultValue = new ArrayCreation(1, 1, arrayContent, ArrayCreation.Type.NEW);
+        FormalParameter param = new FormalParameter(1, 1, null, null, defaultValue);
+        return param;
+    }
+

Review comment:
       Ha, sorry, I was too fast, now I see it. It is only about the parameters, not all arrays "everywhere".




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#discussion_r527877072



##########
File path: php/php.editor/test/unit/src/org/netbeans/modules/php/editor/CodeUtilsTest.java
##########
@@ -179,4 +183,43 @@ public void testCommonNamespacePrefixes11() {
         assertEquals(0, prefixes.size());
     }
 
+    public void testGetParamDefaultValueEmptyArray() {
+        List<ArrayElement> emptyArray = Collections.emptyList();
+        FormalParameter param = createFormalParameterWithDefaultArray(emptyArray);
+        assertEquals("[]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayOneItem() {
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, null, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayTwoItems() {
+        Scalar value1 = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item1 = new ArrayElement(1, 1, null, value1);
+        Scalar value2 = new Scalar(1, 1, "'b'", Scalar.Type.STRING);
+        ArrayElement item2 = new ArrayElement(1, 1, null, value2);
+        List<ArrayElement> array = Arrays.asList(item1, item2);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a',...]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayItemWithKey() {
+        Scalar key = new Scalar(1, 1, "3", Scalar.Type.INT);
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, key, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("[3 => 'a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    private FormalParameter createFormalParameterWithDefaultArray(List<ArrayElement> arrayContent) {
+        ArrayCreation defaultValue = new ArrayCreation(1, 1, arrayContent, ArrayCreation.Type.NEW);
+        FormalParameter param = new FormalParameter(1, 1, null, null, defaultValue);
+        return param;
+    }
+

Review comment:
       No. I meant his the tooltip would look like for array e.g. `[0 => new DateTime()]`. Just to verify that it still looks ok. Thanks and sorry for not being clear.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] tmysik commented on a change in pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#discussion_r527567060



##########
File path: php/php.editor/test/unit/src/org/netbeans/modules/php/editor/CodeUtilsTest.java
##########
@@ -179,4 +183,43 @@ public void testCommonNamespacePrefixes11() {
         assertEquals(0, prefixes.size());
     }
 
+    public void testGetParamDefaultValueEmptyArray() {
+        List<ArrayElement> emptyArray = Collections.emptyList();
+        FormalParameter param = createFormalParameterWithDefaultArray(emptyArray);
+        assertEquals("[]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayOneItem() {
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, null, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayTwoItems() {
+        Scalar value1 = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item1 = new ArrayElement(1, 1, null, value1);
+        Scalar value2 = new Scalar(1, 1, "'b'", Scalar.Type.STRING);
+        ArrayElement item2 = new ArrayElement(1, 1, null, value2);
+        List<ArrayElement> array = Arrays.asList(item1, item2);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("['a',...]", CodeUtils.getParamDefaultValue(param));
+    }
+
+    public void testGetParamDefaultValueArrayItemWithKey() {
+        Scalar key = new Scalar(1, 1, "3", Scalar.Type.INT);
+        Scalar value = new Scalar(1, 1, "'a'", Scalar.Type.STRING);
+        ArrayElement item = new ArrayElement(1, 1, key, value);
+        List<ArrayElement> array = Arrays.asList(item);
+        FormalParameter param = createFormalParameterWithDefaultArray(array);
+        assertEquals("[3 => 'a']", CodeUtils.getParamDefaultValue(param));
+    }
+
+    private FormalParameter createFormalParameterWithDefaultArray(List<ArrayElement> arrayContent) {
+        ArrayCreation defaultValue = new ArrayCreation(1, 1, arrayContent, ArrayCreation.Type.NEW);
+        FormalParameter param = new FormalParameter(1, 1, null, null, defaultValue);
+        return param;
+    }
+

Review comment:
       Could you please add a test where the array value is an object? I would like to see how the tooltip will look like in such a case. Thanks!
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #2535: [NETBEANS-5027] PHP - improved display of array parameter

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2535:
URL: https://github.com/apache/netbeans/pull/2535#issuecomment-731471693


   @tmysik Just in case, let's wait for a reply from @hectorespert .
   I reran the jobs after that change was merged into the master branch. That should pass if there is no problem, I suppose.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists