Autoloader for custom class instances.
This version supports PHP 8.0. You can install the package via composer:
composer require adrianmejias/veil
<?php
require_once __DIR__ . '/vendor/autoload.php';
use AdrianMejias\Veil\Veil;
// Register the autoloader
$veil = (new Veil)->register();
// An example when setting up a flolder and composer psr-4
// autoload is setup as: "Veils\\": "src/Veils/"
// FooVeil class extends VeilAbstract with instance of loadable class
$veil->add([
'Foo' => Veils\FooVeil::class, // The alias name and abstract class to alias against.
]);
// $veil->add('Foo', Veils\FooVeil::class);
// An example if the bar method in the Foo class returned 'world'
echo 'Hello, ' . \Foo::bar() . '!';
// use Foo;
// ...
// echo 'Hello, ' . Foo::bar() . '!';
Expected Output:
Hello, world!
composer test
- Add to packagist repo
- Add unit tests
- Add documentation for open source contributations
- Add GitHub Action for unit tests
- Add more unit test coverages
- Add more documentation to README.md
- Add API listing to README.md
Thank you for considering contributing to Veil! You can read the contribution guide here.
In order to ensure that the community is welcoming to all, please review and abide by the Code of Conduct.
Please see the security file for more information.
The MIT License (MIT). Please see the license file for more information.