Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5318

Implement PSR-4 autoloading in blocks plugin

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Should have Should have
    • None
    • None
    • 8
    • Code Refactoring, Technical Debt

      Set up PSR-4 autoloading and remove the custom autoload function, so that we make use of the established standard and the class names match the file name.

      This can mostly be done in the same way as we did for master theme.

      • Check if there are any class_exists checks around classes. If there are, you can remove them in a separate PR which can already be merged separately.
      • Check if any class names are referenced in a string instead of with "SomeClass::class" and create a separate PR which can also be merged beforehand (otherwise these might be missed by your IDE when moving the classes).
      • Set up autoloading and namespace to folder ( /src) mapping in composer.json.
      • Move the classes one by one into the new namespace. Advisable to have one commit per class and ensure on each move the pipeline keeps passing.

            Unassigned Unassigned
            pvincent Pieter Vincent (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: