Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-1291

PHP DOC : autocomplete array of static dosen't work

    XMLWordPrintableJSON

    Details

      Description

      Hi,

      the autocomplete dosen't work on array of static.

      That doesn't support self and $this too.

      And there is 2 way for document return of table : array<T> or T[]

      The phpdoc documentation : http://docs.phpdoc.org/guides/types.html

      See exemple below :

      abstract class A {
      
        /**
         * return array of class
         * @return static[]
         */
        function returnArrayOfClass() {
        }
      
      }
      
      class B extends A {
      
        public $b;
      
        /**
         * return array of class
         * @return B[]
         */
        function returnArrayOfClassB() {
        }
      
      }
      
      $oB = new B();
      $aB = $oB->returnArrayOfClass();
      foreach ($aB as $b) {
        $b->b;//dosen't autocomplete b
      }
      
      $aB2 = $oB->returnArrayOfClassB();
      foreach ($aB2 as $b2) {
        $b2->b; //autocomplete b
      }
      

      Regards,

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              remi Remi Bergsma
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: