Uploaded image for project: 'Website'
  1. Website
  2. WEBSITE-1430

Extension docs: fatal error in controller code example

XMLWordPrintable

      I posted about this a few weeks ago but never got around to making a ticket or anything: https://www.phpbb.com/community/viewtopic.php?p=16009966

      In the extension documentation, specifically the page that mentions controllers, there's a code example which contains an error. The code has a use declaration followed by the file namespace which in php8 throws a fatal error.

       <?php
       
      use \Symfony\Component\HttpFoundation\Response;
       
      namespace acme\demo\controller;
       
      class main
      

      The namespace should come first, then the use declaration.

      It should instead be as follows:

       <?php
       
      namespace acme\demo\controller;
       
      use \Symfony\Component\HttpFoundation\Response;
       
      class main
      

            Unassigned Unassigned
            danieltj Daniel James
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: