InterMix
is a lightweight & versatile PHP library designed to provide commonly needed class-oriented tools with simplicity and efficiency. Whether you are managing dependencies or enhancing classes with macros, InterMix has you covered.
Library Version | PHP Version |
---|---|
2.x.x | 8.2.x or Higher |
1.x.x | 8.x.x |
Install InterMix using Composer:
composer require infocyph/intermix
Here’s how you can quickly get started with InterMix:
use Infocyph\InterMix\Container;
$container = new Container();
// Resolve and use the service
$exampleService = $container->get('example_service');
$exampleService->performAction();
$mixin = new class
{
public function greet($name)
{
return "Hello, $name!";
}
protected function whisper($message)
{
return "psst... $message";
}
};
MacroTestClass::mix($mixin);
$object = new MacroTestClass;
echo $object->greet('World'); // Hello, World!
echo $object->whisper('John'); // psst... John
Comprehensive documentation is available on Read the Docs. It covers everything from installation to advanced use cases.
To ensure the library is functioning as expected, you can run the test suite. Make sure you have the necessary dependencies installed:
composer install
composer test
We welcome contributions! If you encounter bugs, have feature requests, or want to help improve the library, please create an issue.
Need help? Open an issue or reach out through the GitHub repository. We’re here to help!
InterMix is licensed under the MIT License. Feel free to use and modify it as needed.