League Container Documentation

A simple but powerful PSR-11 dependency injection container

Enhanced Dark Theme

Welcome to the refreshed documentation with a beautiful dark mode theme. This new design features:

Code Example

Here's how the enhanced syntax highlighting looks:

<?php

use League\Container\Container;
use League\Container\ReflectionContainer;

// Create a new container instance
$container = new Container();

// Enable auto-wiring
$container->delegate(
    new ReflectionContainer()
);

// Add a service definition
$container->add(SomeService::class)
    ->addArgument('some-argument')
    ->addMethodCall('setLogger', [LoggerInterface::class]);

// Resolve the service
$service = $container->get(SomeService::class);

The new dark theme provides a more comfortable reading experience, especially during extended documentation sessions. The carefully chosen color palette reduces eye strain while maintaining excellent readability.

Typography Improvements

The typography has been significantly enhanced with:

Font Choices

We've switched to Source Serif Pro for body text, providing better readability and a more comfortable reading experience. Code blocks now use JetBrains Mono for enhanced code legibility with proper ligature support.

Size & Spacing

Base font size increased to 16pt with improved line height (1.7) for better readability. Headings have been rebalanced with improved spacing and visual hierarchy.

Get Started

Color Palette

The new GitHub-inspired dark color scheme includes: