Skip to content

v0.6.0

Choose a tag to compare

@clue clue released this 05 Mar 14:49
· 214 commits to main since this release
74fafca

Imported release from original tag date 2021-12-20.

  • Feature: Support automatic dependency injection by using class names (DI container).
    (#89, #92 and #94 by @clue)

    <?php
    
    require __DIR__ . '/../vendor/autoload.php';
    
    $app = new FrameworkX\App(Acme\Todo\JsonMiddleware::class);
    
    $app->get('/', Acme\Todo\HelloController::class);
    $app->get('/users/{name}', Acme\Todo\UserController::class);
    
    $app->run();
  • Feature: Add support for explicit DI container configuration.
    (#95, #96 and #97 by @clue)

    <?php
    
    require __DIR__ . '/../vendor/autoload.php';
    
    $container = new FrameworkX\Container([
        Acme\Todo\HelloController::class => fn() => new Acme\Todo\HelloController();
        Acme\Todo\UserController::class => function (React\Http\Browser $browser) {
            // example UserController class requires two arguments:
            // - first argument will be autowired based on class reference
            // - second argument expects some manual value
            return new Acme\Todo\UserController($browser, 42);
        }
    ]);
    
    // …
  • Feature: Refactor to use $_SERVER instead of getenv().
    (#91 by @bpolaszek)

  • Minor documentation improvements.
    (#100 by @clue)

  • Update test suite to use stable PHP 8.1 Docker image.
    (#90 by @clue)