Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As described in this change record (and others), Drupal 8 implements the PSR-0 standard and uses that for auto-loading. Consequently, namespaces are now also used heavily.
We therefore have to adapt our file structure to support this, and use proper namespaces. I have already done the first step and moved all classes and interfaces to separate files in appropriate locations (closely resembling the structure in core modules, as far as I understand that currently). I also renamed them (mostly dropping the suffix) and added matching namespace
declarations.
Still to do
- Update references to used core files.
- Add necessary
use
declarations. - Add namespaces to classes/interfaces referenced in comments.
- Discuss whether some classes/interfaces should be moved to a different location (and, hence, namespace).
Anything else?
Comment | File | Size | Author |
---|
Comments
Comment #1
drunken monkeyI think this is done for all classes now, although some will still get moved around.