InterMix

Security & Standards Codacy Badge Documentation Status Packagist Downloads License: MIT Packagist Version Packagist PHP Version GitHub Code Size

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.

Key Features

Prerequisites

Library Version PHP Version
2.x.x 8.2.x or Higher
1.x.x 8.x.x

Installation

Install InterMix using Composer:

composer require infocyph/intermix

Getting Started

Here’s how you can quickly get started with InterMix:

Dependency Injection Example

use Infocyph\InterMix\Container;

$container = new Container();

// Resolve and use the service
$exampleService = $container->get('example_service');
$exampleService->performAction();

Using Class Macros

$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

Documentation

Comprehensive documentation is available on Read the Docs. It covers everything from installation to advanced use cases.

Testing

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

Contributing

We welcome contributions! If you encounter bugs, have feature requests, or want to help improve the library, please create an issue.

Support

Need help? Open an issue or reach out through the GitHub repository. We’re here to help!

License

InterMix is licensed under the MIT License. Feel free to use and modify it as needed.