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

PHP8 Stringable interface

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • NB13
    • php - Editor
    • None

    Description

      Can you add Stringable interface ?

      https://www.php.net/manual/en/class.stringable.php

      The Stringable interface denotes a class as having a __toString() method. Unlike most interfaces, Stringable is implicitly present on any class that has the magic __toString() method defined, although it can and should be declared explicitly.

      Case 1:

      1. Create a class
      2. add "implements Stringable"
      3. Menu Source->InsertCode>Override and implement method
      4. Netbeans should propose "__toString" function

      Case 2

      In a class with the __toString function coded, netbeans should show a warning on Class line if "implements Stringable" is missing.

       

      Thanks

      Attachments

        Activity

          People

            junichi11 Junichi Yamamoto
            FFT Jayce
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: