Skip to content

Should we use require_once in a module’s registration.php?

I am of the opinion that using require_once in registration.php is not ok and possibly against Magento coding standards.

Am I right or wrong?

<?php

MagentoFrameworkComponentComponentRegistrar::register(
    MagentoFrameworkComponentComponentRegistrar::MODULE,
    'Vendor_Module',
    __DIR__
);

require_once(BP.'/lib/internal/SomeModule/src/somemodule/autoload.php');