PHP 5.3 introduces namespaces to the language. Use of this mechanism should be preferred to
include or include_once or require or require_once because it solves two common problems:
Starting from its version 8, Drupal is relying on namespaces to be compliant with PSR-4 standard. Drupal's modules should be compliant with
PSR-4 standard and therefore should no longer rely on include or include_once or require or
require_once functions.
require_once('./modules/vegetable/src/Entity/Tomato.php');
use Drupal\vegetable\Entity\Tomato
This rule doesn't raise issues on autoload.php or ScriptHandler.php files.