Luminova Framework

PHP Luminova: Allow Direct Includes in a Class

Last updated: 2026-11-28 20:57:12

Use the AllowIncludes attribute to exempt a class from Luminova’s development check for direct PHP includes.

Apply #[AllowIncludes] to a class that needs direct include or require statements. For example, the development check for an HTTP controller honors this attribute.

use Luminova\Attributes\AllowIncludes;
use Luminova\Base\Http\AbstractController;

// Including files will not raise error 
include __DIR__ . '/pth/to/some/file.php';

#[AllowIncludes]
class LegacyViewController extends AbstractController
{
}

Class Definition

  • Full namespace: Luminova\Attributes\AllowIncludes
  • This class is final. The attribute targets classes and can be applied once per class.

__construct

Create the attribute. It accepts no options.

public function __construct()